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.

armcl linker does not find the project specific object libraries when built from outside CCS

Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

Hi,

Good Morning.

I am trying to build one simple hello world program to be used with Cortex-M3 -IPU-1 of DRA72x SoC outside of CCS with my make.When i try compiling my helloworld.c with armcl , i see a warning/error coming up  in the linking stage after object file- helloworld.o and its lib is successfully generated in the first stage of compilation.

<Linking>
warning: cannot resolve archive
   /opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib/libc.a to a compatible library,
   as no input files have been encountered
fatal error: no input files

When googled, i found , it looks linker not able to find the source libraries generated. But  i have used -l option to mention path the generated library.Please find the commands used attached below.And let me know if option or environment variable to be set up.

Note:

Compiler Invocation command used.

/opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl --preproc_with_compile --preproc_dependency="out/NGI2_M4/obj/helloworld.tmp" -mv=7M3  --obj_directory=out/NGI2_M4/obj  -eo=.o -c -me --abi=eabi  -g   -O2   -Ibb_imp_test_back/bb_imp_test_imp/_src -Iout/include/sysbios_arm -Iout/include/common -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/include bb_imp_test_back/bb_imp_test_imp/_src/helloworld.c

/opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl -mv=7M3  -g --diag_warning=225  --abi=eabi -z -m=out/NGI2_M4/bin/test.map -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib --reread_libs --rom_model -l "libc.a"  -o out/NGI2_M4/bin/test.out  -l out/NGI2_M4/lib/libtest.a

 out/NGI2_M4/lib/libtest.a -This library is already generated

Thanks for your support.

With regards,

Jeyaseelan

 

 

  • jeyaseelan kirubaharan said:
    /opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl -mv=7M3  -g --diag_warning=225  --abi=eabi -z -m=out/NGI2_M4/bin/test.map -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib --reread_libs --rom_model -l "libc.a"  -o out/NGI2_M4/bin/test.out  -l out/NGI2_M4/lib/libtest.a

    In that linker command line I can't see any input files.

    Try adding the helloworld.o object file as an input for the linker.

  • Thanks for the reply ,After adding the input .obj file ,still getting the error along with some warnings.

    make: *** [out/NGI2_M4/bin/test.out] Error 1
    xzgsg5:~/NGI-2$ /opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl -mv=7M3 -g --diag_warning=225 --abi=eabi -z -m=out/NGI2_M4/bin/test.map -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib --reread_libs --rom_model -l "libc.a" -o out/NGI2_M4/bin/test.out -l out/NGI2_M4/lib/libtest.a out/NGI2_M4/obj/helloworld.o
    <Linking>
    warning: cannot resolve archive
    /opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib/libc.a to a compatible library,
    as no input files have been encountered
    error: no input section is linked in
    warning: entry-point symbol "_c_int00" undefined
    warning: no suitable entry-point found; setting to 0
    error: errors encountered during linking; "out/NGI2_M4/bin/test.out" not built

    >> Compilation failure

    Can you find out where the error could be ? I did not pass linker script intentionally.

    With regards,
    Jeyaseelan
  • The part of the command which mentions the one object file ...

    jeyaseelan kirubaharan said:
    out/NGI2_M4/obj/helloworld.o

    ... must appear before -l libc.a.  

    Thanks and regards,

    -George

  • Thanks George.It worked,after placing the object file before the libc.a
    /opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl -mv=7M3 -g --diag_warning=225 --abi=eabi -z -m=out/ngi2_m4/bin/hellotest.map -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib --reread_libs --rom_model -o out/ngi2_m4/bin/hellotest.out out/ngi2_m4/obj/helloworld1.o -l "libc.a" -l out/ngi2_m4/lib/libcom_proxy.a

    Just have another question,In one old project(the one i refer) ,the following command still worked,where all the dependent objects are grouped into libraries and only these libraries are passed for final linking.In my first post i tried to follow this rule only.

    /opt/ti/ccsv5/tools/compiler/arm_5.0.5/bin/armcl --silicon_version=7M4 -g --diag_warning=225 --abi=eabi -z -m=out/vp2_m4/bin/vp2_m4.map -I/opt/ti/ccsv5/tools/compiler/arm_5.0.5/lib -l ./sw/os/sysbios/benelli_M4//linker.cmd --reread_libs --warn_sections --ram_model --mapfile_contents=sym_defs -l "libc.a" sw/cfg/linker.cmd -o out/vp2_m4/bin/vp2_m4.out -l out/vp2_m4/lib/libapplication_manager.a
  • Can you let me know in what way the the last command differs and how it works?
  • This linker command file ...

    jeyaseelan kirubaharan said:
    -l ./sw/os/sysbios/benelli_M4//linker.cmd

    ... appears before -l "libc.a".  It probably mentions one or more object files.

    Thanks and regards,

    -George

  • Adding the linker.cmd file into the command line resolved the issue, though it do not have any mention about object files.Thanks for the help George.