Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87839 - gcc-config cannot switch compilers
Summary: gcc-config cannot switch compilers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-03 14:02 UTC by Bob
Modified: 2005-04-05 23:21 UTC (History)
0 users

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 Bob 2005-04-03 14:02:10 UTC
gcc-config is locked on a compiler.  when the command "gcc-config 1" is issued to select gcc compiler number one, gcc appropriately reports that it is switching to the selected compiler and notifies the user to "source /etc/profile".  unfortunatly, gcc-config does not switch to the selected compiler -- the default compiler remains as the selected choice and it is impossible to change it.

Reproducible: Always
Steps to Reproduce:
1. emerge --sync
2. emerge gcc-config
3. gcc-config 1

Actual Results:  
compiler is not switched 

Expected Results:  
compiler is switched 

Portage 2.0.51.19 (default-linux/x86/2004.3, gcc-3.4.3-20050110, 
glibc-2.3.4.20050125-r1, 2.6.9-gentoo-r9 i686) 
================================================================= 
System uname: 2.6.9-gentoo-r9 i686 Pentium III (Coppermine) 
Gentoo Base System version 1.4.16 
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Mar 11 2005, 
12:01:17)] 
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled] 
ccache version 2.3 [enabled] 
dev-lang/python:     2.3.4-r1 
sys-devel/autoconf:  2.59-r6, 2.13 
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 
sys-devel/binutils:  2.15.92.0.2-r1 
sys-devel/libtool:   1.5.10-r4 
virtual/os-headers:  2.6.8.1-r2 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS=" -O2 -march=pentium3 -mtune=pentium3 -pipe -fweb -rename-registers 
-fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer" 
CHOST="i686-pc-linux-gnu" 
CONFIG_PROTECT="/etc /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/lib/X11/xkb /usr/share/config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS=" -O2 -march=pentium3 -mtune=pentium3 -pipe -fweb -frename-registers 
-fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer 
-fvisibility-inlines-hidden" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" 
GENTOO_MIRRORS="http://gentoo.osuosl.org 
http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" 
USE="x86 X acpi alsa apm arts avi berkdb bitmap-fonts crypt cups emboss encode 
fam font-server foomaticdb fortran gdbm gif gphoto2 gpm gtk gtk2 hal ide imlib 
ipv6 jpeg kde ldap libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl 
oggvorbis opengl oss pam pdf pdflib perl png posix pthreads python qt 
quicktime readline samba scanner sdl snmp spell ssl svga tcpd tiff truetype 
truetype-fonts type1-fonts userlocales xine xinerama xml xml2 xmms 
xscreensaver xv zlib" 
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Bob 2005-04-03 14:10:53 UTC
sorry... forgot to mention that the dysfunctional ebuilds are:

/sys-devel/gcc-config-1.3.10-r2
/sys-devel/gcc-config-1.3.10-r1

when attempting to roll back to gcc-config-1.3.8-r4, the following error is issued:

Calculating dependencies ...done!
>>> emerge (1 of 1) sys-devel/gcc-config-1.3.8-r4 to /
>>> Unpacking source...
>>> Source unpacked.
>>> Test phase [not enabled]: sys-devel/gcc-config-1.3.8-r4

>>> Install gcc-config-1.3.8-r4 into /var/tmp/portage/gcc-config-1.3.8-r4/image/ category sys-devel
man:
prepallstrip:
strip: strip --strip-unneeded
strip: strip --strip-unneeded
   usr/lib/gcc-config/wrapper
>>> Completed installing gcc-config-1.3.8-r4 into /var/tmp/portage/gcc-config-1.3.8-r4/image/

>>> Merging sys-devel/gcc-config-1.3.8-r4 to /
--- /usr/
--- /usr/bin/
>>> /usr/bin/gcc-config
--- /usr/lib/
--- /usr/lib/gcc-config/
>>> /usr/lib/gcc-config/wrapper
>>> Safely unmerging already-installed instance...
--- !mtime obj /usr/lib/gcc-config/wrapper
--- !mtime obj /usr/bin/gcc-config
--- !empty dir /usr/lib/gcc-config
--- !empty dir /usr/lib
--- !empty dir /usr/bin
--- !empty dir /usr
>>> 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-3.4.3-20050110
 * /usr/bin/gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-3.4.3-20050110
 * Switching to i686-pc-linux-gnu-3.4.3-20050110 compiler...                                                                                          [ ok ]
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> sys-devel/gcc-config-1.3.8-r4 merged.

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.


Comment 2 Bob 2005-04-03 14:36:14 UTC
although i forgot to mention it, the previous posts are related to a Gentoo box that was installed from 2004.3 profiles and has been kept up to date.

i am experiencing identical problems on a number of additional PCs upon which i have installed 2005.0 and also upgraded to GCC 3.4.3.  here is an example from one of the effected 2005.0 boxes:

# emerge info

Gentoo Base System version 1.4.16
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r4 i586)
=================================================================
System uname: 2.6.11-gentoo-r4 i586 AMD-K6(tm) 3D processor
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Mar 30 2005, 17:35:45)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium -mtune=pentium -pipe -O3 -fweb -frename-registers -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium -mtune=pentium -pipe -O3 -fweb -frename-registers -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.17.27/gentoo-portage"
USE="x86 X alsa apm arts avi berkdb bitmap-fonts crypt cups emboss encode foomaticdb fortran gdbm gif gnome gpm gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl svga tcpd truetype truetype-fonts type1-fonts xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS


in the following situation, on both 2004.3 and 2005.0 systems, GCC-CONFIG will not work:

 # gcc-config -l 
 [1] i686-pc-linux-gnu-3.3.5 
 [2] i686-pc-linux-gnu-3.3.5-hardened 
 [3] i686-pc-linux-gnu-3.3.5-hardenednopie 
 [4] i686-pc-linux-gnu-3.3.5-hardenednossp 
 [5] i686-pc-linux-gnu-3.4.3-20050110 * 
 [6] i686-pc-linux-gnu-3.4.3-20050110-hardened 
 [7] i686-pc-linux-gnu-3.4.3-20050110-hardenednopie 
 [8] i686-pc-linux-gnu-3.4.3-20050110-hardenednossp

interestingly, if you "emerge -P gcc-config" you'll get the following output:

# gcc-config -l
[1] i686-pc-linux-gnu-3.4.3-20050110 *
[2] i686-pc-linux-gnu-3.4.3-20050110-hardened
[3] i686-pc-linux-gnu-3.4.3-20050110-hardenednopie
[4] i686-pc-linux-gnu-3.4.3-20050110-hardenednossp

NOTE:  after pruning gcc 3.3.x from the system, gcc-config immediately began to work properly on all of the effected 2005.0 and 2004.3 systems!

thanks for your time.
Comment 3 Ryan Lynch 2005-04-03 14:54:31 UTC
I've reproduced this problem on a 2005.0 Pentium system.  In the process of upgrading from gcc 3.3.5 to 3.4.3, I issued the command gcc-config 5 to switch to the the newly installed i586 gcc 3.4.3 profile (which gcc-config -l listed as profile [5]). However, despite all my attempts it would not budge. I ended up having to recompile gcc-3.4.3 in order to get gcc-config to finally switch to the gcc 3.4.3 profile.
Comment 4 Ryan Lynch 2005-04-03 15:05:33 UTC
Here is the output of emerge info on that system:

BlueBox / # emerge info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-love2 i686)
=================================================================
System uname: 2.6.11-love2 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr  2 2005, 05:35:19)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium -mtune=pentium -pipe -O3 -fweb -frename-registers -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium -mtune=pentium -pipe -O3 -fweb -frename-registers -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
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 X alsa apm arts avi berkdb bitmap-fonts crypt cups emboss encode foomaticdb fortran gdbm gif gnome gpm gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl svga tcpd truetype truetype-fonts type1-fonts xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 5 Bob 2005-04-03 16:36:52 UTC
R Lynch said: "I've reproduced this problem on a 2005.0 Pentium system.  In the process of upgrading from gcc 3.3.5 to 3.4.3, I issued the command gcc-config 5 to switch to the the newly installed i586 gcc 3.4.3 profile (which gcc-config -l listed as profile [5]). However, despite all my attempts it would not budge. I ended up having to recompile gcc-3.4.3 in order to get gcc-config to finally switch to the gcc 3.4.3 profile."

i performed "emerge -e system && emerge -e system" and this still did not fix the gcc-config problem.  the only way i was able to solve the problem was to prune the earlier version of gcc-config.
Comment 6 Ryan Lynch 2005-04-04 09:23:38 UTC
Prune the earlier version of gcc or gcc-config?  I didn't think gcc-config was slotted.
Comment 7 Bob 2005-04-04 12:57:38 UTC
oops.  error on my part.  

the command that fixes the problem is "emerge -P gcc", not "emerge -P gcc-config".

removing the slotted GCC 3.3.4 or 3.3.5 compiler is what allows gcc-config to work properly.  if you change all of my references to "removing  the slotted version of gcc-config", and replace them with "removing the slotted version of gcc", then the posts will be correct.  sorry about that. :o
Comment 8 SpanKY gentoo-dev 2005-04-04 18:18:11 UTC
so as long as you upgrade to the proper version of gcc-config ...
Comment 9 Bob 2005-04-04 22:56:23 UTC
i'm somewhat lost by your reference to a "proper" version of gcc-config.

what is the "proper" version of gcc-config? none of the most 3 recent versions in portage work properly with gcc 3.3.x and gcc 3.4.3 installed on the system.  in order to get gcc-config to work at all, the user has to prune gcc 3.4.x from the system.  forcing the user to delete an entire compiler branch to get the configuration tool to function is obviously not how the system is supposed to work.  this is a bug that really needs to be addressed.

more info:

cat /etc/portage/package.keywords
sys-devel/gcc ~x86
sys-devel/gcc-config ~x86 
sys-libs/libstdc++-v3 ~x86
sys-libs/glibc ~x86
Comment 10 Bob 2005-04-05 23:21:00 UTC
well, i guess that i now understand what you meant by "so as long as you upgrade to the proper version of gcc-config ..." 

CVS reports that in response to this bug report, vapier updated gcc-config-1.3.10-r2 to version 1.3 on 04-05-2005 at 01:18:45 +0000.  

now that the ebuild has been fixed, i'm happy to agree with you and say WORKSFORME.

thanks for fixing the problem. :)