Using non-system glibc

Florian Weimer fweimer@redhat.com
Thu May 28 11:53:35 GMT 2020


* Mahmood Naderan:

> On the way to use a custom glibc build, I tried to modify the Makefile of the program (nginx)
> with 
>
> -Wl,--rpath=/opt/glibc-2.23-install -Wl,--dynamic-linker=/opt/glibc-2.23-install/lib/ld-2.23.so
>
> After build and install, I see the following ldd output
>
> $ ldd install/sbin/nginx
>         linux-vdso.so.1 =>  (0x00007ffd6c335000)
>         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fad02350000)
>         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fad02133000)
>         libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fad01efb000)
>         libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fad01c8b000)
>         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fad01a71000)
>         libc.so.6 => /opt/glibc-2.23-install/libc.so.6 (0x00007fad016d0000)
>         /opt/glibc-2.23-install/lib/ld-2.23.so => /lib64/ld-linux-x86-64.so.2
> (0x00007fad02554000)
>
> The last line shows that my own glibc build is using system libc. But the lic.so.6 file my
> program is using, comes from my own glibc build.
>
> So, is that all? Or something is missing? Any advice?

I would try to reference the dynamic linker under its soname, like this:

  -Wl,--dynamic-linker=/opt/glibc-2.23-install/ld-linux-x86-64.so.2

Not sure if it makes a difference.

It's also concerning that libdl.so.2 and libcrypt.so.1 are loaded from
system paths.  libcrypt.so.1 could be fine, depending on whether it uses
internal glibc symbols or not.

Thanks,
Florian



More information about the Libc-help mailing list