[rock-devel] glibc23 error in stage 1 with gcc34 patches
Stefan Fiedler
stefan.fiedler at students.jku.at
Sat Jul 3 10:28:20 CEST 2004
Am Donnerstag, 1. Juli 2004 17:44 schrieb Stefan Fiedler:
> Hi,
> trying to build a athlonxp-desktop target with the following patches:
>
> 2004052414214013961
> Rene Rebe:
> * primary implemented gcc3 profiled bootstrap possiblity
> * secondary added the default optimization settings to the spec
> file (and so user invocations use the same optimizations as used inside the
> ROCK build - and thus matching the PreCompiledHeaders) * remove GCC33
> config stuff since no longer present (when gcc-3.4 applied)
>
> 2004062516122007486 (resp. the original 2004050220420329825)
> Rene Rebe:
> updated gcc3 (3.4.0)
> removed gcc34 - we finally need to focus on the leading edge GCC
> series again (to get recent features and support from the gcc
> folks) fixed util-linux and net-tools for gcc-3.4.0
> disabled too broken configs in linux24 for gcc-3.4.0
> Andreas V. Meier:
> rediffed + cksum
>
> 2004062519360525927
> Stefan Fiedler:
> change build orders of gzip, linux24 and linux26
> so gzip is built before linux24 and linux26
>
> 1-glibc23 stops with the error:
>
> i686-unknown-linux-gnu-gcc-3 -nostdlib -nostartfiles -static
> -o
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/elf/sln
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/csu/crt1.o
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/csu/crti.o `i686-unknown-linux-gnu-gcc-3
> --print-file-name=crtbegin.o`
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/elf/sln.o
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/libc.a -lgcc -Wl,--as-needed -lgcc_s
> -Wl,--no-as-needed
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/libc.a `i686-unknown-linux-gnu-gcc-3
> --print-file-name=crtend.o`
> /root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/o
>bjdir/csu/crtn.o
> /root/rock/build/minidesk-2.1.0-DEV-x86-athlon-xp-32-desktop-expert/ROCK/to
>ols.cross/crosscc/../lib/gcc/i686-unknown-linux-gnu/3.4.0/../../../../i686-u
>nknown-linux-gnu/bin/ld: cannot find -lgcc_s
> collect2: ld returned 1 exit status
> make[2]: ***
> [/root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/
>objdir/elf/sln] Error 1
> make[2]: Leaving directory
> `/root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01/
>elf' make[1]: *** [elf/others] Error 2
> make[1]: Leaving directory
> `/root/rock/src.glibc23.1088639865.20607.3722660443/glibc-2.3.4-2004-05-01'
> make: *** [all] Error 2
> --- BUILD ERROR ---
>
> The error does not occur with svn revision 3449, and occurs whether gcc3 is
> built with profiled bootstrap or not.
> Strange thing is I've already successfully built a desktop target with
> gcc34 patches about 1 month ago. This desktop target is now the build
> system. The library libgcc_s that is missing is build in all other stages
> but not in 0-gcc3, neither in the current build nor in the 1 month-old.
> Ideas how to make gcc3 compile this library in stage 0 are very welcome.
>
Some more information on this error:
It is indirectly caused by updating binutils from 2.15.90.0.1.1 to
2.15.91.0.1. Its new ld linker version supports the '--as-needed' command line
option. Glibc checks for this option during ./configure and in the
'Makeconfig' file:
ifneq ($(have-as-needed),yes)
libgcc_eh := -lgcc_eh
else
libgcc_eh := -Wl,--as-needed -lgcc_s -Wl,--no-as-needed
endif
as you can see, uses libgcc_s if it finds such new ld linker. AFAIK
libgcc_s.so is the shared library companion to libgcc.a. Problem is we don't
have gcc shared libraries in stage 1 (from stage 0, for 1-glibc23).
Btw. the ./configure test for '--as-needed' only returns 'yes' when compiling
glibc with gcc 3.4, with gcc 3.2.3 it returns 'no' (for reasons I don't know)
and thus the error does not occur.
Ok, how can this be fixed? I tried several things:
1) compile 0-gcc3 with --enable-shared; did not work out of the box
2) compile 1-glibc23 with --disable-shared; did not work either
3) patch glibc23 in stage 1 so libgcc_s is not used; a patch will follow
Maybe the cleanest solution would be to check in Makeconfig if libgcc_s
exists.
Comments, ideas, suggestions are, as always, welcome.
Yours,
Stefan Fiedler
More information about the rock-devel
mailing list