This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: upgrade causing segmentation faults and version `GLIBC_PRIVATE' not found


"Jeremy C. Reed" <reed at reedmedia dot net> writes:

> I built glibc-2.3.2 with glibc-linuxthreads.

glibc is a separate project, not part of gcc. Unfortunately I can't
    seem to find the appropriate help forum for it - maybe
    libc-alpha at gnu dot org , or bug-glibc at gnu dot org .


> My prefix was /usr and "make install" broke because /lib/ld-linux.so.2 is
> removed and the next command "ln" didn't exist. I modified Makerules to
> not delete that file and just do "ln -fs" instead, but ln then has a
> segmentation fault.

It's been some years since I did this, but I when I did, I built
    staticly linked versions of all the tools used by make install. I
    don't know if that's the best way, and I don't have the complete
    list of tools - at the very least, gnu fileutils, gnu bash, and
    gnu make. (I recall bash and fileutils have configure options to
    build staticly, but I'm not sure about make.) I built all those
    tools with --prefix=/root/, and put /root/bin first in my path
    before running make install.

> So I installed with install_root defined.
> 
> Then I used pax to copy all those new files to /.
> 
> Then all was broken again.

You might find the FAQ helpful, particularly
    http://sources.redhat.com/glibc/glibc-faq.html#s-2.3

> 
> I added backed up my /lib to /libold, so I could do:
> 
>   LD_LIBRARY_PATH=/libold /libold/ld-linux.so.2 /bin/ls
> 
> An example, of using my /bin/ls with the new libs:
> 
> $  LD_LIBRARY_PATH=/usr/pkgsrc/devel/glibc/work.tahoma/glibc-installed/lib
> /usr/pkgsrc/devel/glibc/work.tahoma/glibc-installed/lib/ld-linux.so.2
> /bin/ls
> Segmentation fault
> 
> Another example:
> 
> $ LD_LIBRARY_PATH=/usr/pkgsrc/devel/glibc/work.tahoma/glibc-installed/lib
> LD_PRELOAD=/usr/pkgsrc/devel/glibc/work.tahoma/glibc-installed/lib/ld-linux.so.2
> /usr/bin/ls
> /usr/bin/ls: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found
> (required by
> /usr/pkgsrc/devel/glibc/work.tahoma/glibc-installed/lib/libc.so.6)
> 
> My original system:
> 
> glibc-2.1.2-15 (rpm version?)

2.1.2 is the glibc version. 15 is the rpm version - tweaks needed to
    get packaging just right.

> glibc-devel-2.1.2-15 (rpm version?)
> glibc-profile-2.1.2-15 (rpm version?)
> (but most of that is overwritten)
> 
> /lib/libc-2.0.7.so
> /lib/libc-2.1.2.so
> /lib/libc.so.5 -> libc.so.5.4.38
> /lib/libc.so.5.4.38
> /lib/libc.so.6 -> /lib/libc-2.1.2.so
> 
> Linux 2.2.14-3 kernel.
> 
> It was Turbo Linux 6.0 English Server (Coyote). But many utilities have
> changed. I have been replacing all software from building recent from
> source.
> 
> It had binutils-2.9.1.0.25-7 installed. But I overwrote it with
> binutils-2.13.2.1 (which I built from source).
> 
> It has gcc 2.95.2. "rpm -q -a" shows:
> gcc-2.95.2-2
> gcc-compat-2.7.2.3-2
> gcc-g++-2.95.2-2
> gcc-objc-2.95.2-2
> 
> I built gcc 3.2.1 from source and installed to /usr/gcc-3.2.1/. I used it
> to build glibc.
> 
> My gmake is 3.80 (also built from source).
> 
> I looked through INSTALL and FAQ, and out-dated glibc2 howto, and the old
> Installing glibc-2 on Linux howto,
> 
> To fix my problem, I simply fix the links back to:
>  ld-linux.so.2 -> ld-2.1.2.so
>  libc.so.6 -> libc-2.1.2.so
> 
> Many of the rest of the libs point to the 2.3.2 versions, like:
> libdl.so.2 -> libdl-2.3.2.so
> 
> I would guess that ld-2.3.2.so and libc-2.3.2.so would be compatible, but
> they don't seem to be.
> 
> Some more examples:
> 
> $ /usr/bin/ldd /usr/bin/ldd
> lddlibc4: /lib/libc.so.6: version `GCC_3.0' not found (required by
> lddlibc4)
> 
> $ /usr/bin/ldd /bin/ls
>         libc.so.6 => /lib/libc.so.6 (0x2aac6000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaab000)
> 
> $ /usr/bin/ldd /sbin/init
>         libc.so.6 => /lib/libc.so.6 (0x2aac6000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaab000)
> 
> $ /usr/bin/ldd --version | head -1
> ldd (GNU libc) 2.3.2
> 
> $ /sbin/ldconfig -V | head -1
> ldconfig (GNU libc) 2.3.2
> 
> Everything is fine now, but ...
> 
> # /sbin/ldconfig
> 
> $ ls
> Segmentation fault
> 
> $ LD_LIBRARY_PATH=/libold /libold/ld-linux.so.2 /bin/ls -l
> /lib/ld-linux.so.2 /lib/libc.so.6
> lrwxrwxrwx    1 root     root           11 Mar 21 17:41 /lib/ld-linux.so.2
> -> ld-2.3.2.so
> lrwxrwxrwx    1 root     root           13 Mar 21 17:41 /lib/libc.so.6 ->
> libc-2.3.2.so
> 
> # LD_LIBRARY_PATH=/libold /libold/ld-linux.so.2 /bin/ln -sf /lib/libc
> libc-2.0.7.so      libc.so.5          libcom_err.so.2    libcrypt-2.1.2.so
> libc-2.1.2.so      libc.so.5.4.38     libcom_err.so.2.0  libcrypt-2.3.2.so
> libc-2.3.2.so      libc.so.6          libcrypt-2.0.7.so  libcrypt.so.1
> 
> # LD_LIBRARY_PATH=/libold /libold/ld-linux.so.2 /bin/ln -sf /lib/libc-2.1.2.so /lib/libc.so.6
> 
> $ /bin/ls -l /lib/ld-linux.so.2 /lib/libc.so.6
> lrwxrwxrwx    1 root     root           16 Mar 21 17:43 /lib/ld-linux.so.2
> -> /lib/ld-2.1.2.so
> lrwxrwxrwx    1 root     root           18 Mar 21 17:44 /lib/libc.so.6 ->
> /lib/libc-2.1.2.so
> 
> (The example above showed that ldconfig making new links made my system
> basically unusable until I repaired only the two links.)
> 
> Any suggestions?
> 
>    Jeremy C. Reed
>    http://bsd.reedmedia.net/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]