Reputation: 11
First of all,I don`t have root permission, and I build the new version glibc and gcc to my home path ~/glibc-new and ~/gcc-new .
After that , I want to build the new nversion binutil to ~/new-world by using new glibc and gcc ,so I change my ~/.base_prefix to export PATH=~/gcc-new/bin:$PATH for using new gcc,it works.
Now how can I build the binutil or something else by new glibc?
To change the new gcc specs file to point to ~/glibc-new/ld-linux.so.2? It didn`t work,the newly binary is still using old version glibc
I tried to build my program before by using
-Wl,--rpath=<absolute path to glibc-new> \
-Wl,--dynamic-linker=<absolute path to glibc-new>/ld-linux.so.2
gcc tell me that /usr/bin/ld : } No such file....., but I have it
Upvotes: 1
Views: 1430
Reputation: 2178
Try giving the following options to gcc when compiling your program:
-Wl,--rpath=<absolute path to glibc-new> \
-Wl,--dynamic-linker=<absolute path to glibc-new>/ld-linux.so.2
In your case <absolute path to glibc-new>
should be something like /home/youruser/glibc-new
.
The --rpath
is saying the runtime library loader where to look for libraries (you could also have set LD_LIBRARY_PATH
).
The --dynamic-linker
specifies the path of the dynamic linker you want to use.
Upvotes: 0