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.

Linux/AM3359: Linaro toolchain compiler error

Part Number: AM3359

Tool/software: Linux

Hello Experts,

I am getting the below errors while using TI SDK inbuilt linaro toolchain for compiling a simple helloworld code. What could be the problem ?

And one more hint is that, we are using the "linux-devkit" folder from TI SDK and used in our build system to build the kernel, uboot and other module drivers. So kernel, uboot and module driver was successful.

But not sure why we are unable to build the C codes ?

titus@titus-laptop:~$  /home/titus/workdir/TI_SDK/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc hello.c
hello.c:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
titus@titus-laptop:~$


titus@titus-laptop:~/workdir/TI_SDK/linux-devkit$ source environment-setup [linux-devkit]:~/workdir/TI_SDK/linux-devkit> [linux-devkit]:~/workdir/TI_SDK/linux-devkit> [linux-devkit]:~/workdir/TI_SDK/linux-devkit> export ARCH=arm [linux-devkit]:~/workdir/TI_SDK/linux-devkit> arm-linux-gnueabihf-gcc hello.c /home/titus/workdir/TI_SDK/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory /home/titus/workdir/TI_SDK/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory collect2: error: ld returned 1 exit status [linux-devkit]:~/workdir/TI_SDK/linux-devkit> [linux-devkit]:~/workdir/TI_SDK/linux-devkit> [linux-devkit]:~/workdir/TI_SDK/linux-devkit>

So we need kind of this setup for our project, kindly solve the build error. I think, with TI SDK build may be successful, so what could be the solution for this issue ?
Hopefully we may need to export some more variables to findout the proper library and includes.
BTW, I have referred this post.
Can you please me out from this issue ?
Any help much appreciated. Thanks.
  • Thanks for the reply Pavel.

    BTW, I am using this linux-devkit from out of TI SDK folder. I believe that thats why it causes the issue, but how we can fix it out.

    titus@titus-laptop:~/workdir/TI_SD/$ export PATH=/home/titus/workdir/TI_SDK/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH
    titus@titus-laptop:~/workdir/TI_SDK$ arm-linux-gnueabihf-gcc ~/hello.c
    /home/titus/hello.c:1:19: fatal error: stdio.h: No such file or directory
    #include <stdio.h>
    ^
    compilation terminated.
    titus@titus-laptop:~/workdir/TI_SDK$ arm-linux-gnueabihf-gcc ~/hello.c -o hello
    /home/titus/hello.c:1:19: fatal error: stdio.h: No such file or directory
    #include <stdio.h>
    ^
    compilation terminated.
    titus@titus-laptop:~/workdir/TI_SDK/$

    titus@titus-laptop:~/workdir/TI_SDK/toolchain-lab$
    titus@titus-laptop:~/workdir/TI_SDK/toolchain-lab$ git checkout processor-linux-sdk-v1.0
    error: pathspec 'processor-linux-sdk-v1.0' did not match any file(s) known to git.

    titus@titus-laptop:~/workdir/TI_SDK/toolchain-lab$ git branch -a
    * master
    remotes/origin/HEAD -> origin/master
    remotes/origin/master
    titus@titus-laptop:~/workdir/TI_SDK/toolchain-lab$
    titus@titus-laptop:~/workdir/TI_SDK/toolchain-lab$
  • BTW, I am using the latest SDK which supports kernel 4.9

    Any help ??

    Sorry, unknowingly presses the resolve answer. Don't know how to revert.

  • Titus,

    I just check the toolchain that is coming with AM335x TI PSDK v4.03. This toolchain is working fine on my side:

    pbotev@lin-0306:~/workdir/helloworld$ export PATH="/home/users/pbotev/AM335x/ti-processor-sdk-linux-am335x-evm-04.03.00.05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH"
    pbotev@lin-0306:~/workdir/helloworld$ arm-linux-gnueabihf-gcc helloworld.c -o helloworld
    pbotev@lin-0306:~/workdir/helloworld$ file helloworld
    helloworld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=87872e2a19b2857c40fd84a0f6e4fcb31c94cbd1, not stripped


    The problem seems to be in the unknown undefined toolchain that you are using. I can suggest you to use the toolchain that is coming with PSDK v4.03 or to download this toolchain separately:

    releases.linaro.org/.../gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz

    Regards,
    Pavel