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.

AM3358: linux-devkit compile code failed for ti-processor-sdk-linux-am335x-evm-09.01.00.001

Part Number: AM3358

Hi Experts:

I installed ti-processor-sdk-linux-am335x-evm-09.01.00.001 to build my example code.

And it seems  the toolchain prefix already changed from arm-none-linux-gnueabihf ( ti-processor-sdk-linux-am335x-evm-08.02.00.24)to  arm-oe-linux-gnueabi (ti-processor-sdk-linux-am335x-evm-09.01.00.001)

So, I tried to use arm-oe-linux-gnueabi-gcc to compile my test code.

I got fail as bellow, but it is no problem in ti-processor-sdk-linux-am335x-evm-08.02.00.24

[linux-devkit]:~/test/example> arm-oe-linux-gnueabi-gcc -o helloworld helloworld.c
In file included from /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h:23,
from /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/features.h:514,
from /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/bits/libc-header-start.h:33,
from /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/stdio.h:27,
from helloworld.c:1:
/home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
7 | # include <gnu/stubs-soft.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.

How can I slove this problem.

Thank you.

  • The recomended development host environment is ubuntu 22.04 are you on the same version?

    in 9.x (For kirkstone SDK) offering , we use default toolchain from yocto/OE distro. 

    Cannot comment on your example helloworld test program , but you would need to explore https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html and provide the necessary arguments to build the program .  Once rootcaused , review meta-arm@lists.yoctoproject.org for toolchain associated topics.

    Online search and reading thru arm options manual provided above, gives hint as "-mfloat-abi=hard" might work . 

  • Hi Praneeth:

    Thanks for your reponse,

    I am using ubuntu 18.04 to build it.

    And I just follow https://software-dl.ti.com/processor-sdk-linux/esd/AM335X/09_01_00_001/exports/docs/linux/Overview/GCC_ToolChain.html
    to create a helloworld.c file and build it.

    #include <stdio.h>
    
     int main() {
         printf ("Hello World from TI!!!\n");
         return 0;
     }

    below is my build commands,

    1. source linux-devkit/environment-setup

    2. ~/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc helloworld.c -o helloworld

    And then I got fail result.

    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory

    If I change command with options

    ~/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc helloworld.c -o helloworld -mfpu=neon -mfloat-abi=hard

    I got 

    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crt1.o: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crti.o: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crtbegin.o: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find -lgcc: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find -lgcc_s: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find -lc: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find -lgcc: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find -lgcc_s: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crtend.o: No such file or directory
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status

    But 08.02.00.24 is no such problem

    Thanks

  • This here is a recent working example, please note how it uses $CC for the cross-compile:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1309564/sk-am62a-lp-compile-c-files-using-aarch64-oe-linux-gcc/4975383#4975383

    This is also consistent with how it's discussed in some of our Linux SDK documentation for other devices, see https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/09_01_00/exports/docs/linux/Overview/GCC_ToolChain.html#linux-devkit

    ...as well as how it is described in our "Linux Academy" documentation, see the same topic but for AM62x for example (the AM335x devices do not have a "Linux Academy") https://dev.ti.com/tirex/explore/node?node=A__ATQnwE0K3ox3NhHt8iO5lQ__AM62-ACADEMY__uiYMDcq__LATEST

    It looks like selected devices like AM335x have an old section of that particular piece of documentation.

    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/11.4.0/ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status

    But 08.02.00.24 is no such problem

    From SDK v9.x onwards only the use via $CC is supported as per above, meaning you need to manually specify the --sysroot amongst other toolchain parameters, which is done automatically when using $CC. This change is probably related to our general toolchain changes we did moving from SDK v8.x to SDK v9.x.

    I filed an internal issue as SITSW-3605 to get our documentation updated for the devices that currently have non-working instructions like AM335x.

    Regards, Andreas

  • Hi Andreas:

    Thanks for your response and hint.

    I got the answer now,


    If I just use $CC to compile, I got 
    /home/zh/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
    7 | # include <gnu/stubs-soft.h>

    The solution as below.

    1. source environment-setup

    2. arm-oe-linux-gnueabi-gcc $CFLAGS helloworld.c -o helloworld

    or

    3. $CC helloworld.c -o helloworld -mfpu=neon -mfloat-abi=hard

     

    Thank you very much.

    Best Regards,
    YiFong

  • 1. source environment-setup

    2. arm-oe-linux-gnueabi-gcc $CFLAGS helloworld.c -o helloworld

    or

    3. $CC helloworld.c -o helloworld -mfpu=neon -mfloat-abi=hard

    For reference, the best/cleanest way is probably a combination of both approaches, so that we only rely on the provided variables rather than trying to re-create the list of flags, potentially forgetting some...

    # List all the compuiler flags that should be used
    [linux-devkit]:~/ti/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit> echo $CFLAGS 
    -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/home/a0797059/ti/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi
    
    # THIS is how we should document it in the SDK  docs for AM335/AM437x
    [linux-devkit]:~/ti/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit> $CC $CFLAGS hello_world.c -o hello_world
    
    # All worked
    [linux-devkit]:~/ti/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit> file hello_world
    hello_world: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=6c861fdcc13bfb38b4f3ce0b7274b9ce0cd5db1e, for GNU/Linux 3.2.0, with debug_info, not stripped

    I filed an additional issue report internally (SITSW-4302) to get this fixed in this more cohesive manner in our SDK documentation for AM335x/AM437x.

     Regards, Andreas