This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Re: GLIBC: Problems compiling 2.1.2 on i386-linux and powerpc-linux



Hi,

On Mon, Jan 24, Brendan John Simon wrote:

> I've just recompiled glibc-2.1.1 and glibc-2.1.2 successfully using egcs-1.1.2.  Both glibc-2.1.1 and glibc-2.1.2 fail with the same error when I try to compile them with gcc-2.95.2.  The only thing I can think of is that gcc-2.95.2 optimizes out the __libc_global_ctors function when linking.  I can see that it is there in elf/soinit.os when I use nm and/or objdump.
> Maybe it is a bug in gcc-2.95.2 but I doubt it.  I'm pretty sure others have compiled (and cross-compiled) glibc-2.1.2 with gcc-2.95.2.

With PowerPC, there is one big problem: The PPC developer doesn't send back
their changes to the official maintainers very often :(
For PPC, you need special patches for gcc 2.95.2, before the new compiled
glibc is binary compatible with the old one. 

Could anybody of the PPC developer explain me, why this patches doesn't go
into the main gcc branch ? This patches where necessary vor egcs 1.1.2 and
for gcc 2.95.2. I think more as enough time to send the patches. It is
terrible for distributors to search for this patches. And I think this will
be one reason if in the future we have binary incompatible PPC distributions,
one compiled with the official versions, one compiled with the inofficial patches.

  Thorsten

> 
> Any help would be greatly appreciated.
> Brendan Simon.
> 
> 
> 
> Brendan John Simon wrote:
> 
> > I am trying to cross-compile glibc-2.1.2 for a powerpc-linux target.  I
> > was having lots of problems so I thought I would do a native compile of
> > a RedHat-5.2 system.  I can't believe it doesn't compile out of the
> > box.  It seems there are undefined references to __libc_global_ctors
> > when making db2.  I think that soinit.o has this function but don't know
> > why it is not being included.  Has anyone had similar problems and what
> > is the solution.
> >
> > Thanks,
> > Brendan Simon.
> >
> > -------- last portion of make output follows --------
> >
> > gcc   -shared -Wl,-O1 -o
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so
> > -Wl,-dynamic-linker=/usr//lib/ld-linux.so.2
> > -B/home/local/src/gnu-tools/build--glibc-2.1.2/csu/
> > -Wl,--version-script=/home/local/src/gnu-tools/build--glibc-2.1.2/libdb.map
> > -Wl,-soname=libdb.so.3   -L/home/local/src/gnu-tools/build--glibc-2.1.2
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/math
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/elf
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/nss
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/nis
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/db2
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/rt
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/resolv
> > -L/home/local/src/gnu-tools/build--glibc-2.1.2/linuxthreads
> > -Wl,-rpath-link=/home/local/src/gnu-tools/build--glibc-2.1.2:/home/local/src/gnu-tools/build--glibc-2.1.2/math:/home/local/src/gnu-tools/build--glibc-2.1.2/elf:/home/local/src/gnu-tools/build--glibc-2.1.2/nss:/home/local/src/gnu-tools/build--glibc-2.1.2/nis:/home/local/src/gnu-tools/build--glibc-2.1.2/db2:/home/local/src/gnu-tools/build--glibc-2.1.2/rt:/home/local/src/gnu-tools/build--glibc-2.1.2/resolv:/home/local/src/gnu-tools/build--glibc-2.1.2/linuxthreads
> > -Wl,--whole-archive
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb_pic.a
> > /home/local/src/gnu-tools/build--glibc-2.1.2/elf/interp.os
> > /home/local/src/gnu-tools/build--glibc-2.1.2/libc.so
> > -Wl,--no-whole-archive
> > rm -f /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3.new
> > /bin/sh ../scripts/rellns-sh
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3.new
> > /bin/sh ../scripts/rellns-sh
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3.new
> > mv -f /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3.new
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3
> > gcc -nostdlib -nostartfiles -o
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/makedb
> > -Wl,-dynamic-linker=/usr//lib/ld-linux.so.2
> > /home/local/src/gnu-tools/build--glibc-2.1.2/csu/crt1.o
> > /home/local/src/gnu-tools/build--glibc-2.1.2/csu/crti.o `gcc
> > --print-file-name=crtbegin.o`
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/makedb.o
> > /home/local/src/gnu-tools/build--glibc-2.1.2/db2/libdb.so.3
> > -Wl,-rpath-link=/home/local/src/gnu-tools/build--glibc-2.1.2:/home/local/src/gnu-tools/build--glibc-2.1.2/math:/home/local/src/gnu-tools/build--glibc-2.1.2/elf:/home/local/src/gnu-tools/build--glibc-2.1.2/nss:/home/local/src/gnu-tools/build--glibc-2.1.2/nis:/home/local/src/gnu-tools/build--glibc-2.1.2/db2:/home/local/src/gnu-tools/build--glibc-2.1.2/rt:/home/local/src/gnu-tools/build--glibc-2.1.2/resolv:/home/local/src/gnu-tools/build--glibc-2.1.2/linuxthreads
> > /home/local/src/gnu-tools/build--glibc-2.1.2/libc.so.6
> > /home/local/src/gnu-tools/build--glibc-2.1.2/libc_nonshared.a -lgcc `gcc
> > --print-file-name=crtend.o`
> > /home/local/src/gnu-tools/build--glibc-2.1.2/csu/crtn.o
> > /home/local/src/gnu-tools/build--glibc-2.1.2/elf/ld-linux.so.2:
> > undefined reference to `__libc_global_ctors'
> > collect2: ld returned 1 exit status
> > make[2]: *** [/home/local/src/gnu-tools/build--glibc-2.1.2/db2/makedb]
> > Error 1
> > make[2]: Leaving directory `/home/local/src/gnu-tools/glibc-2.1.2/db2'
> > make[1]: *** [db2/others] Error 2
> > make[1]: Leaving directory `/home/local/src/gnu-tools/glibc-2.1.2'
> > make: *** [all] Error 2
> 

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/       kukuk@suse.de
SuSE GmbH            Schanzaeckerstr. 10            90443 Nuernberg
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.

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