Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
646 views
in Technique[技术] by (71.8m points)

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

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?

question from:https://stackoverflow.com/questions/65830355/targetting-an-older-version-of-libstdc-with-recent-gcc-when-cross-copiling-to

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...