This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

Fw: problems building glibc







From: John Lumby <johnlumby@hotmail.com>
Sent: November 12, 2016 3:25 PM
To: Toby Douglass; libc-help@sourceware.org
Subject: Re: problems building glibc
  

Long ago I discovered that it is almost impossible to build glibc with --prefix set to anything other than its default
 --prefix=/usr

and I seem to remember then finding this documented in a few unofficial places.


Unless it has somehow relaxed this ,  then I'd suggest you try with that(**).

(I do not pretend to know or guess whether this explains your actual problem with the crtxxx.o)


Cheers,  John Lumby




(**)This requirement then in turn implies requiring trickery with the install_root=<temp_path> when running make install in your running system



 



From: libc-help-owner@sourceware.org <libc-help-owner@sourceware.org> on behalf of Toby Douglass <toby_public@winterflaw.net>
Sent: November 12, 2016 10:45 AM
To: libc-help@sourceware.org
Subject: problems building glibc
    
Hi all.

I would deeply appreciate any assistance which could be offered with
regard to resolving my current glibc build problem.

I have spent a long time working on this, and come quite a long way, but
now I'm stumped.

I wish (ho ho ho) to build every released version of GCC starting with
4.1.2, with the chronologically appropriate versions of its
dependencies, and use that to build the chronologically appropriate glibc.

I have composed a table showing the release dates of GCC and its
dependencies, and glibc and numactl (mainly from inspecting the release
archives, so the dates are pretty reliable).

http://liblfds.org/mediawiki/index.php?title=Building_GCC#Dependency_Versions

After four weeks (weekends really) I learned to build GCC.  I'm
currently working with;

GCC 4.9.2
binutils 2.24
glibc 2.21
libmpfr 3.1.2
libgmp 6.0.0a
libmpc 1.0.2

I build binutils separately, using the system compiler, as it seems to
me (after a painful couple of weeks of experimentation) the GCC docs are
incorrect to claim binutils can be built by GCC, in the way mpc et al
are.  The mpfr, mpc and gmp libraries are however build by GCC (they are
moved into the GCC source dir).

The binutils package is make installed and then by update-alternatives
made the current binutils.

This is my GCC configure;

../tmp/gcc-4.9.2/configure --disable-multilib --enable-threads=posix
--enable-languages=c --disable-werror --with-newlib --disable-libvtv
--disable-decimal-float --disable-libgomp --disable-libquadmath
--disable-multiarch --program-suffix=-4.9.2
--prefix=/usr/local/gcc/gcc-4.9.2
--with-local-prefix=/usr/local/gcc/gcc-4.9.2 --with-glibc-version=2.21

This is my glibc configure;

setenv CC gcc
setenv LIBRARY_PATH
/usr/local/gcc/gcc-4.9.2/lib/gcc/x86_64-unknown-gnu/4.9.2

../glibc-2.21/configure --prefix=/usr/local/glibc/glibc-2.21
--enable-kernel=4.7.0 --enable-lock-elision=yes

The failure when building glibc is this;

gcc -nostdlib -nostartfiles -o /tmp/buildglibc/sunrpc/rpcgen
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
/tmp/buildglibc/csu/crt1.o /tmp/buildglibc/csu/crti.o `gcc
--print-file-name=crtbegin.o` /tmp/buildglibc/sunrpc/rpcgen.o
/tmp/buildglibc/sunrpc/rpc_main.o /tmp/buildglibc/sunrpc/rpc_hout.o
/tmp/buildglibc/sunrpc/rpc_cout.o /tmp/buildglibc/sunrpc/rpc_parse.o
/tmp/buildglibc/sunrpc/rpc_scan.o /tmp/buildglibc/sunrpc/rpc_util.o
/tmp/buildglibc/sunrpc/rpc_svcout.o /tmp/buildglibc/sunrpc/rpc_clntout.o
/tmp/buildglibc/sunrpc/rpc_tblout.o /tmp/buildglibc/sunrpc/rpc_sample.o
-Wl,-dynamic-linker=/usr/local/glibc/glibc-2.21/lib/ld-linux-x86-64.so.2
-Wl,-rpath-link=/tmp/buildglibc:/tmp/buildglibc/math:/tmp/buildglibc/elf:/tmp/buildglibc/dlfcn:/tmp/buildglibc/nss:/tmp/buildglibc/nis:/tmp/buildglibc/rt:/tmp/buildglibc/resolv:/tmp/buildglibc/crypt:/tmp/buildglibc/nptl
/tmp/buildglibc/libc.so.6 /tmp/buildglibc/libc_nonshared.a
-Wl,--as-needed /tmp/buildglibc/elf/ld.so -Wl,--no-as-needed -lgcc  `gcc
 --print-file-name=crtend.o` /tmp/buildglibc/csu/crtn.o
gcc /tmp/buildglibc/sunrpc/cross-rpc_main.o
/tmp/buildglibc/sunrpc/cross-rpc_hout.o
/tmp/buildglibc/sunrpc/cross-rpc_cout.o
/tmp/buildglibc/sunrpc/cross-rpc_parse.o
/tmp/buildglibc/sunrpc/cross-rpc_scan.o
/tmp/buildglibc/sunrpc/cross-rpc_util.o
/tmp/buildglibc/sunrpc/cross-rpc_svcout.o
/tmp/buildglibc/sunrpc/cross-rpc_clntout.o
/tmp/buildglibc/sunrpc/cross-rpc_tblout.o
/tmp/buildglibc/sunrpc/cross-rpc_sample.o  -o
/tmp/buildglibc/sunrpc/cross-rpcgen
/usr/local/bin/ld: cannot find crt1.o: No such file or directory
/usr/local/bin/ld: cannot find crti.o: No such file or directory
/usr/local/bin/ld: cannot find -lc
/usr/local/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
Makefile:167: recipe for target '/tmp/buildglibc/sunrpc/cross-rpcgen' failed
make[2]: *** [/tmp/buildglibc/sunrpc/cross-rpcgen] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/tmp/glibc-2.21/sunrpc'
Makefile:213: recipe for target 'sunrpc/others' failed
make[1]: *** [sunrpc/others] Error 2
make[1]: Leaving directory '/tmp/glibc-2.21'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2

The problem obviously is that crt1.o cannot be found.

My expectation was that building glibc would produce crt1.o - because
obviously where I'm using a non-system compiler, I can't use the system
crt1.o.

In fact, if I search for it, I see the glibc build *has* produced a
crt1.o, here;

find . -name crt1.o
./csu/crt1.o

So I guess I'm surprised to find glibc trying to build an executable
(cross-rpcgen), because this seems to be problematic; glibc isn't using
its own crt1.o, but it can't use the system crt1.o.

I am of course simply confused about something fundamental, without
knowing it.

As an aside, prolly silly, but if I add /tmp/buildglibc/csu to
LIBRARY_PATH, and then also /tmp/buildglibc (as the build then fails on
-lc) I end up with;

gcc /tmp/buildglibc/sunrpc/cross-rpc_main.o
/tmp/buildglibc/sunrpc/cross-rpc_hout.o
/tmp/buildglibc/sunrpc/cross-rpc_cout.o
/tmp/buildglibc/sunrpc/cross-rpc_parse.o
/tmp/buildglibc/sunrpc/cross-rpc_scan.o
/tmp/buildglibc/sunrpc/cross-rpc_util.o
/tmp/buildglibc/sunrpc/cross-rpc_svcout.o
/tmp/buildglibc/sunrpc/cross-rpc_clntout.o
/tmp/buildglibc/sunrpc/cross-rpc_tblout.o
/tmp/buildglibc/sunrpc/cross-rpc_sample.o  -o
/tmp/buildglibc/sunrpc/cross-rpcgen
/tmp/buildglibc/csu/crt1.o: In function `_start':
/tmp/glibc-2.21/csu/../sysdeps/x86_64/start.S:111: undefined reference
to `__libc_csu_fini'
/tmp/glibc-2.21/csu/../sysdeps/x86_64/start.S:112: undefined reference
to `__libc_csu_init'
/tmp/buildglibc/sunrpc/cross-rpc_main.o: In function `find_cpp':
rpc_main.c:(.text+0x656): undefined reference to `stat64'
/tmp/buildglibc/sunrpc/cross-rpc_main.o: In function `checkfiles':
rpc_main.c:(.text+0x232d): undefined reference to `stat64'
rpc_main.c:(.text+0x2368): undefined reference to `stat64'
collect2: error: ld returned 1 exit status
Makefile:167: recipe for target '/tmp/buildglibc/sunrpc/cross-rpcgen' failed
make[2]: *** [/tmp/buildglibc/sunrpc/cross-rpcgen] Error 1
make[2]: Leaving directory '/tmp/glibc-2.21/sunrpc'
Makefile:213: recipe for target 'sunrpc/others' failed
make[1]: *** [sunrpc/others] Error 2
make[1]: Leaving directory '/tmp/glibc-2.21'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2

Which might illuminate my current confg a bit more.




      

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