Community
Participate
Working Groups
The MBS generated makefile makes the top-level archiver rule depend on static library in referenced projects. The result is that archives are very frequently remade taking time. To reproduce: 1) Create 2 static library projects p1, p2 2) Add a CDT reference between them 3) Build the project doing the referencing. The generated makefile looks like: dependents: -cd /projects/firepath/apps/work/jamesb/runtime-New_configuration/p1/Debug && $(MAKE) clean all # Tool invocations libp2.a: $(OBJS) $(USER_OBJS) /projects/firepath/apps/work/jamesb/runtime-New_configuration/p1/Debug/libp1.a @echo 'Building target: $@' @echo 'Invoking: GCC Archiver' ar -r "libp2.a" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' Although there may be an include dependency between the source in the two projects, building the archive doesn't actually require the archive from the referenced project (this dependency is important for .exes and .sos). The call-tree producing this is: (1) GnuMakefileGenerator.getToolInputsOutputs(...) line: 1812 (2) GnuMakefileGenerator.addRuleForTool(...) line: 1584 (3) GnuMakefileGenerator.addTargetsRules(...) line: 1500 (4) GnuMakefileGenerator.addTargets(...) line: 1422 (5) GnuMakefileGenerator.populateTopMakefile(...) line: 1139 (6) GnuMakefileGenerator.generateMakefiles(...) line: 722 (7) CommonBuilder.performMakefileGeneration(...) line: 999 The referenced artifacts are picked up in (4) as Vector<String> managedProjectOutputs containing the outputs of all the referenced configurations. Then in (1) they're all added to the set of tool dependencies. As this referenced outputs are used as an input to the tool, there should be some way of suppressing the addition of these dependencies.
Created attachment 179968 [details] patch 1 A potential patch for the issue. Don't generate refConfigs if the build configuration artifact type is a static archive. This may be too coarse-grained to commit, I'm not sure. However the current beavhiour invalidates the current archive far too frequently.
Committed to HEAD.
*** cdt cvs genie on behalf of jblackburn *** Bug 326671 - [Performance] MBS generated makefiles for static library projects add dependencies on referenced archives [*] GnuMakefileGenerator.java 1.100 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java?root=Tools_Project&r1=1.99&r2=1.100
*** cdt cvs genie on behalf of jblackburn *** Bug 326671 - Fix potential NPE when building old tests. [*] GnuMakefileGenerator.java 1.101 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java?root=Tools_Project&r1=1.100&r2=1.101