I am cross compiling an application for an embedded device (Moxa UC-8100), and I am running into a version issue with GLIBC.
I installed Debian 9 (as instructed by the supplier of the embedded device) and using the arm-linux-gnueabihf toolchain. When running my build on the device, it says
moxa@Moxa:~$ ./fabs-uc8100 -h
./fabs-uc8100: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.17' not found (required by ./fabs-uc8100)
./fabs-uc8100: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.16' not found (required by ./fabs-uc8100)
When I run ldd --version
, on the device, I can see it has version 2.13:
moxa@Moxa:~$ ldd --version
ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
So, the issue is clear (my program was built with 2.16, but I have 2.13 available), but how do I fix this?
Update I installed the crosscompile toolchain using standard Debian packages, including some Moxa packages, on a Debian 9 64-bit VM:
Added deb http://debian.moxa.com/debian stretch main contrib non-free
to /etc/apt/sources.list.d/moxa.sources.list
, then:
user@Linux:~$ apt-get install moxa-archive-keyring
user@Linux:~$ dpkg --add-architecture armhf
user@Linux:~$ apt-get install crossbuild-essential-armhf
user@Linux:~$ apt-get install libssl-dev:armhf
2
Answers
You need to install EGLIBC-2.13 on the build host and configure your cross-compiler to use it (obviously it’s currently using GLIBC-2.17 or later).
Since you provided no details about the origin of your cross-compiler or the build setup, you can’t expect someone to be able to tell you exactly what’s wrong with your current setup.
According to this thread found on a Linaro mailing-list, you may have a chance with gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux.tar.bz2 available here:
If you are using a Linux x86_64 system, you may need to add the packages required for executing x86 binaries in the case they would not be already installed – I am using Ubuntu 20.04.3 LTS.