[build2] [build2 0.7-a.0] How to use start-group / end-group in config.c.loptions
Mueller Tobias (DC-MH/EMF1)
tobias.mueller2 at boschrexroth.de
Mon Feb 26 14:55:18 UTC 2018
Hi,
Is there a way to use -Wl,--start-group $(objects) $(libraries) -Wl,--end-group in config.cc.loptions?
After compiling the objects the following steps need to be done to get a HEX file:
1. Link relative
2. Redirect global variable references
3. Link absolute
4. HEX generation
The "link relative" step is done by build2 however the order of the objects and libraries seems to be different than expected for the second step if "-Wl,--start-group %OBJECTFILES% %LIBRARIES% -Wl,--end-group" would be used.
Current build2 setting for config.cc.loptions= -mcpu=MCU_JDP_UC1 -mfixed-sda -Wl,-r -nostdlib -Wl,--cref -Wl,-no-demangle,-demangle=none -Wl,--extmap=a -ferror-numbers -Wl,-T -Wl,rel_linker_cmd.lcf -Wl,-Map -Wl,_bin/relocatable.map -Wl,--mcpu=z425Bn3 -lspfpmath -lgcc
Here the complete commands (from a Windows batch file) including all arguments:
1. ppc-vle-gcc -mcpu=MCU_JDP_UC1 -mfixed-sda -Wl,-r -nostdlib -Wl,--cref -Wl,-no-demangle,-demangle=none -Wl,--extmap=a -ferror-numbers -Wl,-T -Wl,rel_linker_cmd.lcf -Wl,--start-group %OBJECTFILES% %LIBRARIES% -Wl,--end-group -Wl,-Map -Wl,%OUTPUT_PATH%/relocatable.map -Wl,--mcpu=z425Bn3 -lspfpmath -lgcc -o %OUTPUT_PATH%/relocatable.elf
2. ppc-vle-vared -w -l -efull -i %OUTPUT_PATH%\relocatable.elf -c mcop_adaptrefs.txt -o %OUTPUT_PATH%\reloc_vared.elf
3. ppc-vle-gcc -mcpu=MCU_JDP_UC1 -mfixed-sda -nostdlib -Wl,--cref -Wl,-no-demangle,-demangle=none -Wl,--warn-once -Wl,--extmap=a -Wl,--warn-section-align -Wl,--warn-orphan -ferror-numbers -Wl,-T -Wl,prj_linker_cmd.lcf -Wl,-Map -Wl,%OUTPUT_PATH%\%MODULE_NAME%.map -Wl,--mcpu=z425Bn3 %OUTPUT_PATH%\reloc_vared.elf -o %OUTPUT_PATH%\%MODULE_NAME%.elf
Best regards
Tobias
More information about the users
mailing list