TechNexion / edm-yocto-bsp

(Archived, please change to use tn-imx-yocto-manifest) Yocto Project manifests
17 stars 18 forks source link

Cross Compilation Issue #5

Closed zahabshams closed 6 years ago

zahabshams commented 6 years ago

Hi I am using your toolchain 4.1.15-1.2.0 for imx6. while compiling gpsd (gps daemon) using this toolchain i am getting error :

sysroots/pico-imx6/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory compilation terminated. scons: *** [ais_json.os] Error 1 scons: building terminated because of errors.

Below is complete log of it.

arm-poky-linux-gnueabi-gcc -o ais_json.os -c -O2 -pipe -g -feliminate-unused-debug-types --sysroot=/media/zahab/Linux_1/Navtool/OS/tn_imx_yocto-2.0-jethro_qt5_source_20161209/yocto_jethro_4.1.15-1.1.0_GA_20161209/build-x11-pico/tmp/sysroots/pico-imx6/ -pthread -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -O2 -fPIC ais_json.c In file included from /media/zahab/Linux_1/Navtool/OS/tn_imx_yocto-2.0-jethro_qt5_source_20161209/yocto_jethro_4.1.15-1.1.0_GA_20161209/build-x11-pico/tmp/sysroots/pico-imx6/usr/include/features.h:389:0, from /media/zahab/Linux_1/Navtool/OS/tn_imx_yocto-2.0-jethro_qt5_source_20161209/yocto_jethro_4.1.15-1.1.0_GA_20161209/build-x11-pico/tmp/sysroots/pico-imx6/usr/include/stdio.h:27, from ais_json.c:12: /media/zahab/Linux_1/Navtool/OS/tn_imx_yocto-2.0-jethro_qt5_source_20161209/yocto_jethro_4.1.15-1.1.0_GA_20161209/build-x11-pico/tmp/sysroots/pico-imx6/usr/include/gnu/stubs.h:7:29: fatal error: : No such file or directory compilation terminated. scons: *** [ais_json.os] Error 1 scons: building terminated because of errors.

richard-hu commented 6 years ago

Hello, zahabshams:

Thanks for your feedback. Could you try to replace the compiling instruction "arm-poky-linux-gnueabi-gcc" with "$CC"? Somebody had similar issue and solved it in this way: https://community.nxp.com/thread/350582#499896

Please follow the instructions in Section 6. "Create the toolchain for cross-compiling" in the following document: Yocto_2.0_BSP_Build_Guide.pdf

BR,

Richard

zahabshams commented 6 years ago

Hi Richard, Thanks for the response. Now I am landed in another issue with cross compilation. I am compiling gpsd for pico which uses scons build.

After compilation: My binary is pointing to - interpreter /lib/ld-linux.so.3 Whereas it should point to - interpreter /lib/ld-linux-armhf.so.3

Please find below flags: env.Append(LDFLAGS=['-mfloat-abi=hard'])

env.Append(CCFLAGS=['-march=armv7-a']) env.Append(CCFLAGS=['-mfloat-abi=hard']) env.Append(CCFLAGS=['-mfpu=neon']) env.Append(CCFLAGS=['-mtune=cortex-a9']) env.Append(CCFLAGS=['-D_XOPEN_SOURCE=700']) env.Append(CCFLAGS=['-mfloat-abi=hard'])

env.Append(CFLAGS=['-march=armv7-a']) env.Append(CFLAGS=['-mfloat-abi=hard']) env.Append(CFLAGS=['-mfpu=neon']) env.Append(CFLAGS=['-mtune=cortex-a9']) env.Append(CFLAGS=['-D_XOPEN_SOURCE=700']) env.Append(CFLAGS=['-mfloat-abi=hard'])

zahabshams commented 6 years ago

Hi Richard, Awaiting your response.

Regards Zahab

richard-hu commented 6 years ago

Hi, zahabshams:

I haven't run into this kind of problem. This might be a bug in Yocto.

Could you refer to the following link to create a symbolic link: https://lists.yoctoproject.org/pipermail/yocto/2017-April/035681.html

BTW, there is a recipe for gpsd in yocto. https://github.com/openembedded/meta-openembedded/tree/master/meta-oe/recipes-navigation/gpsd

It shouldn't need cross-compiling by yourself. And it should work by just enabling this package in local.conf in yocto.

BR,

Richard

zahabshams commented 6 years ago

working with provided solution