1

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

HeroWong
  • 11
  • 3
  • possible duplicate of [How can I link to a specific glibc version?](http://stackoverflow.com/questions/2856438/how-can-i-link-to-a-specific-glibc-version) – ivan_pozdeev Jul 03 '15 at 08:41
  • possible duplicate of [Multiple glibc libraries on a single host](http://stackoverflow.com/questions/847179/multiple-glibc-libraries-on-a-single-host) – Employed Russian Jul 03 '15 at 13:36

1 Answers1

0

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.

mziccard
  • 2,158
  • 9
  • 17
  • I tried it before,but I can not build my program ,gcc tell me /usr/bin/ld : } No such file ..... I have this file – HeroWong Jul 04 '15 at 11:05