0

I try to cross-compile my c++ program to an armv5. Just by cross-compiling for armv5, i run into the following error: GLIBC_2.17 not found (required by libstdc++, libdbus, libsystemd and liblzma) I found out, that the current version of libc at my target platform is 15.

1)Is there a safe way to update it? I have no Internet connection at the target and can only connect per Telnet. The problem is, if the update fails, I have no access to just flash a new OS at the device and it is broken for 99% i guess ^^.

2)If "no, not really" to (1), is it possible to compile against a libc15 having a newer one running or is there any way to downgrade to 15? (creating a VM for compiling so I do not care if anything fails) What do i have to specify to compile against another libc version?, didn't find the right flat/parameter there yet...

Thankful for any tips or ideas, having this problem for a while now and I am just too new to C++ cross-compiling to find any solution yet. Best regards,

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
MasterF
  • 33
  • 1
  • 5
  • Either downgrade your entire cross-compilation chain, or upload the new libc to the platform without installing it system-wide. Use rpath or LD_LIBRARY_PATH to link your executable at run time with the new version. – n. m. could be an AI Dec 06 '17 at 10:24
  • It can be helpful : https://stackoverflow.com/questions/2856438/how-can-i-link-to-a-specific-glibc-version?rq=1 – BartekPL Dec 06 '17 at 10:25
  • Please don't add solved to title instead accept your answer see [tour] to learn more. – Petter Friberg Dec 07 '17 at 19:38

1 Answers1

0

Ok, for everyone with the same error, here my solution: The LD_LIBRARY_PATH/rpath thing is working keeping in mind that the path from ld-linux.so is hard coded. So its either good to have all libs in the folder specified by LD_LIBRARY_PATH or other dependency errors might occur. The way with downgrading the cross-compiling toolchain is working as well and fixed the whole problem at the end (I ran into an "kernel too old error" with the LD_LIBRARY_PATH solution) but is a lot more tricky, especially for older kernels. Here the specified CXX for the solution:

CXX:= arm-linux-gnueabi-g++

CXXFLAGS:= -march=armv5 -msoft-float -mfloat-abi=soft -O3 \ -pipe \ -DPCAP_CREATE \ -std=c++1y -Wmissing-include-dirs \ -D_GLIBCXX_USE_NANOSLEEP \ -g \ -fno-deduce-init-list

So I could not make it to cross compile with C++11 or later and i doubt that works for an Armv5 with libc15

Best regards

MasterF
  • 33
  • 1
  • 5