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.

tiarmclang WSL linker failure

Other Parts Discussed in Thread: TDA4VM

The tiarmclang linker fails on WSL (18.04)  for the demo application mentioned in link:

https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/getting_started_guide/building_simple_application.html

Error message:

error #10450-D: Attempted to add non archive file into group archive, specify
   it outside of the --start-group & --end-group options.
error #10010: errors encountered during linking;

The object and library files are created. Just the final linking fails. This works fine in Ubuntu.

  • The tiarmclang linker fails on WSL (18.04)

    Sorry, but I had to go learn about WSL (Windows Subsystem for Linux).  My understanding is that WSL does not, by itself, supply a command shell or other similar tooling.  You have to add a Linux distribution to it.  So, which Linux distribution did you add?  

    Do you run tiarmclang from a command shell?  For now, I presume so.

    Please show all the compile and link commands.  Please copy-and-paste the text, and do not use a screen shot.  If it is more convenient, capture it in a text file and attach that to your next post.

    Thanks and regards,

    -George

  • Hi George,

    The WSL is based on Ubuntu 18.04. I used the same commands as mentioned in the Simple application link mentioned before.

    And yes i run this from WSL terminal.

    Command:

    ../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang -v -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 hello.c -o hello_world.out -Xlinker -llnkme.cmd -Xlinker -mhello_world.map

    Is there a way to suppress the archive groups auto added by the compiler?

    user@PC:/mnt/d/V2X/VCM/Test$ ../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang -v -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 hello.c -o hello_world.out -Xlinker -llnkme.cmd -Xlinker -mhello_world.map
    TI Arm Clang Compiler 1.3.0.LTS
    Target: arm-ti-none-eabi
    Thread model: posix
    InstalledDir: /mnt/d/V2X/VCM/Test/../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/bin
     "/mnt/d/V2X/VCM/Git_Backup/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang" -cc1 -triple thumbv7em-ti-none-eabihf -emit-obj -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -nostdsysteminc -fno-zero-initialized-in-bss -fdef-uninit-in-bss -fcommon -ffunction-sections -fdata-sections -fno-delete-null-pointer-checks -fwchar-type=int -fshort-enums -target-cpu cortex-m4 -target-feature -crc -target-feature -sha2 -target-feature -aes -target-feature -dotprod -target-feature +dsp -target-feature -mve -target-feature -mve.fp -target-feature -ras -target-feature -bf16 -target-feature -sb -target-feature -i8mm -target-feature -lob -target-feature -cdecp0 -target-feature -cdecp1 -target-feature -cdecp2 -target-feature -cdecp3 -target-feature -cdecp4 -target-feature -cdecp5 -target-feature -cdecp6 -target-feature -cdecp7 -target-feature -hwdiv-arm -target-feature +hwdiv -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -crypto -target-feature -fp16fml -target-abi aapcs -fvisibility hidden -mfloat-abi hard -fallow-half-arguments-and-returns -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /mnt/d/V2X/VCM/Git_Backup/ti-cgt-armllvm_1.3.0.LTS/lib/clang/12.0.1 -internal-isystem /mnt/d/V2X/VCM/Git_Backup/ti-cgt-armllvm_1.3.0.LTS/lib/clang/12.0.1/include -internal-isystem /mnt/d/V2X/VCM/Test/../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/include/c -fdebug-compilation-dir /mnt/d/V2X/VCM/Test -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -o /tmp/hello-9af779.o -x c hello.c
    clang -cc1 version 12.0.1 based upon LLVM 12.0.1 default target arm-ti-none-eabi
    ignoring duplicate directory "/mnt/d/V2X/VCM/Git_Backup/ti-cgt-armllvm_1.3.0.LTS/lib/clang/12.0.1/include"
    #include "..." search starts here:
    #include <...> search starts here:
     /mnt/d/V2X/VCM/Git_Backup/ti-cgt-armllvm_1.3.0.LTS/lib/clang/12.0.1/include
     /mnt/d/V2X/VCM/Test/../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/include/c
    End of search list.
     "/mnt/d/V2X/VCM/Test/../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmlnk" -I/mnt/d/V2X/VCM/Test/../Git_Backup/ti-cgt-armllvm_1.3.0.LTS/lib -o hello_world.out /tmp/hello-9af779.o -llnkme.cmd -mhello_world.map --start-group -llibc++.a -llibc++abi.a -llibc.a -llibsys.a -llibsysbm.a -llibclang_rt.builtins.a -llibclang_rt.profile.a --end-group
    error: Attempted to add non archive file into group archive, specify it outside
       of the --start-group & --end-group options.
    error: errors encountered during linking; "hello_world.out" not built
    tiarmclang: error: tiarmlnk command failed with exit code 1 (use -v to see invocation)

  • I cannot see where the compiler is doing anything unusual.  Therefore, I have to suspect some problem with WSL .  Perhaps there is some problem in a low level system call that causes the linker to think one or more of the library files (the something.a files) is not a library, when it really is a library.

    Unfortunately, I don't see anything else we can do to help resolve this problem.

    I know this next part is not helpful, but I still think I should point out ... TI does not test tiarmclang with WSL, nor does it document support for it.

    Thanks and regards,

    -George

  • Please let me know which TI ARM device you use.

    Thanks and regards,

    -George

  • Hi George,

    I'm working on TDA4VM.

    Made some progress. The issues seems to be with libsys.a. If i remove that manually in the tiarmlnk it works.

    i think the libsys.a i have is a corrupted one as running tiarmobjdump fails with error

    ./tiarmobjdump: error: '../lib/libsys.a': The file was not recognized as a valid object file on WSL but in ubuntu no output is displayed and no error message as well.

    Where can i get a valid libsys.a? I took the base from ti-cgt-armllvm_1.3.0.LTS

  • My guess is the file was corrupted during the download or installation.  Please consider starting over fresh, by repeating the download and installation.  Or upgrade to a more recent version, such as 1.3.1.LTS or 2.0.0.STS.  All are available on the ARM code generation tools page.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for reply. Can you tell the side effects of this faulty libsys.a so far things are working fine while compiling on ubuntu side.

  • Can you tell the side effects of this faulty libsys.a

    Unfortunately, no.  I cannot explain why the Ubuntu build works and the WSL build fails.

    Thanks and regards,

    -George

  • Hi George,

    I tried both 1.3.1.LTS and 2.0.0.STS the libsys.a seems to be corrupted or empty.

    Normally in the other lib*.a files there is a reference to the architecture based archive like armv7/6 archive. This one does not have it.

    What kind of functions are present in libsys.a?

  • libsys.a is not a library of object files.  It is an index library file built with the utility tiarmlibinfo.  In current releases of tiarmclang, it contains 0 libraries.  It's a placeholder for now.  While this is a little unusual, it is supported.  I continue to suspect an error by some low level file operation in WSL is the cause of the problem.

    Thanks and regards,

    -George

  • Hi George,

    Thank you for your support so far.

    I used tiarmlibinfo to create an empty index library and named it libsys.a. That works! its detected as a valid library file.

    I'm attaching the screenshot of the difference between the two file.

    I'm closing this issue as this work around will solve the build issue.