LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-13-2012, 04:44 AM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Rep: Reputation: 85
Upgraded GCC on Gentoo, different GCC version used when not root.


On my Gentoo system, I had upgraded the gcc to match the version of gcc on another computer that would be a helper computer with distcc. I followed the Official Gentoo Docs on upgrading GCC. I recompiled libtool. Why am I using a different gcc version when I am my user than when I'm root? Even if run gcc-config -l as my user and not the root user, it shows the newer gcc selected, but that is not really the one being used.

Code:
bullshark@beastlinux ~ % gcc-config -l
 [1] i686-pc-linux-gnu-4.5.3
 [2] i686-pc-linux-gnu-4.5.3-hardenednopie
 [3] i686-pc-linux-gnu-4.5.3-hardenednopiessp
 [4] i686-pc-linux-gnu-4.5.3-hardenednossp
 [5] i686-pc-linux-gnu-4.5.3-vanilla
 [6] i686-pc-linux-gnu-4.6.2 *
 [7] i686-pc-linux-gnu-4.6.2-hardenednopie
 [8] i686-pc-linux-gnu-4.6.2-hardenednopiessp
 [9] i686-pc-linux-gnu-4.6.2-hardenednossp
 [10] i686-pc-linux-gnu-4.6.2-vanilla
bullshark@beastlinux ~ % gcc -v
Using built-in specs.
COLLECT_GCC=/usr/i686-pc-linux-gnu/gcc-bin/4.5.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-linux-gnu/4.5.3/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/gcc-4.5.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.5.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/4.5.3/python --enable-checking=release --disable-libgcj --with-arch=i686 --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.5.3-r2 p1.5, pie-0.4.7'
Thread model: posix
gcc version 4.5.3 (Gentoo Hardened 4.5.3-r2 p1.5, pie-0.4.7)
bullshark@beastlinux ~ % su -
Password: 
beastlinux ~ # gcc -v
Using built-in specs.
COLLECT_GCC=/usr/i686-pc-linux-gnu/gcc-bin/4.6.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-linux-gnu/4.6.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.6.2/work/gcc-4.6.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.6.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.6.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-esp --enable-libgomp --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/4.6.2/python --enable-checking=release --disable-libgcj --disable-libquadmath --with-arch=i686 --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.6.2 p1.4, pie-0.5.0'
Thread model: posix
gcc version 4.6.2 (Gentoo Hardened 4.6.2 p1.4, pie-0.5.0) 
beastlinux ~ #
 
Old 07-13-2012, 09:23 AM   #2
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Well, I have the same configuration on my distcc system, and except very few packages, everything compiles and runs fine, despite the gcc version mismatch.
 
Old 07-14-2012, 11:11 AM   #3
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
I ran an emerge --depclean, and it removed the older gcc version and left just the new one. So now when I type gcc -v as non root, it shows the same new version that is shown when I typed gcc -v as root.

BTW, It's highly discouraged to use gcc versions that aren't the same with distcc. Everywhere I've read about distcc, it has said that. However, I have also read that it is ok to be off by one point release eg. if your versions are both 4.5.x eg. one is 4.5.6 and the other is 4.5.8. I suggest you look at the system with the older gcc version, and then upgrade it to be the same as the system with the newer version. For me, I did added this, and then upgraded my gcc. Be sure to read the Gentoo's Upgrading GCC guide. You will need to rebuild libtool and depending on your gcc version, you may need to do a few additional steps. I've had absolutely no problems with any of this.

bullshark@beastlinux ~ % cat /etc/portage/package.accept_keywords
=sys-devel/gcc-4.6.2 ~x86
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"CC version check failed" gcc 4.2.3 and gcc 4.1 barbuceanu Linux - Newbie 12 04-23-2008 06:24 PM
upgraded gcc,but it's like uselessly antlers Slackware 2 03-09-2007 10:15 PM
gcc upgraded but not showing jared78 Linux - Newbie 2 07-05-2006 01:19 AM
Upgraded GCC; now many programs don't work Zoombie Linux - Software 13 02-24-2004 06:08 AM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration