QBS 1.7.1 on Qt Creator 4.2.1 — Link Fails Due to cpp.linkerFlags Parameters Order



  • I've defined the following cpp.linkerFlags on QBS 1.7.1 for Qt Creator 4.2.1

    cpp.linkerFlags: [
      "-mcpu=cortex-m4",
      "-mfloat-abi=hard","-mfpu=fpv4-sp-d16","-mabi=aapcs","-fsingle-precision-constant",
      "-T",boardPackagePath+"variants/EK-TM4C123GXL/lm4fcpp_blizzard.ld",
      "-mthumb","-nostdlib","-nostartfiles",
      "-Wl,--gc-sections","-Wl,--check-sections","-Wl,--gc-sections","-Wl,--entry=ResetISR",
      "-Wl,--unresolved-symbols=report-all","-Wl,--warn-common","-Wl,--warn-section-align",
      boardPackagePath+"system/driverlib/libdriverlib.a", "-lm","-lc","-lgcc"
    ]
    

    The resulting Linking Test_2.elf is performed as

    arm-none-eabi-g++ {cpp.linkerFlags} {list of .o files}

    while the correct syntax for linking would be

    arm-none-eabi-g++ {cpp.linkerFlags} {list of .o files} {boardPackagePath}+system/driverlib/libdriverlib.a -lm -lc -lgcc

    How to define the last two lines with QBS

      boardPackagePath+"system/driverlib/libdriverlib.a", "-lm","-lc","-lgcc"
    

    so they are included after the list of .o files?

    Thank you!



  • Same with the MSP432.

    boardPackagePath+"system/driverlib/libdriverlib.a", "-lm","-lc","-lgcc" should be at the very end of the link command, after the list of files.



  • Example of complete implementation on mbedOS with LD_SYS_LIBS:

    @$(LD) $(LD_FLAGS) -T $(filter %.ld, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)



  • Please find the solution at https://bugreports.qt.io/browse/QBS-1123.

    Main culprit is the lack of structured documentation for Qbs available today.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.