I'm running into build errors when I try to compile the kernel tools with a toolchain I created via Yocto for the i.MX 8M+ eval kit. I'm able to build the device tree, the kernel, and modules; it's just the tools that are failing. Specifically spidev_test. The toolchain was generated via `bitbake <image> -c populate_sdk` as per the i.MX Yocto docs, and has been working fine otherwise.
Here's what I'm seeing:
$ source /opt/fsl-imx-xwayland/6.6-scarthgap/environment-setup-armv8a-poky-linux
$ make tools/spi
DESCEND spi
CC /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test.o
In file included from spidev_test.c:11:
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
9 | # include_next <stdint.h>
| ^~~~~~~~~~
compilation terminated.
I can bypass this by adding `-I/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include` to CFLAGS, but then I run into this:
DESCEND spi
CC /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test.o
In file included from /opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/features.h:527,
from /opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/bits/libc-header-start.h:33,
from /opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/stdint.h:26,
from spidev_test.c:11:
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
7 | # include <gnu/stubs-32.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
I see that the toolchain is (incorrectly?) linking to stubs-32 and hack in a link to stubs-64 (arm64 target). When I try again, I get this:
$ make tools/spi
DESCEND spi
CC /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test.o
In file included from spidev_test.c:11:
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/stdint.h:98: warning: "__INT64_C" redefined
98 | # define __INT64_C(c) c ## LL
|
<built-in>: note: this is the location of the previous definition
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/include/stdint.h:99: warning: "__UINT64_C" redefined
99 | # define __UINT64_C(c) c ## ULL
|
<built-in>: note: this is the location of the previous definition
LD /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test-in.o
LINK /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find Scrt1.o: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find crti.o: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find crtbeginS.o: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find -lgcc: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find -lgcc_s: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find -lc: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find -lgcc: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find -lgcc_s: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find crtendS.o: No such file or directory
/opt/fsl-imx-xwayland/6.6-scarthgap/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:42: /home/ian/build/imx-yocto-bsp/linux-imx/tools/spi/spidev_test] Error 1
make[2]: *** [Makefile:73: spi] Error 2
make[1]: *** [/home/ian/build/imx-yocto-bsp/linux-imx/Makefile:1362: tools/spi] Error 2
make: *** [Makefile:234: __sub-make] Error 2
It looks like something isn't set up right within the toolchain. Or, am I missing something in my system environment? Any clues as to what's happening here?
解決済! 解決策の投稿を見る。
Hello,
It looks like you have to build the full-image to compile this since for some reason I received stubs-32-bit and for full-image stubs64.
Regards
Ah, that checks out! My custom image is a variant of `imx-image-multimedia`; I haven't built `full-image`. Thanks!
Hello,
It looks like you have to build the full-image to compile this since for some reason I received stubs-32-bit and for full-image stubs64.
Regards