Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 66847 - multiple ~arch related bootstraps failing gcc-3.4.2-r2 not switching profiles
Summary: multiple ~arch related bootstraps failing gcc-3.4.2-r2 not switching profiles
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-08 23:20 UTC by Michael Crawford (ali3nx)
Modified: 2004-12-13 05:52 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Crawford (ali3nx) 2004-10-08 23:20:59 UTC
Details could best be described by a thread on the forums i started yesterday

http://forums.gentoo.org/viewtopic.php?t=234046

Reproducible: Always
Steps to Reproduce:
1. prepare a fresh stage1 install
2. ACCEPT_KEYWORDS="~arch" (unstable tree)
3. cd /usr/portage && scripts/bootstrap-cascade.sh

Actual Results:  
major borkage possibly related to gcc not correctly switching profiles, /lib/cpp
sanity errors and/or c++ in binutils, ncurses and other bootstrap related packages

Expected Results:  
bootstrap should complete

this is not related to one system therefore emerge info was ommitted
Comment 1 Travis Tilley (RETIRED) gentoo-dev 2004-10-10 00:43:37 UTC
please give the emerge info for one of the systems at least...

also, please give the output of gcc-config -c. does it point to a valid compiler?

did you get the output "The current gcc config appears valid, so it will not be automatically switched for you. If you would like to switch to the newly installed gcc version, do the following:", etc?

Comment 2 Hiel Van Campen 2004-10-10 09:17:23 UTC
Well Im in to gcc34. I made it through ncurses but I added a step to your install guide we are useing "bootstrap-cascade.sh"

      Getting the Portage Tree
      --------------------------------------
      Code:
      emerge sync
      rm /etc/make.profile
      ln -s /usr/portage/profiles/default-linux/x86/2004.2/gcc34/2.6 /etc/make.profile 



heres my make.conf[


      ###EDIT I actulally cut and pasted the USE from the bottom your USE thingy and added nptl .Put actual USE flags in.

      USE=" x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang spell ssl svga tcpd truetype X xml2 xmms xv zlib"
      CHOST="i686-pc-linux-gnu"
      CFLAGS="-march=athlon-xp -O3 -pipe"
      CXXFLAGS="${CFLAGS}"
      ACCEPT_KEYWORDS="~x86"
      PORTAGE_TMPDIR=/home/tmp
      PORTDIR=/usr/portage
      DISTDIR=${PORTDIR}/distfiles
      PKGDIR=${PORTDIR}/packages
      PORT_LOGDIR=/var/log/portage
      GENTOO_MIRRORS="ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/
      http://128.213.5.34/gentoo/"
      FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
      RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
      SYNC="rsync://rsync.gentoo.org/gentoo-portage"
      RSYNC_RETRIES="3"
      RSYNC_TIMEOUT=180
      MAKEOPTS="-j3 "
      AUTOCLEAN="yes"
      FEATURES="sandbox buildpkg userpriv "

Well I just crashed, rats. It was on the final rebuild of ncurses. Heres the error


      gcc -march=athlon-xp -O3 -pipe -fPIC -o xmas ../obj_s/xmas.o -L../lib -lform -lmenu -lpanel -lncurses -Wl,-rpath,/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/lib -I../test -I. -DHAVE_CONFIG_H -I. -I../include -D_GNU_SOURCE -DNDEBUG -march=athlon-xp -O3 -pipe -fPIC -fPIC
      make[1]: Leaving directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/test'
      cd misc && make DESTDIR="" all
      make[1]: Entering directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/misc'
      make[1]: Nothing to be done for `all'.
      make[1]: Leaving directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/misc'
      cd c++ && make DESTDIR="" all
      make[1]: Entering directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/c++'
      cd ../obj_s; -I../c++ -I../include -I. -DHAVE_CONFIG_H -I. -I../include -D_GNU_SOURCE -DNDEBUG -march=athlon-xp -O3 -pipe -fPIC -fPIC -c ../c++/cursesf.cc
      /bin/sh: line 1: -I../c++: No such file or directory
      make[1]: *** [../obj_s/cursesf.o] Error 127
      make[1]: Leaving directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/c++'
      make: *** [all] Error 2

      !!! ERROR: sys-libs/ncurses-5.4-r5 failed.
      !!! Function src_compile, Line 79, Exitcode 2
      !!! make failed



Also gcc-v


      gcc -v
      Reading specs from /usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.3/specs
      Configured with: /var/tmp/portage/gcc-3.3.3-r6/work/gcc-3.3.3/configure --prefix=/usr --bindir=/usr/i386-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.3/include --datadir=/usr/share/gcc-data/i386-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i386-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i386-pc-linux-gnu/3.3/info --enable-shared --host=i386-pc-linux-gnu --target=i386-pc-linux-gnu --with-system-zlib --enable-languages=c --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.3/include/g++-v3 --with-local-prefix=/usr/local --disable-nls --disable-multilib --enable-__cxa_atexit --enable-clocale=generic
      Thread model: posix
      gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)

So this from bootstap-cascade.sh
Code:

# Basic support for gcc multi version/arch scheme ...
if [ -n "${STRAP_RUN}" ]; then
   if test -x ${GCC_CONFIG} &>/dev/null && \
      ${GCC_CONFIG} --get-current-profile &>/dev/null
   then
      # Make sure we get the old gcc unmerged ...
      emerge clean || cleanup 1
      # Make sure the profile and /lib/cpp and /usr/bin/cc are valid ...
      ${GCC_CONFIG} "`${GCC_CONFIG} --get-current-profile`" &>/dev/null
   fi
fi
doesnt seem to work if its suppose switch to the new gcc. By adding to the above 
  
   ${GCC_CONFIG} "2" && source /etc/profile

bootstrap-cascade.sh works.
Comment 3 Hiel Van Campen 2004-10-10 09:19:34 UTC
Oh and yes I got the  "The current gcc config appears valid, so it will not be automatically switched for you. If you would like to switch to the newly installed gcc version, do the following:"
Comment 4 Hiel Van Campen 2004-10-10 10:15:30 UTC
One last thing to add. Trying to auto select gcc-version. ${myGCC} returns
gcc-3.3.3 . If maybe you could include etools but even that wouldnt allow to
change uless you were in the ebuild and what criteria would you use to to make the
selection since you now have 4 to chose from. 
 gcc-config -l
[1] i386-pc-linux-gnu-3.3.3
[2] i686-pc-linux-gnu-3.4.2
[3] i686-pc-linux-gnu-3.4.2-hardened
[4] i686-pc-linux-gnu-3.4.2-hardenednoss

It would seem that the perfect solution would the cascadeing profile link.
2004.3/x86/gcc34<you want gcc34>/2.6--> gcc34 and 2.5 headers26
                                    /hard/2.6  gcc34-hardened and 2.6     
				    /hardenednoss but no 25headers
				    
Wouldnt this allow a logicol selection without haveing to hard wire bootstrap? 
Frankly any other rout leaves me with visions of 100s of noobs trying to install
thier gentoo and haveing to hardwire it. Talk about freaky Friday. 
Comment 5 solar (RETIRED) gentoo-dev 2004-10-10 10:28:25 UTC
i686-pc-linux-gnu-3.4.2-hardenednoss <-- what's this?
Comment 6 Hiel Van Campen 2004-10-10 13:22:06 UTC
I frankly dont know, but thats what 2 of us get when we do gcc-config -l.
Comment 7 Travis Tilley (RETIRED) gentoo-dev 2004-10-10 21:15:49 UTC
it's hardenednossp. psm's piepatches allow for such a configuration, so i added a specs for it.

OH... i get it. at stage1 gcc can only compile c, not c++... so a sane c++ compiler isnt expected to be present at that point, regardless of gcc version. now when gcc 3.4 is built, it's a fully functional compiler, but it doesnt switch to it because the stage1 compiler appears to be valid... even though it cant compile c++.

oh boy. solar, what do we do in a situation like this? do we have bootstrap uninstall the old c-only gcc and -then- switch?
Comment 8 Travis Tilley (RETIRED) gentoo-dev 2004-10-10 21:23:38 UTC
i just made toolchain.eclass always switch to the new compiler if bootstrapping, but we still have the problem of a stale c-only compiler laying around.

Hiel Van Campen - can you sync up in about 15-30 minutes and try again just to see if that fixed your problem?
Comment 9 Hiel Van Campen 2004-10-10 21:38:36 UTC
Yeah I just got the message, Ill check the time stamp and wipre the partion and rebootstrap.
Comment 10 Hiel Van Campen 2004-10-11 17:57:12 UTC
Well synced about 30 minutes later but failed and gcc was still 3.3.3 . I;m going to resync now and try again.
Comment 11 Hiel Van Campen 2004-10-11 18:37:28 UTC
Well tried last it failed. Just tried again now and it didnt switch to gcc-3.4.2 and it crashed sooner with a newer glibc. Ok heres the gcc gcc-config error
 
>>> original instance of package unmerged safely.
 * /usr/bin/gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-
 * Switching to i686-pc-linux-gnu- compiler...
/usr/bin/gcc-config: line 177: /etc/env.d/gcc/i686-pc-linux-gnu-: No such file or directory
gawk: cmd. line:2: fatal: cannot open file `/etc/env.d/gcc/i686-pc-linux-gnu-' for reading (No such file or directory)                                                                                                  [ ok ]
 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile

 * Scanning libtool files for hardcoded gcc library paths...
/etc/env.d/gcc/i686-pc-linux-gnu- doesnt exist
gcc-config error: Could not run/locate "gcc"
:0: assertion failed: (gcc -dumpversion) | getline NEWVER)
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> sys-devel/gcc-3.4.2-r2 merged.

which causes this 

>>> Unpacking source...
nptl
x86

 * Checking gcc for __thread support ... no

 * Could not find a gcc that supports the __thread directive!
 * please update to gcc-3.2.2-r1 or later, and try again.
Comment 12 Hiel Van Campen 2004-10-13 08:22:02 UTC
What I was trying to say in my last post is that the modifications that Travis
made didnt work. After bootstraping gcc you are left with out a working gcc link.

>>> original instance of package unmerged safely.
 * /usr/bin/gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-
 * Switching to i686-pc-linux-gnu- compiler...
/usr/bin/gcc-config: line 177: /etc/env.d/gcc/i686-pc-linux-gnu-: No such file or directory
gawk: cmd. line:2: fatal: cannot open file `/etc/env.d/gcc/i686-pc-linux-gnu-' for reading (No such file or directory)

As you can see gcc33 is unmerged, good, but it then trys to switch to a partial "i686-pc-linux-gnu- " profile, Hint its
missing the version # ;^) /etc/env.d is filled correctly I belive.

ls /etc/env.d/gcc
config			 i686-pc-linux-gnu-3.4.2	   i686-pc-linux-gnu-3.4.2-hardenednossp
i386-pc-linux-gnu-3.3.3  i686-pc-linux-gnu-3.4.2-hardened

And 

cat /etc/env.d/gcc/config 
CURRENT= * /usr/bin/gcc-config: Profile does not exist or invalid setting for 
/etc/env.d/gcc/i686-pc-linux-gnu-i686-pc-linux-gnu-

This of course breaks the glibc install and bootstrap as there is no valid gcc compiler.
Comment 13 Hiel Van Campen 2004-10-13 20:50:54 UTC
The problem is in this 
local current_specs="$(echo ${current_gcc_config} | awk -F - '{ print $6 }')"
The print $6 is wrong there are only 5 fields. 

tester ~ # gcc-config -c
i686-pc-linux-gnu-3.4.2

This fixes the broken gcc-config leaving no working gcc. Unfortenetly it still doesnt switch to gcc-3.4.2.
Comment 14 Hiel Van Campen 2004-10-13 20:56:51 UTC
The above edit is in toolchain.eclass at "do_gcc_config() {"
Comment 15 Travis Tilley (RETIRED) gentoo-dev 2004-10-13 23:04:38 UTC
that variable holds the current specs config. if $6 is empty, that should be alright... but there is occasionally a sixth field.

ayanami 3.4.2 # gcc-config -c
x86_64-pc-linux-gnu-3.4.2-vanilla
Comment 16 Michael Crawford (ali3nx) 2004-10-14 10:42:44 UTC
ok from where i'm sitting i can see that the profiles appear to be defining themselves in gcc-config -l just a note this is just from this morning on a remote system i built that i'm repairing for Jae

gefroren ~ # gcc-config -l
[1] i386-pc-linux-gnu-3.3.4
[2] i686-pc-linux-gnu-3.4.2 *
[3] i686-pc-linux-gnu-3.4.2-hardened
[4] i686-pc-linux-gnu-3.4.2-hardenednossp

Previously no defined profile was highlighted.

Travis i spotted that bounds checking patch in gcc-3.4.2-r2 configure
bounds-checking-gcc-3.4.2-1.00.patch.bz2
i'm curious if it's related to this configure error

 * Done with patching
 * patching gcc version:  (Gentoo Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)
 * Patching ${S}/ltmain.sh...

 * Portage patch requested, but failed to apply!

!!! ERROR: sys-devel/gcc-3.4.2-r2 failed.
!!! Function elibtoolize, Line 228, Exitcode 0
!!! Portage patch requested, but failed to apply!
!!! If you need support, post the topmost build error, NOT this status message.

here's the emerge info on that system also

gefroren ~ # emerge info
Portage 2.0.51_rc9 (default-linux/x86/2004.2, gcc-3.4.2, glibc-2.3.4.20041006-r0, 2.6.9-rc3-mm3 i686)
=================================================================
System uname: 2.6.9-rc3-mm3 i686 AMD Athlon(tm) XP 2800+
Gentoo Base System version 1.5.3
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -mtune=athlon-xp -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /opt/openjms/config /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -mtune=athlon-xp -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://mirrors.tds.net/gentoo http://gentoo.seren.com/gentoo http://gentoo.osuosl.org/ ftp://mir.zyrianes.net/gentoo/ http://www.gigaload.org/gentoo.org/ ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowex S3TC X X509 aac aalib acl acpi activefilter adns aim alsa amd apache2 apm arts audiofile avantgo avi bcmath bdf berkdb bidi bitmap-fonts bluetooth bzlib cap cddb cdinstall cdparanoia cdr cdrom cgi chroot cjk client cpdflib crypt ctype cups curl curlwrappers dba dio directfb divx4linux djbfft dnd droproot dv dvb dvd dvdr dvdread edl eds emacs emacs-w3 encode erandom esd exif ext-png ext-zlib extensions f77 faac faad fam fastcgi fbcon ffmpeg flac flash fluidsynth fmod foomaticdb foreign-package foreign-sysvinit freetds freetype freewnn ftp gb gcj gcl gd gdbm geoip ggi gif gimp gimpprint ginac glade glgd glut gmp gmtfull gnome gnomedb gnuplot gpm gps graphviz gs gsl gstreamer gtk gtk2 gtkhtml guile hal hardenedphp hbci hdf iconv icq ide idl ieee1394 image imap imlib imlib2 innodb ipv6 irda irmc j2ee jabber java javacomm javadoc javamail javascript jbig jboss jce jms jmx joystick jp2 jpeg jpeg2k jta junit jython kadu-modules kadu-voice kakasi kde kerberos krb4 latex lcms leim libdsk libg++ libgd libgda libsamplerate libwww live lm_sensors lua lufsusermount lzo lzw lzw-tiff m17n-lib mad maildir matroska mbox mcal mdb memlimit mhash migemo mikmod mime mixer mmap mmx mng motif mozcalendar mozdomi mozp3p mozsvg mozxmlterm mp3 mpeg mpeg4 mpi mplayer msn mssql mule music mysql nagios-dns nagios-ntp nagios-ping nagios-ssh nas native ncurses net network nis nls nptl ntlm nvidia nviz oav ocaml odbc offensive ofx oggvorbis openal opengl opie oscar ospfapi oss pam parse-clocks pcap pcntl pcre pdf pdflib perl pg-hier pg-intdatetime pg-vacuumdelay php physfs pic plotutils png portaudio posix postgres postgresql ppds print pthreads python qt quicktime quotes readline rhino rogue rplay rtc ruby samba sasl sdl servlet-2.3 servlet-2.4 session sftplogging shaper shared sharedmem sheep silc simplexml skk slang slp smime sndfile snmp sockets socks5 softquota sox speex spell sse ssl stencil-buffer stroke svg svga sysvipc szip t1lib tcpd tetex tga theora tidy tiff transcode truetype unicode usb v4l v4l2 vda vhosts videos virus-scan wifi wmf wxwin wxwindows x86 xatrix xchatdccserver xchattext xemacs xgetdefault xine xml xml2 xmlrpc xmms xosd xpm xprint xrandr xscreensaver xsl xv xvid xvmc yahoo yv12 zlib zvbi"
Comment 17 SpanKY gentoo-dev 2004-12-06 20:12:12 UTC
still issue ?
Comment 18 Michael Crawford (ali3nx) 2004-12-13 05:52:17 UTC
latest gcc-config fixes seem to have resolved this bug... contributors please relay opinions