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.

AM62P: TI CLANG TOOLCHAIN

Part Number: AM62P

Tool/software:

I'm working with an SDK example and have organized the code into three libraries: one for FreeRTOS, one for the example's application-specific code, and one for the board support package (BSP) drivers. During the linking process, I'm encountering this warning:

warning: cannot resolve archive
/data/cm_test/ssp_hal/implementations/host/am62p/tools/TI-Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib/libc.a to a compatible library, as no input files have been encountered

The linker command I'm using is:

/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/bin/tiarmlnk" -I/data/cm_test/ssp_hal/implementations/host/am62p/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib -o /data/cm_test/cm_test/projects_output_folder/Common_Modem_AM62P_OUT/Common_Modem_AM62P.out --diag_suppress=10063 --priority --ram_model --reread_libs -m=/data/cm_test/cm_test/projects_output_folder/Common_Modem_AM62P_OUT/Common_Modem_AM62P.map /data/cm_test/cm_test/lib/ssp_hal/AM62P/build/Common_Modem_AM62P_build/AM62P.lib /data/cm_test/cm_test/lib/ssp_openrtos/build/Common_Modem_AM62P_build/ssp_openrtos.lib /data/cm_test/cm_test/sources/Target_Specific/AM62P/build/Common_Modem_AM62P_build/AM62P.lib -l/data/cm_test/ssp_hal/implementations/host/am62p/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib/libc.a -l/data/cm_test/ssp_hal/implementations/host/am62p/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib/libsysbm.a /data/cm_test/cm_test/sources/Target_Specific/AM62P/Linker_config/linker.cmd --start-group -llibc++.a -llibc++abi.a -llibc.a -llibsys.a -llibsysbm.a -llibclang_rt.builtins.a -llibclang_rt.profile.a --end-group

Is it possible to link these libraries directly to create the binary, without providing the individual object files?

  • Hello,

    I have brought this thread to the attention of the compiler experts. Please note that due to the local holiday responses may be delayed.

    Thanks

    ki

  • Please add this option near the beginning of the tiarmclang command ...

    -Wl,--undef_sym=main

    While I'm confident enough to make this suggestion, please understand that I cannot test it in your project.

    To understand why it works, please see this entry about --undef_sym from the tiarmclang online manual.

    Thanks and regards,

    -George

  • Hi George,My project is structured such that the driver code, the FreeRTOS kernel, and the main application code are each compiled and packaged into their own separate libraries. So, the linking process involves combining these three pre-existing libraries, rather than individual object files.

    While -undef_sym helps when a symbol isn't automatically included from a library, my situation is different. The linker warnings indicate that I haven't provided any compiled code (object files) as input, so there's nothing for it to link or resolve symbols against.

    Linking: am62px:wkup-r5fss0-0:freertos:ti-arm-clang Common_Modem_AM62P ...
    driver_stuff/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/bin/tiarmclang -Wl,--diag_suppress=10063 -Wl,--priority -Wl,--ram_model -Wl,--reread_libs -Wl,-m=hello_world//projects_output_folder/Common_Modem_AM62P_OUT/Common_Modem_AM62P.map -o hello_world//projects_output_folder/Common_Modem_AM62P_OUT/Common_Modem_AM62P.out -Wl,--undef_sym=main -ldata/cm_test/cm_test/projects_output_folder/Common_Modem_AM62P_OUT/hello.lib -ldriver_stuff/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib/libc.a -ldriver_stuff/tools/TI_Clang_toolchain/ti-cgt-armllvm_4.0.1.LTS/lib/libsysbm.a hello_world/sources/Target_Specific/AM62P/Linker_config/linker.cmd
    warning: cannot resolve archive
    driver_stuff/tools/TI_Clang_toolchain/ti
    -cgt-armllvm_4.0.1.LTS/lib/libc.a to a compatible library, as no input files
    have been encountered

  • The linker warnings indicate that I haven't provided any compiled code (object files) as input, so there's nothing for it to link or resolve symbols against.

    That's correct.  If you cannot supply any object files, the only way to overcome this situation is by using --undef_sym as I describe in my previous post.

    Thanks and regards,

    -George