Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 62923

Summary: gcc-3.4.1-r1 +hardened+fstack-protecor+pie fails compiling
Product: Gentoo Linux Reporter: klavs klavsen <kl>
Component: [OLD] Core systemAssignee: The Gentoo Linux Hardened Team <hardened>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description klavs klavsen 2004-09-05 07:09:34 UTC
Hi guys,

I'm trying to upgrade my older Gentoo server - and I wanted to harden it this time :)

I've enabled USE="hardened pie" and added -fstack-protector to my CFLAGS.

When compiling gcc-3.4.1-r1 (didn't want 3.3.4 when I know many are happily using 3.4 - and I don't want to recompile the entire shabing too often, when reverse-deps hasn't been implemented properly so I can't be sure my services will keep working if they are restarted in the middle of this compile-frenzy - which they often are, due to logrotations etc. :( )

I get this:
..
stage1/xgcc -Bstage1/ -B/usr/i586-pc-linux-gnu/bin/ -c -DEFAULT_PIE_SSP   -march=i586 -pipe -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long   -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I. -I/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/gcc -I/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/gcc/. -I/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/gcc/config -I/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/gcc/../include \
  /var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/gcc/gengtype.c -o gengtype.o
stage1/xgcc -Bstage1/ -B/usr/i586-pc-linux-gnu/bin/ -DEFAULT_PIE_SSP   -march=i586 -pipe -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long   -DHAVE_CONFIG_H -DGENERATOR_FILE  -o genpreds \
 genpreds.o ../libiberty/libiberty.a
/usr/i586-pc-linux-gnu/bin/ld: Scrt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [genpreds] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/gcc-3.3.4-r1/work/build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-3.3.4-r1/work/build/gcc'
make: *** [bootstrap-lean] Error 2

!!! ERROR: sys-devel/gcc-3.3.4-r1 failed.
!!! Function src_compile, Line 551, Exitcode 2
!!! (no error message)
- when performing this:
# expmerge /usr/portage/sys-devel/gcc/gcc-3.4.1-r2.ebuild -av

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     U ] sys-devel/gcc-3.3.4-r1 [3.2.2-r2] -X -bootstrap -build -debug -debug -f77 -gcj +hardened-multilib +nls -objc +pic -static -(uclibc)  0 kB
[ebuild     U ] sys-libs/glibc-2.3.4.20040808 [2.3.1-r2] -build -debug -debug -erandom +hardened -makecheck -multilib +nls +nptl +pic  9 kB
[ebuild  N    ] sys-devel/gcc-3.4.1-r2  -bootstrap -build -debug -f77 -gcj +gtk +hardened -multilib -n32-n64 +nls -objc -static -(uclibc)  27,439 kB
[ebuild  N    ] sys-libs/libstdc++-v3-3.3.4  -debug +nls  0 kB

(nb. expmerge is my alias for emerge with nice and ACCEPT_KEYWORDS="~x86" set :)

I tried with binutils from ~x86 and the stable binutils - same error :(

Reproducible: Always
Steps to Reproduce:
1.add USE="hardened pic" and CFLAGS="$CFLAGS -fstack-protector"
2. ACCEPT_KEYWORDS="~x86" emerge /usr/portage/sys-devel/gcc/gcc-3.4.1-r2.ebuild
3.watch it fail :(

Actual Results:  
see Details.

Expected Results:  
It should compile cleanly :)
Comment 1 solar (RETIRED) gentoo-dev 2004-09-06 07:25:49 UTC
Your glibc revision is to old to make use of the Scrt1.o file. 
Please update glibc first then gcc.