This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/LAUNCHXL-CC2650: Linker error when compiling examples

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650

Tool/software: TI-RTOS

I have downloaded ti-rtos for linux and installed it.

When i try to build one of the examples i get an error with the linker:

linking... /opt/gcc-arm-none-eabi-6_2-2016q4/bin/../lib/gcc/arm-none-eabi/6.2.1/../../../../arm-none-eabi/bin/ld: cannot find -l:/opt/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib collect2: error: ld returned 1 exit status makefile:68: recipe for target 'hello.out' failed make: *** [hello.out] Error 1

What is the problem?

As far as i can see the file that is missing driverlib.lib is at the place it shall be.

  • What version of TI-RTOS are you using? Have you updated the top-level imports.mak or tirtos.mak files are needed (depends on which version you are using). Did you install it into a path with space? The tooling in the product does not like spaces.

    Todd
  • Peter Rasmussen13 said:
    cannot find -l:/opt/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib

    There's a ":" (colon) in between the "-l" and "/opt/..." above which seems like it might be the problem.  Please check your macro definitions in imports.mak, I suspect there is a ":" that shouldn't be where it is.

    Regards,

     - Rob

  • I am using the latest: 

    2.21.00.06 
    13 Sep 2016

    I have updated the tirtos.mak file and i have installed to /opt/ti and installed the examples to /Repo/

  • the colon is a part of the makedefs file provided by TI:

    LFLAGS = -Wl,-T,CC2650_LAUNCHXL.lds -Wl,-Map,$(NAME).map -Wl,-T,$(NAME)/linker.cmd -l:$(CC26XXWARE_INSTALL_DIR)/driverlib/bin/gcc/driverlib.lib -march=armv7-m -mthumb -nostartfiles -static -Wl,--gc-sections -L$(BIOS_PACKAGES_DIR)/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m -lgcc -lc -lm -lnosys


    I have tried removing it , it does not change the error or solve the problem
  • Peter Rasmussen13 said:
    the colon is a part of the makedefs file provided by TI:

    It looks like a change in how the GNU linker between gcc-arm-none-eabi-4_9-2015q3, which is what CCS 7 installs, and the later gcc-arm-none-eabi-6_2_2016q4, handles the -l option.

    With tirtos_cc13xx_cc26xx_2_21_00_06 under Windows I was able to build an example using the gcc-arm-none-eabi-4_9-2015q3 installed by CCS 7 successfully, and there is a colon after the -l option:

    'Invoking: GNU Linker'
    "C:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -Dgcc -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -fno-strict-aliasing -std=c99 --asm -march=armv7-m -mthumb -Wl,-Map,"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m" -march=armv7-m -mthumb -o"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out" "./CC2650_LAUNCHXL.o" "./ccfg.o" "./pwmled.o" -Wl,-T"../CC2650_LAUNCHXL.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -l:C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib -lgcc -lm -lnosys -lc -Wl,--end-group 
    'Finished building target: pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out'

    Whereas when I downloaded gcc-arm-none-eabi-6_2_2016q4 compiler  you are using, and changed the compiler version used in the example the link then fails:

    'Invoking: GNU Linker'
    "C:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-6_2_2016q4/bin/arm-none-eabi-gcc.exe" -Dgcc -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -fno-strict-aliasing -std=c99 --asm -march=armv7-m -mthumb -Wl,-Map,"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m" -march=armv7-m -mthumb -o"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out" "./CC2650_LAUNCHXL.o" "./ccfg.o" "./pwmled.o" -Wl,-T"../CC2650_LAUNCHXL.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -l:C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib -lgcc -lm -lnosys -lc -Wl,--end-group 
    makefile:149: recipe for target 'pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out' failed
    c:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-6_2_2016q4/bin/../lib/gcc/arm-none-eabi/6.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -l:C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib
    collect2.exe: error: ld returned 1 exit status

    Is there a reason you need to use the later gcc-arm-none-eabi-6_2_2016q4, rather than the gcc-arm-none-eabi-4_9-2015q3 which TI-RTOS was presumably tested against?

    I think the TI-RTOS makefiles would need to be changed to work with the later GCC compiler, but haven't investigated the details.

  • I just installed gcc-arm-none-eabi-4_9-2015q3 and i get the exact same error.

    I am testing under ubuntu, but i hope it shout not matter

  • I just installed gcc-arm-none-eabi-4_9-2015q3 and i get the exact same error.

    I am testing under ubuntu, but i hope it shout not matterI tried CCS 6.1.3 under CentOS 6 and using gcc-arm-none-eabi-4_9-2015q3 was successfully able to link an example which has a colon between the -l option and the driverlib.lib pathname:

    Building target: pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out
    Invoking: GNU Linker
    "/opt/ti/ti_ccs6_1_3/ccsv6/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc" -march=armv7-m -mthumb -Dgcc -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.map" -nostartfiles -static -Wl,--gc-sections -L"/home/Mr_Halfword/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m" -march=armv7-m -mthumb -o"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out" "./CC2650_LAUNCHXL.o" "./ccfg.o" "./pwmled.o" -Wl,-T"../CC2650_LAUNCHXL.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -l:/home/Mr_Halfword/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib -lgcc -lm -lnosys -lc -Wl,--end-group 
    Finished building target: pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out

    There's a ":" (colon) in between the "-l" and "/opt/..." above which seems like it might be the problem.

    The colon comes from the .projectspec file which is used when importing a project. E.g. C:\ti\tirtos_cc13xx_cc26xx_2_21_00_06\resources\cc2650LaunchPad\driverExamples\gnuDriverExamples\pwmExamples\com_ti_rtsc_tirtoscc13XX_CC26XX_example_281.projectspec contains:

            linkerBuildOptions=" -l:${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INSTALL_DIR}/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib -march=armv7-m -mthumb -nostartfiles -static -Wl,--gc-sections -L${xdc_find:gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m:${ProjName}} -lgcc -lc -lm -lnosys"

    The meaning of the colon doesn't appear to be documented for the GCC linker options. I found How to customize the meaning of the “-l” flag for GCC? which says the use of a colon is an un-documented option to allow an absolute library pathname to be specified in the -l option. The referenced StackOverflow answer says an absolute library file can also be given to the linker without the -l prefix.

    With CCS 7 under Windows 7 I imported the pwmled_CC2650_LAUNCHXL_GNU_CC2650F128 and with gcc-arm-none-eabi-6_2_2016q4 used as the compiler the link failed with:

    'Invoking: GNU Linker'
    "C:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-6_2_2016q4/bin/arm-none-eabi-gcc.exe" -Dgcc -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -fno-strict-aliasing -std=c99 --asm -march=armv7-m -mthumb -Wl,-Map,"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m" -march=armv7-m -mthumb -o"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out" "./CC2650_LAUNCHXL.o" "./ccfg.o" "./pwmled.o" -Wl,-T"../CC2650_LAUNCHXL.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -l:C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib -lgcc -lm -lnosys -lc -Wl,--end-group 
    makefile:149: recipe for target 'pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out' failed
    c:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-6_2_2016q4/bin/../lib/gcc/arm-none-eabi/6.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -l:C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib
    collect2.exe: error: ld returned 1 exit status

    To get the example to link:

    1) Removed ":${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INSTALL_DIR}/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib" from the Libraries. i.e. changed from:

    To:

    2) Added  "${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INSTALL_DIR}/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib" to the Command-line pattern for the Linker. e.g. without the colon prefix:

    And the link was now successful:

    'Building target: pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out'
    'Invoking: GNU Linker'
    "C:/ti_ccs7_0/ccsv7/tools/compiler/gcc-arm-none-eabi-6_2_2016q4/bin/arm-none-eabi-gcc.exe" -Dgcc -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -fno-strict-aliasing -std=c99 --asm -march=armv7-m -mthumb -Wl,-Map,"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/armv7-m" -march=armv7-m -mthumb -o"pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out" "./CC2650_LAUNCHXL.o" "./ccfg.o" "./pwmled.o" -Wl,-T"../CC2650_LAUNCHXL.lds" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lgcc -lm -lnosys -lc -Wl,--end-group  "C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc/driverlib.lib"
    'Finished building target: pwmled_CC2650_LAUNCHXL_GNU_CC2650F128.out'

    Changing the linker command-line pattern is a bodge to get the absolute pathname of a library file passed by CCS at the end of the linker command line, and not sure if could be done in a .projectspec file. A better solution would be to:

    a) Rename the GCC library file driverlib.lib to libdriver.a, to match the GCC linker expected filename pattern for libraries specified with the -l option.

    b) In the linker project properties add "${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INSTALL_DIR}/products/cc26xxware_2_24_03_17272/driverlib/bin/gcc" to the library search path and "driver" to the libraries:

    I tested these changed on an imported example, not sure how the .projectspec files which are used to import examples from TI-RTOS was generated.