Run g++ linking to special libraries

2019-07-31 04:40发布

问题:

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.