Reputation: 157
... 13. repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b fido
@debian:~$ /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc hello.c hello.c:1:19: fatal error: stdio.h: No such file or directory compilation terminated.
@debian:~$ arm-poky-linux-gnueabi-gcc hello.c hello.c:1:19: fatal error: stdio.h: No such file or directory compilation terminated.
@debian:~$ arm-poky-linux-gnueabi-gcc -I /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/ hello.c In file included from /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/features.h:389:0, from /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:27, from hello.c:1: /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory compilation terminated.
Cross compilation with -v option @debian:~$ arm-poky-linux-gnueabi-gcc -v hello.c Using built-in specs. COLLECT_GCC=arm-poky-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/lto-wrapper Target: arm-poky-linux-gnueabi Configured with: /arm/fsl-community-bsp-fido/build-sabre/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=arm-poky-linux-gnueabi --prefix=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi --sbindir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi --libexecdir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi --datadir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi --includedir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0 --with-build-time-tools=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/x86_64-linux/usr/arm-poky-linux-gnueabi/bin --with-sysroot=/not/exist --with-build-sysroot=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/imx6qsabresd --enable-poison-system-directories --with-mpfr=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-mpc=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --enable-nls --with-arch=armv7-a Thread model: posix gcc version 5.2.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-march=armv7-a' '-mtls-dialect=gnu' /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -march=armv7-a -mtls-dialect=gnu -auxbase hello -version -o /tmp/ccqXSLVK.s GNU C11 (GCC) version 5.2.0 (arm-poky-linux-gnueabi) compiled by GNU C version 5.2.0, 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 "/not/exist/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" ignoring nonexistent directory "/not/exist/usr/local/include" ignoring nonexistent directory "/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../../arm-poky-linux-gnueabi/include" ignoring nonexistent directory "/not/exist/usr/include"
/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/include /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed End of search list. GNU C11 (GCC) version 5.2.0 (arm-poky-linux-gnueabi) compiled by GNU C version 5.2.0, 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: 4d79907806e372d157adce3e5c786751 hello.c:1:19: fatal error: stdio.h: No such file or directory
I need some some help here to compile a simple hello world using tool-chain created here. Or am I missing something.
Even I am not sure why these flags sets like this:
--with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0
--with-sysroot=/not/exist
Upvotes: 1
Views: 3075
Reputation: 5511
After running the "env" script file generateed from SDK,by default exports the variable flags like CC, CXX, LDFLAGS etc.,
You need to use those variables in your make files or manually.
run sdk env
@debian:~$ . envoiment file
@debian:~$ echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/siva/imx7-images/sdk/meta-toolchain_sdk/sysroots/cortexa7hf-neon-poky-linux-gnueabi
@debian:~$ ${CC} hello.c -o hello
if you use c++ files you need to use CXX
@debian:~$ ${CXX} hello.cpp -o hello
it will run successfully. so for every thing you have to use macros only.
Upvotes: 0
Reputation: 157
After so many options tried finally through with compilation
@debian:~$ echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 -- sysroot=/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
@debian:~$ ${CC} hello.c -o out
@debian:~$ echo $? 0
Upvotes: 2