Targetting an older version of libstdc++ with recent GCC when cross-copiling to an embedded-linux ARM device

417 views Asked by At

We need to find a cross-compilation toolchain for an ARM embedded linux target that satisfies the following criteria:

  • Kernel 3.17
  • GLIBC 2.18
  • Recent version of GCC is required to compile some third-party code

Those requirements brought me to generate a custom cross-compilation toolchain using crosstool-ng. I selected the min kernel version, min glibc version and it seemed to work well until I tried to compile code containing C++.

Because the new GCC is using a more recent libstdc++ than what is available on the target, the executable won't run and we get an error like this:

/usr/lib/libstdc++.so.6: version `CXXABI_1.3.9' not found

The code compiled fine with an older version of GCC.

Looking at the configuration options for crosstool-ng I didn't find anything that would let me change the min libstdc++ version, like for glibc.

Is there a way to target an older libstdc++ version without downgrading GCC? Can I use the headers and libstdc++.so files from the target to replace the ones GCC is using when cross-compiling?

0

There are 0 answers