Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QBS 1.7.1 on Qt Creator 4.2.1 — Link Fails Due to cpp.linkerFlags Parameters Order
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ReiViloR Offline
    ReiViloR Offline
    ReiVilo
    wrote on last edited by ReiVilo
    #1

    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!

    ReiViloR 1 Reply Last reply
    0
    • ReiViloR Offline
      ReiViloR Offline
      ReiVilo
      wrote on last edited by
      #4

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

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

      1 Reply Last reply
      1
      • ReiViloR ReiVilo

        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!

        ReiViloR Offline
        ReiViloR Offline
        ReiVilo
        wrote on last edited by ReiVilo
        #2

        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.

        1 Reply Last reply
        0
        • ReiViloR Offline
          ReiViloR Offline
          ReiVilo
          wrote on last edited by
          #3

          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)

          1 Reply Last reply
          0
          • ReiViloR Offline
            ReiViloR Offline
            ReiVilo
            wrote on last edited by
            #4

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

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

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved