Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 125273 - [3.x/hardened] sys-devel/gcc-3.3.6: cannot compile using hardened gcc-3.4.5
Summary: [3.x/hardened] sys-devel/gcc-3.3.6: cannot compile using hardened gcc-3.4.5
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-06 11:03 UTC by Martin Mokrejš
Modified: 2007-11-29 06:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gcc-v-strace.log (gcc-v-strace.log,4.69 KB, text/plain)
2006-03-07 05:10 UTC, Martin Mokrejš
Details
gcc-dumpspecs-strace.log (gcc-dumpspecs-strace.log,7.17 KB, text/plain)
2006-03-07 05:11 UTC, Martin Mokrejš
Details
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs (specs,4.62 KB, text/plain)
2006-03-07 05:16 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2006-03-06 11:03:00 UTC
mkinstalldirs='/bin/sh /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/mkinstalldirs' \
  /bin/sh mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk
TM_DEFINES="" \
HEADERS="ansidecl.h  i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h defaults.h" XM_DEFINES="POSIX" \
TARGET_CPU_DEFAULT="" \
/bin/sh /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/mkconfig.sh tconfig.h
./xgcc -B./ -B/usr/i686-pc-linux-gnu/bin/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -fno-stack-protector -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/config -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-omit-frame-pointer \
   -c /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
xgcc: spec failure: unrecognized spec option '<'
cc1: error: output filename specified twice
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gcc-3.3.6/work/build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-3.3.6/work/build/gcc'
make: *** [bootstrap-lean] Error 2

!!! ERROR: sys-devel/gcc-3.3.6 failed.
Call stack:
  ebuild.sh, line 1933:   Called dyn_compile
  ebuild.sh, line 971:   Called src_compile
  ebuild.sh, line 1648:   Called toolchain_src_compile
  toolchain.eclass, line 24:   Called gcc_src_compile
  toolchain.eclass, line 1471:   Called gcc_do_make

!!! emake failed with bootstrap-lean
!!! If you need support, post the topmost build error, and the call stack if relevant.



Portage 2.1_pre5-r4 (default-linux/x86/2005.0, gcc-3.4.5-hardened, glibc-2.3.6-r3, 2.6.16-rc3-git5 i686)
=================================================================
System uname: 2.6.16-rc3-git5 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
Gentoo Base System version 1.12.0_pre16
ccache version 2.4 [disabled]
dev-lang/python:     2.3.4-r1, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/spool/PBS /var/bind /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 FFmpeg X Xaw3d aac aalib acpi alsa apache2 apm arts ati avi berkdb bitmap-fonts bonobo caca cdparanoia cdr cpudetection crypt cscope ctype cups curl dba dga directfb divx divx5 divx5linux doc dv dvb dvd dvdr dvdread eds emacs emacs-w3 emboss encode esd ethereal evo f77 faad faad2 fam fame fbcon ffmpeg flash foomaticdb fortran fvwm fvwm2 gb gd gdbm ggi gif gphoto2 gpm gstreamer gtk gtk2 gtkhtml i8x0 icc iconv ifc imagemagick imlib imlib2 inifile innodb ipv6 ithreads java jpeg lcms leim libcaca libg++ libwww live lzo mad matroska mcal mesa mhash mikmod ming mmx mmx2 mmxext motif mozilla mp3 mpeg mule mysql ncurses network nls nptl ogg oggvorbis opengl oss pam pcre pda pdflib perl plotutils plugin png ppds pthread pthreads python qt qtx quicktime readline rtc samba scanner sdl session slp spell sse sse2 ssl stroke tcltk tcpd tetex theora thread threads tiff truetype truetype-fonts type1-fonts unicode usb v4l v4l2 vorbis win32 win32codecs winvidix wmf xanim xml xml2 xmms xosd xv xvid xvmc zeo zlib elibc_glibc kernel_linux userland_GNU video_cards_radeon"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS


 gcc-config -l
 [1] i686-pc-linux-gnu-3.4.5
 [2] i686-pc-linux-gnu-3.4.5-hardened *
 [3] i686-pc-linux-gnu-3.4.5-hardenednopie
 [4] i686-pc-linux-gnu-3.4.5-hardenednopiessp
 [5] i686-pc-linux-gnu-3.4.5-hardenednossp
#

The above problem does not appear with "686-pc-linux-gnu-3.4.5" used to compile gcc-3.3.6. Whether this is a real bug or not is at your decision.
Comment 1 SpanKY gentoo-dev 2006-03-06 14:59:56 UTC
this has been posted in bugzilla a few times, but i'll leave it to hardened to determine what to do with this
Comment 2 Kevin F. Quinn (RETIRED) gentoo-dev 2006-03-06 16:03:36 UTC
Martin, if you still have the half-built working directory at the point it failed, could you try:

strace -o/tmp/gcc-v-strace.log /var/tmp/portage/gcc-3.3.6/work/build/gcc/xgcc -v

(emerge strace if you don't already have it) and attach the output file /tmp/gcc-v-strace.log?


Similarly, attach the output of:

/var/tmp/portage/gcc-3.3.6/work/build/gcc/xgcc -dumpspecs
/var/tmp/portage/gcc-3.3.6/work/build/gcc/xgcc -v

and also any files listed by 'gcc -v' mentioned by 'Reading specs from <file>'?


Hopefully that may give us a hint as to what's going on.
Comment 3 Martin Mokrejš 2006-03-07 05:10:07 UTC
Created attachment 81592 [details]
gcc-v-strace.log

# strace -o/tmp/gcc-v-strace.log /var/tmp/portage/gcc-3.3.6/work/build/gcc/xgcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs
Configured with: /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.6 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
#

The strace output is attached.
Comment 4 Martin Mokrejš 2006-03-07 05:11:34 UTC
Created attachment 81593 [details]
gcc-dumpspecs-strace.log
Comment 5 Martin Mokrejš 2006-03-07 05:16:54 UTC
Created attachment 81595 [details]
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs

This file is referenced from ./xgcc but beware the file is actually from the already installed gcc-3.6.6 (compiled yesterday using gcc without the hardened option).

# ./xgcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs
Configured with: /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.6 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
# pwd
/var/tmp/portage/gcc-3.3.6/work/build/gcc
# gcc-config -l
 [1] i686-pc-linux-gnu-3.3.6
 [2] i686-pc-linux-gnu-3.3.6-hardened
 [3] i686-pc-linux-gnu-3.3.6-hardenednopie
 [4] i686-pc-linux-gnu-3.3.6-hardenednopiessp
 [5] i686-pc-linux-gnu-3.3.6-hardenednossp
 [6] i686-pc-linux-gnu-3.4.5
 [7] i686-pc-linux-gnu-3.4.5-hardened *
 [8] i686-pc-linux-gnu-3.4.5-hardenednopie
 [9] i686-pc-linux-gnu-3.4.5-hardenednopiessp
 [10] i686-pc-linux-gnu-3.4.5-hardenednossp
#
Comment 6 Martin Mokrejš 2006-03-07 05:32:28 UTC
Could it be the problem is with the bash shell? I think I have seen some ebuilds of I don't know what packages which break with bash-3.1 ...

vrapenec gcc # ./xgcc -B./ -B/usr/i686-pc-linux-gnu/bin/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -fno-stack-protector -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/config -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-omit-frame-pointer \
>    -c /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c -DCRT_BEGIN \
>   -o crtbegin.o
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:122: error: syntax error before "TARGET_ATTRIBUTE_WEAK"
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:122: warning: type defaults to `int' in declaration of `TARGET_ATTRIBUTE_WEAK'
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:122: warning: data definition has no type or storage class
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:125: error: syntax error before "TARGET_ATTRIBUTE_WEAK"
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:125: warning: type defaults to `int' in declaration of `TARGET_ATTRIBUTE_WEAK'
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:125: warning: data definition has no type or storage class
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:127: error: syntax error before "TARGET_ATTRIBUTE_WEAK"
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:127: warning: type defaults to `int' in declaration of `TARGET_ATTRIBUTE_WEAK'
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:127: warning: data definition has no type or storage class
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:129: error: syntax error before "TARGET_ATTRIBUTE_WEAK"
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:129: warning: type defaults to `int' in declaration of `TARGET_ATTRIBUTE_WEAK'
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:129: warning: data definition has no type or storage class
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:132: error: syntax error before "TARGET_ATTRIBUTE_WEAK"
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:132: warning: type defaults to `int' in declaration of `TARGET_ATTRIBUTE_WEAK'
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:132: warning: data definition has no type or storage class
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:418:2: #error "What are you doing with crtstuff.c, then?"
vrapenec gcc # 
vrapenec gcc # 
vrapenec gcc # TM_DEFINES="" \
> HEADERS="ansidecl.h  i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h defaults.h" XM_DEFINES="POSIX" \
> TARGET_CPU_DEFAULT="" \
> /bin/sh /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/mkconfig.sh tconfig.h
vrapenec gcc # ./xgcc -B./ -B/usr/i686-pc-linux-gnu/bin/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -fno-stack-protector -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/. -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/config -I/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-omit-frame-pointer \
>    -c /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c -DCRT_BEGIN \
>   -o crtbegin.o
vrapenec gcc # ls -la crtbegin.o
-rw-r--r-- 1 root root 1672 Mar  7 14:29 crtbegin.o
vrapenec gcc # 
Comment 7 Kevin F. Quinn (RETIRED) gentoo-dev 2006-03-07 10:15:18 UTC
(In reply to comment #5)
> This file is referenced from ./xgcc but beware the file is actually from the
> already installed gcc-3.6.6 (compiled yesterday using gcc without the hardened
> option).

hmm; does the xgcc command that failed before still fail?
Comment 8 Martin Mokrejš 2006-03-07 10:18:42 UTC
Answer to comment #7: yes, it still fails when run through emerge. But, it seems when run from commandline the very same command works fine, see comment #6 (the last command executed with proper env variables set).

I have no idea what was the parent shell command, maybe "make bootstrap" or whatever similar? I could test that if you tell me what emerge has been doing in that moment.
Comment 9 Mark Loeser (RETIRED) gentoo-dev 2006-03-14 21:32:27 UTC
Just a guess, but this is probably related to the gcc-3.4 -> 4.x split specs issue.  We use the system compiler to build the new spec file, instead of the bootstrapped xgcc.  Something 3.4 puts into the spec file is probably screwing up 3.3.  Of course, I could be completely wrong and have no idea what I'm talking about :)
Comment 10 Mark Loeser (RETIRED) gentoo-dev 2007-11-26 03:14:48 UTC
From talking to Mike, 3.x is no longer supported by toolchain.
Comment 11 SpanKY gentoo-dev 2007-11-29 06:25:14 UTC
3.3.x is not