Run g++ linking to special libraries

萝らか妹 提交于 2019-12-24 07:05:27

问题


These ideas may seems strange...

I've made other environment on my Gnu/Linux system by creating directory and copy there necessary files to bin, lib, usr, etc and others. Then I do 'chroot' and then do some operations inside.

The problem is that all files in environment were taken from older OS (2.4 kernel version). But compiler must be taken modern (with support of modern language standarts).

When I'm trying to run compiler inside the environment it goes with errors:

g++: /lib/libc.so.6: version `GLIBC_2.11' not found (required by g++)
g++: /lib/libc.so.6: version `GLIBC_2.4' not found (required by g++)

Then I've copied actual libc.so.6 to /home/mylibs (inside environment). Export LD_LIBRARY_PATH:

bash-3.00# export LD_LIBRARY_PATH="/home/mylibs/"

But it seems nothing has changed. The same errors remained.

The next attempt was to build statically linked gcc compiler. Unfortunately some problems occurs (Statically linked gcc).

Maybe I'm radically wrong... But do I have any other way to build executables linked to old libraries, using modern complier?

P.S. My OS is ArchLinux. 'uname -r' shows '4.8.12-3-ARCH'. The oldest environment is made of MCBC 3.0 (Russian letters, don't know how to decrypt properly, maybe Armed forces' mobile system) with 2.4 kernel version.

来源:https://stackoverflow.com/questions/41101950/run-g-linking-to-special-libraries

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!