i.MX 8M+: error building kernel tools with yocto-generated toolchain

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX 8M+: error building kernel tools with yocto-generated toolchain

Jump to solution
1,198 Views
ianb
Contributor I

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?

0 Kudos
Reply
1 Solution
1,175 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
Reply
2 Replies
1,152 Views
ianb
Contributor I

Ah, that checks out! My custom image is a variant of `imx-image-multimedia`; I haven't built `full-image`. Thanks!

0 Kudos
Reply
1,176 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2035800%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX%208M%2B%3A%20error%20building%20kernel%20tools%20with%20yocto-generated%20toolchain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2035800%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20running%20into%20build%20errors%20when%20I%20try%20to%20compile%20the%20kernel%20tools%20with%20a%20toolchain%20I%20created%20via%20Yocto%20for%20the%20i.MX%208M%2B%20eval%20kit.%20I'm%20able%20to%20build%20the%20device%20tree%2C%20the%20kernel%2C%20and%20modules%3B%20it's%20just%20the%20tools%20that%20are%20failing.%20Specifically%20spidev_test.%26nbsp%3BThe%20toolchain%20was%20generated%20via%20%60bitbake%20%3CIMAGE%3E%20-c%20populate_sdk%60%20as%20per%20the%20i.MX%20Yocto%20docs%2C%20and%20has%20been%20working%20fine%20otherwise.%3C%2FIMAGE%3E%3C%2FP%3E%3CP%3EHere's%20what%20I'm%20seeing%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20source%20%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fenvironment-setup-armv8a-poky-linux%0A%24%20make%20tools%2Fspi%0A%20%20DESCEND%20spi%0A%20%20CC%20%20%20%20%20%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test.o%0AIn%20file%20included%20from%20spidev_test.c%3A11%3A%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flib%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Finclude%2Fstdint.h%3A9%3A16%3A%20fatal%20error%3A%20stdint.h%3A%20No%20such%20file%20or%20directory%0A%20%20%20%209%20%7C%20%23%20include_next%20%3CSTDINT.H%3E%0A%20%20%20%20%20%20%7C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5E~~~~~~~~~%0Acompilation%20terminated.%3C%2FSTDINT.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EI%20can%20bypass%20this%20by%20adding%20%60%3CSPAN%3E-I%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%60%20to%20CFLAGS%2C%20but%20then%20I%20run%20into%20this%3A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%20%20DESCEND%20spi%0A%20%20CC%20%20%20%20%20%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test.o%0AIn%20file%20included%20from%20%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Ffeatures.h%3A527%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20from%20%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Fbits%2Flibc-header-start.h%3A33%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20from%20%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Fstdint.h%3A26%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20from%20spidev_test.c%3A11%3A%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Fgnu%2Fstubs.h%3A7%3A11%3A%20fatal%20error%3A%20gnu%2Fstubs-32.h%3A%20No%20such%20file%20or%20directory%0A%20%20%20%207%20%7C%20%23%20include%20%3CGNU%3E%0A%20%20%20%20%20%20%7C%20%20%20%20%20%20%20%20%20%20%20%5E~~~~~~~~~~~~~~~%0Acompilation%20terminated.%3C%2FGNU%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EI%20see%20that%20the%20toolchain%20is%20(incorrectly%3F)%20linking%20to%20stubs-32%20and%20hack%20in%20a%20link%20to%20stubs-64%20(arm64%20target).%20When%20I%20try%20again%2C%20I%20get%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20make%20tools%2Fspi%0A%20%20DESCEND%20spi%0A%20%20CC%20%20%20%20%20%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test.o%0AIn%20file%20included%20from%20spidev_test.c%3A11%3A%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Fstdint.h%3A98%3A%20warning%3A%20%22__INT64_C%22%20redefined%0A%20%20%2098%20%7C%20%23%20%20define%20__INT64_C(c)%20%20c%20%23%23%20LL%0A%20%20%20%20%20%20%7C%20%0A%3CBUILT-IN%3E%3A%20note%3A%20this%20is%20the%20location%20of%20the%20previous%20definition%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Finclude%2Fstdint.h%3A99%3A%20warning%3A%20%22__UINT64_C%22%20redefined%0A%20%20%2099%20%7C%20%23%20%20define%20__UINT64_C(c)%20c%20%23%23%20ULL%0A%20%20%20%20%20%20%7C%20%0A%3CBUILT-IN%3E%3A%20note%3A%20this%20is%20the%20location%20of%20the%20previous%20definition%0A%20%20LD%20%20%20%20%20%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test-in.o%0A%20%20LINK%20%20%20%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20Scrt1.o%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20crti.o%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20crtbeginS.o%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20-lgcc%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20-lgcc_s%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20-lc%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20-lgcc%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20-lgcc_s%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20crtendS.o%3A%20No%20such%20file%20or%20directory%0A%2Fopt%2Ffsl-imx-xwayland%2F6.6-scarthgap%2Fsysroots%2Fx86_64-pokysdk-linux%2Fusr%2Flibexec%2Faarch64-poky-linux%2Fgcc%2Faarch64-poky-linux%2F13.3.0%2Fld%3A%20cannot%20find%20crtn.o%3A%20No%20such%20file%20or%20directory%0Acollect2%3A%20error%3A%20ld%20returned%201%20exit%20status%0Amake%5B3%5D%3A%20***%20%5BMakefile%3A42%3A%20%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2Ftools%2Fspi%2Fspidev_test%5D%20Error%201%0Amake%5B2%5D%3A%20***%20%5BMakefile%3A73%3A%20spi%5D%20Error%202%0Amake%5B1%5D%3A%20***%20%5B%2Fhome%2Fian%2Fbuild%2Fimx-yocto-bsp%2Flinux-imx%2FMakefile%3A1362%3A%20tools%2Fspi%5D%20Error%202%0Amake%3A%20***%20%5BMakefile%3A234%3A%20__sub-make%5D%20Error%202%3C%2FBUILT-IN%3E%3C%2FBUILT-IN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EIt%20looks%20like%20something%20isn't%20set%20up%20right%20within%20the%20toolchain.%20Or%2C%20am%20I%20missing%20something%20in%20my%20system%20environment%3F%20Any%20clues%20as%20to%20what's%20happening%20here%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2035800%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036653%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20i.MX%208M%2B%3A%20error%20building%20kernel%20tools%20with%20yocto-generated%20toolchain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036653%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAh%2C%20that%20checks%20out!%20My%20custom%20image%20is%20a%20variant%20of%20%60imx-image-multimedia%60%3B%20I%20haven't%20built%20%60full-image%60.%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036128%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20i.MX%208M%2B%3A%20error%20building%20kernel%20tools%20with%20yocto-generated%20toolchain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036128%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EIt%20looks%20like%20you%20have%20to%20build%20the%20full-image%20to%20compile%20this%20since%20for%20some%20reason%20I%20received%20stubs-32-bit%20and%20for%20full-image%20stubs64.%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E