Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Specify alternate gcc version for specific packages?[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
crowbert
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 140

PostPosted: Sun Feb 08, 2015 12:51 am    Post subject: Specify alternate gcc version for specific packages?[SOLVED] Reply with quote

I've switched to gcc 4.9, but I found that a few specific packages don't compile or work correctly with it. What I would like to do is keep the system default to 4.9, but specify that those particular packages are to be compiled with 4.8.

My thought was to use /etc/portage/package.env to specify different values for CC and CXX, but that doesn't seem to be working. I'm not sure if I'm just doing it wrong, or if invoking a different version of GCC is more complicated than just specifying the full version instead of just 'gcc'.

I would think the same technique should work for selecting icc or another compiler on a per-package basis. Has anyone gotten this working?


Last edited by crowbert on Sun Feb 08, 2015 3:13 am; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Feb 08, 2015 2:48 am    Post subject: Reply with quote

It get gcc by path, so switching PATH in the packge env file should be enough no?
Code:
gcc --version
gcc (Gentoo 4.7.4 p1.0, pie-0.5.5) 4.7.4
Copyright © 2012 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

PATH="/usr/i686-pc-linux-gnu/gcc-bin/4.4.3" gcc --version
gcc (Gentoo 4.4.3-r3 p1.4, pie-0.4.5) 4.4.3
Copyright © 2010 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.
Back to top
View user's profile Send private message
crowbert
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 140

PostPosted: Sun Feb 08, 2015 3:12 am    Post subject: Reply with quote

Ahh. Setting the path should work, but I found that just setting CC and CXX works, too.

My problem was that I had the wrong syntax in the package.env file, so it wasn't loading my variables.
Back to top
View user's profile Send private message
crowbert
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 140

PostPosted: Sun Feb 08, 2015 5:39 pm    Post subject: Reply with quote

One more follow-up. It seems to depend a bit on the ebuild.

For media-tv/mythtv, I set CC and CXX (last I checked, it wouldn't build with gcc 4.9).
For www-client/chromium, it needs BUILD_CC and BUILD_CXX, at least with an older ebuild (I'm stuck on version 34 due to a pointer focus bug that makes newer versions unusable with my window manager).

Anyway, I've achieved what I need to ensure that I won't accidentally compile the packages in question with the wrong gcc.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum