Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compiling some packages using different compiler [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
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1315
Location: KUUSANKOSKI, Finland

PostPosted: Wed Sep 21, 2016 8:39 am    Post subject: Compiling some packages using different compiler [SOLVED] Reply with quote

So. Like the topic subject suggest.
What's the preferable "Gentoo way", if any, to have Portage use different compiler or different version of compiler to compile certain packages? I wouldn't compile any @system packages with other than latest stable gcc.
Am I in the right direction If I'm thinking of using package environment config files?

If this has been asked before, plese just point me to the up-to-date topic or guide.

Thanks in advance.


Last edited by Zucca on Mon Sep 26, 2016 10:04 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 19243
Location: here

PostPosted: Wed Sep 21, 2016 8:46 am    Post subject: Reply with quote

Yes I think that correct way is package.env. Here example for use clang instead of gcc, in the same way you can change version of gcc (never tested).
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1315
Location: KUUSANKOSKI, Finland

PostPosted: Wed Sep 21, 2016 12:42 pm    Post subject: Reply with quote

Thanks for the guide.
However I have troubles forcing Portage to use different gcc version.

My intent is this:
/etc/portage/env/gcc-5.4.0:
PATH="${PATH}:/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0"
CC="gcc"
CXX="g++"
... meaning that setting new path would force Portage to use all the binaries gcc-5.4.0 provides.
But it seems that portage does not use PATH environment variable at all. Right?

So for a temporary workaround I try with:
/etc/portage/env/gcc-5.4.0:
CC="/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0/gcc"
CXX="/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0/g++"
EDIT01: Even that didn't work.
EDIT02: Oh, it might work. I need to re-re-re-check this.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 409

PostPosted: Wed Sep 21, 2016 1:18 pm    Post subject: Re: Compiling some packages using different compiler (versio Reply with quote

Zucca wrote:
...to have Portage use different compiler or different version of compiler to compile certain packages?


"gcc-switcher" from the "stuff" overlay can do it:

https://forums.gentoo.org/viewtopic-p-7928710.html
_________________
My phrenologist says I'm stupid.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1315
Location: KUUSANKOSKI, Finland

PostPosted: Wed Sep 21, 2016 6:28 pm    Post subject: Re: Compiling some packages using different compiler (versio Reply with quote

Apheus wrote:
"gcc-switcher" from the "stuff" overlay can do it:
Thanks. :) I'll try it if I don't find a good way to do it using package.env.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1315
Location: KUUSANKOSKI, Finland

PostPosted: Mon Sep 26, 2016 10:04 am    Post subject: Reply with quote

Just a quick update here. I managed to solve the issue just by setting the PATH correctly:
/etc/portage/env/gcc-5.4.0:
PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0:${PATH}"


So far things have been compiling as they should. :)
Marking this topic as [SOLVED].
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
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