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.

Crosscompilation issue

HI All,

we are ti-processor-sdk-3.00.00.04 sdk .we are facing cross compilation issue.while compiling normal c file with sdk linux-devkit cross tool chain.we exported cross toolchain path.by using same compiler we compiled kernel and u-boot.But any body face this issue. we are facing stdio.h fatal error issue .any body solve this isse.

  • What processor is this? Please post the log file.
  • Hi
    am335x processor.But we tried to compile simple c program file also .Its giving stdio.h issue.
  • Hi Veera,

    it's not very clear from your post, but are you facing the issue when compiling the kernel?
    If so then the problem is that "stdio.h" should not be included by kernel source at all. It contains definitions of
    library functions used in userspace programs, for example "printf" (in the kernel "printk" is used instead).
    Please check here:

    stackoverflow.com/.../compiling-kernel-error-stdio-h-no-such-file-or-directory

    Regards,
    Yordan
  • Hi Yordan,

    I,m writing one normal.c program.
    vim normal.c
    #include<stdio.h>
    int main()
    {
    printf("hello\n");
    return 0;
    }

    application$ ar
    ar arm-linux-gnueabihf-ar arm-linux-gnueabihf-gcc-ar arm-linux-gnueabihf-ld.bfd arm-linux-gnueabihf-strings
    ar6x arm-linux-gnueabihf-as arm-linux-gnueabihf-gcc-nm arm-linux-gnueabihf-nm arm-linux-gnueabihf-strip
    arch arm-linux-gnueabihf-c++filt arm-linux-gnueabihf-gcc-ranlib arm-linux-gnueabihf-objcopy arp
    arecord arm-linux-gnueabihf-cpp arm-linux-gnueabihf-gcov arm-linux-gnueabihf-objdump arpd
    arecordmidi arm-linux-gnueabihf-g++ arm-linux-gnueabihf-gdb arm-linux-gnueabihf-ranlib arping
    arm2hpdl arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gprof arm-linux-gnueabihf-readelf
    arm-linux-gnueabihf-addr2line arm-linux-gnueabihf-gcc-5.3.1 arm-linux-gnueabihf-ld arm-linux-gnueabihf-size

    application$ vim normal.c

    application$ arm-linux-gnueabihf-gcc -o out normal.c
    normal.c:1:19: fatal error: stdio.h: No such file or directory
    compilation terminated.
  • Hi Veera,

    can you add "-v" option to the command (like this "arm-linux-gnueabihf-gcc -v -o out normal.c") and post the output here?

    Thanks,
    Yordan
  • Hello,

    Assuming you are using ubuntu, just do a 'sudo apt-get install build-essential'

    Cheers,
    --Prabhakar Lad
  • HI Yordan,
    please find below logs
    we installed build essential also.

    #application$ arm-linux-gnueabihf-gcc -v -o out normal.c
    Using built-in specs.
    COLLECT_GCC=arm-linux-gnueabihf-gcc
    COLLECT_LTO_WRAPPER=/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/lto-wrapper
    Target: arm-linux-gnueabihf
    Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/gcc-linaro-5.3-2016.02/configure SHELL=/bin/bash --with-bugurl=https://bugs.linaro.org --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-multilib --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --with-bugurl=https://bugs.linaro.org --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
    Thread model: posix
    gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)
    COLLECT_GCC_OPTIONS='-v' '-o' 'out' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
    /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/cc1 -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf -iprefix /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/ -isysroot /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc normal.c -quiet -dumpbase normal.c -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu -auxbase normal -version -o /tmp/ccvCVJPL.s
    GNU C11 (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
    compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include"
    ignoring duplicate directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include"
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/usr/local/include/arm-linux-gnueabihf"
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/usr/local/include"
    ignoring duplicate directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed"
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include"
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf"
    ignoring nonexistent directory "/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/usr/include"
    #include "..." search starts here:
    #include <...> search starts here:
    /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/include
    /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed
    End of search list.
    GNU C11 (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
    compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    Compiler executable checksum: eb391097afb08ac0c6be8ef054c07fdb
    normal.c:1:19: fatal error: stdio.h: No such file or directory
    compilation terminated.


    Thanks
    veera
  • HI prabhakar Lad,
    Ya we are using u-buntu 64bit os-14.04 version.
  • Veera,

    I test this on my side, and it works fine. My host is Ubuntu 12.04 64-bit.

    Below are my steps:

    pbotev@mms-0306:~/workdir/veera$ export PATH=/home/users/pbotev/AM335x/ti-processor-sdk-linux-am335x-evm-03.00.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH

    pbotev@mms-0306:~/workdir/veera$ cat normal.c

    #include<stdio.h>

    int main()

    {

    printf("hello\n");

    return 0;

    }

    pbotev@mms-0306:~/workdir/veera$ arm-linux-gnueabihf-gcc normal.c -o out

    pbotev@mms-0306:~/workdir/veera$ file out

    out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x39b779729a78b6f213714bd9699c376dbc3d2690, not stripped

     

    Can you try these steps at your side?

    Regards,
    Pavel

  • veera anjaneyulu said:
    #application$ arm-linux-gnueabihf-gcc -v -o out normal.c
    Using built-in specs.
    COLLECT_GCC=arm-linux-gnueabihf-gcc
    COLLECT_LTO_WRAPPER=/home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/lto-wrapper
    Target: arm-linux-gnueabihf

    veera anjaneyulu said:
    gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)
    COLLECT_GCC_OPTIONS='-v' '-o' 'out' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'

    Running also with -v option:

    pbotev@mms-0306:~/workdir/veera$ arm-linux-gnueabihf-gcc normal.c -v -o out

    Using built-in specs.

    COLLECT_GCC=arm-linux-gnueabihf-gcc

    COLLECT_LTO_WRAPPER=/home/users/pbotev/AM335x/ti-processor-sdk-linux-am335x-evm-03.00.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/lto-wrapper

    Target: arm-linux-gnueabihf

    ............

    gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)

    COLLECT_GCC_OPTIONS='-v' '-o' 'out' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'

    ..........


    The issue might be in the strange path to the cross compile tool chain:

    /home/santosh/Release_dec8/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/


    Have you download and install the cross compiler toolchain separately from the PSDK? If yes, why?

    Regards,
    Pavel

  • Hi povel,

    You can copy the same sdk image to some other pc then you can try and tell me.Here what ever i installed right that pc only working other pc is not working?May be its created standard symbolic links while installing sdk.

    Thanks 

    veera

  • Veera,

    I do not think you can copy the installation folder (ti-processor-sdk-linux-am335x-evm-03.00.00.04) from one PC to another PC. The right approach is to copy the bin file (ti-processor-sdk-linux-am335x-evm-03.00.00.04-Linux-x86-Install.bin) and install that bin file on another PC.

    Regards,
    Pavel
  • Hi povel,
    Thanks for your reply.That one ok.But we copied linux-devkit one system to another what we can do.If we used linaro cross tool chain inplace of sdk bin file tool-chain.ie working fine .we compiled my kernel ,u-boot,applications also.

    Thanks
    veera
  • Veera,

    No, you can not copy linux-devkit from one PC to another. linux-devkit contains toolchain, libraries and headers. You can copy from one PC to another PC ti-processor-sdk-linux-am335x-evm-03.00.00.04-Linux-x86-Install.bin and gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz (Standalone Linaro Toolchain).

    In some older version of the SDK you can regenerate devkit and move the devkit. But you can move the devkit from one place of the PC to another place of the same PC. See the below wiki page for more info:

    processors.wiki.ti.com/.../DM814x_EZ_5.04.00_Software_Developers_Guide

    See also the below pointers regarding linux-devkit and cross compilation:

    processors.wiki.ti.com/.../Processor_Linux_SDK_GCC_Toolchain
    processors.wiki.ti.com/.../Linux_Training:Introduction_to_Cross_Compiling
    processors.wiki.ti.com/.../Processor_SDK_Linux_Training:_Hands_on_with_the_Linux_SDK
    arago-project.org/.../Crosscompiling_Outside_of_Arago

    Regards,
    Pavel