Community
Participate
Working Groups
Build Identifier: 20100617-1415 one of the users of my GNU ARM Plug-in (SourceForge) noticed a weird problem: when using file specific settings, the secondaryOutputs are no longer generated (I use the secondary outputs to convert from elf to hex and for other embedded specific outputs) I studied the problem and noticed that when using file specific settings, the generated makefile is incomplete, in my case, instead of: # Add inputs and outputs from these tool invocations to the build variables SECONDARY_FLASH += \ t01cpp.hex \ SECONDARY_LIST += \ t01cpp.lst \ SECONDARY_SIZE += \ t01cpp.siz \ I get # Add inputs and outputs from these tool invocations to the build variables SECONDARY_FLASH += \ SECONDARY_LIST += \ SECONDARY_SIZE += \ i.e. the secondaryOutputs targets are null. after a debugging session on CDT, I discovered that calculateToolInputsOutputs() in GnuMakefileGenerator.java calls the embedded visit() code twice, once for the higher level tools and again for the file with specific configs. on the first run, the getTopBuildOutputVars() map is completely filled in, including the secondary output definitions. on the second run, the same map is completely reinitialised with empty definitions, so all settings from the first run are lost. I'm not fully aware of the consequences (like some of the entries in the map accumulating duplicate values from each run with identical tools?), but at least in my tests not reinitialising the map for each run generated the correct secondary output definitions. another good question is what happens with hierarchic folder settings, does the settings overwrite or accumulate? the changes I made are in GnuMakefileGenerator.java, around line 3955, I entered a new line before addMacroAdditionPrefix(map, macroName, "", false); //$NON-NLS-1$ and the result looks like this: if (!map.containsKey(macroName)) addMacroAdditionPrefix(map, macroName, "", false); //$NON-NLS-1$ Reproducible: Always Steps to Reproduce: 1. create a project using a toolchain with secondary outputs 2. build the project, everything is fine, the secondary outputs are created 3. change the settings for a single file (like a preprocessor definition) 4. build the project: the secondary outputs are no longer created
This bug also affects Windows (7Pro) platform. Changing setting of projects subfolder also breaks secondary outputs. Eclipse version: Version: Helios Service Release 2 Build id: 20110301-1815
Could someone tell me if this fix has made it into an official CDT release?
Are there any updates to this bug?
Just bumped into this. It looks this is still present in Kepler. :/
https://git.eclipse.org/r/#/c/17735/
I ran the org.eclipse.cdt.managedbuilder.core.tests and out of the 318 test cases, on my OS X, 11 (eleven) fail anyway, either with or without my patch, so I assume I'm not breaking anything.
Liviu, could you comment on the solution suggested in bug 227607?
I guess it is ok. In my plug-in, the tools that have secondary buildVariables use the linker output, so they are present only in the root container, and need not be processed more than once. I could not think of a configuration using secondary buildVariables in the few tools (AS, GCC, G++) referred in folder or file containers, but on the other side I cannot tell that there are not/will not be, since people with more imagination may find interesting usage cases for them... Comparing solutions, for my patch there is a remote theoretical risk of adding an entry for multiple times, while for the patch suggested in bug 227607 there is a risk of not adding an entry that was defined for tools that are used only in folder/file containers (assuming that this is possible).
OK. I like your patch better. Committed to master via Gerrit. Thank you.
*** Bug 227607 has been marked as a duplicate of this bug. ***
None of the two solutions is perfect. Probably on the next bug related to this issue, a thorough analysis will be done and a better solution implemented. Thank you, Andrew, for your support.
BTW, what are the managedbuild test cases that fail on your system?
Created attachment 237165 [details] all_tests the failed tests os OS X, packed