[Scons-users] Cyclic references between lib archives

Ivan Kravets me at ikravets.com
Wed Feb 4 15:35:01 EST 2015


Hi,

Can someone explain me how to setup cyclic references between lib archives? 
We can tell gcc-linker which libs should be "cyclic" via --start-group archives --end-group.

I use gcc for linking and these options should pass to "linker", not to "compiler". In this case it looks like:
-Wl,--start-group archives -Wl,--end-group

==== SCons ======
For example, "LINKFLAGS" for Atmel AVR platform looks like:
https://github.com/ivankravets/platformio/blob/develop/platformio/builder/scripts/atmelavr.py#L58

The "console" output looks like:
avr-g++ -o .pioenvs/autogen_uno/firmware.elf -Os -mmcu=atmega2560 -Wl,--gc-sections -Wl,--start-group .pioenvs/autogen_uno/src/Piccolo.o -L.pioenvs/autogen_uno .pioenvs/autogen_uno/libAdafruit_LED_Backpack_ID128.a .pioenvs/autogen_uno/libAdafruit_GFX_ID13.a .pioenvs/autogen_uno/libWire.a .pioenvs/autogen_uno/libffft.a .pioenvs/autogen_uno/libFrameworkArduino.a -lm

Source code for "Build Program" is here:
https://github.com/ivankravets/platformio/blob/develop/platformio/builder/tools/platformio.py#L45

src.Program(
       join("$BUILD_DIR", "firmware"),
       [src.GlobCXXFiles(vdir) for vdir in vdirs],
       LIBS=deplibs + corelibs,
       LIBPATH="$BUILD_DIR",
       PROGSUFFIX=".elf")

....

The question: which is correct way to pass "-Wl,--end-group" after ".pioenvs/autogen_uno/libffft.a" ?

P.S: I'm not sure that pass "-Wl,--end-group" to "LIBS" is good idea.

Thanks a lot!
With best regards, Ivan Kravets
   - "Creativity comes from talent and never from knowledge" (c)
________________________
http://www.ikravets.com






More information about the Scons-users mailing list