I’ve successfully build a custom Linux distro for the DE10 nano using Yocto. I am using among other things, meta-openembedded, meta-altera and poky. All of these are set to the dunfell branch.
I am now trying to cross compile software for this custom image using the SDK on Ubuntu 22.04 LTS. The same machine I used to build the distro and sdk.
$ bitbake custom-image-full -c populate_sdk
I’ve sourced the script
$ . /opt/custom/1.0/environment-setup-armv7at2hf-neon-custom-linux-gnueabi
$ cd /opt/custom/1.0/sysroots/armv7at2hf-neon-prose-linux-gnueabi/usr/src/kernel
$ make scripts
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
CC scripts/mod/empty.o
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
arm-custom-linux-gnueabi-gcc: /opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
make[2]: *** [scripts/Makefile.build:315: scripts/mod/empty.o] Error 1
make[1]: *** [scripts/Makefile.build:573: scripts/mod] Error 2
make: *** [Makefile:562: scripts] Error 2
If I check the glibc version of my Ubuntu 22.04 LTS machine.
$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
This is higher than that required by the library inside the sdk.
As far as I understand, it isn’t possible or wise to try downgrade my GLIBC version, as its integral to the kernel version. I could perhaps upgrade my recipes to use a newer version than dunfell, perhaps kirkstone, but this is a huge amount of work.
I don’t have the option of rolling back my machine to an earlier version of Ubuntu either.
3
Answers
Thanks for the suggestions @Employed Russian and @Yoda. Both your comments lead me toward a solution that worked.
The issue was that my shell environment was polluted. Running
unset LD_LIBRARY_PATH
didn't work for me, hwoever it made me realize that something in my environment might be causing the wrong library linkage to occur.To test this idea, I cleared the shell environment:
Ran the sdk environment script
Built scripts
It builds correctly now.
The version of the system GLIBC on your machine is irrelevant — the error message is not about it — it’s about
/opt/custom/1.0/sysroots/x86_64-customsdk-linux/lib/libc.so.6
.You didn’t tell which version of GLIBC you built as part of the SDK, but we can assume that it’s older than 2.32.
The root cause is that your build is mixing the SDK GLIBC with system
libstdc++.so.6
. You really ought not to be using any system libraries.So you need to find out
libstdc++.so.6
as parts of the SDK andYou must unset LD_LIBRARY_PATH before sourcing your environment setup for the cross compile SDK. If LD_LIBRARY_PATH is set then your host libraries get mixed.