View previous topic :: View next topic |
Author |
Message |
wichtounet Tux's lil' helper
Joined: 17 Mar 2012 Posts: 122
|
Posted: Fri Dec 14, 2012 6:20 pm Post subject: How to specify the compiler to use for a specific package ? |
|
|
Hi,
I installed a system with two compilers: GCC 4.7.2 and GCC 4.5.4.
I know that some package, grub for instance, do not work when compiled with GCC 4.7.2.
Is this possible to specifiy that a specific package should be compiled with a specific version of GCC ? I want all packages to be compiled with 4.7.2, but grub with 4.5.4.
Thank you
Baptiste |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Fri Dec 14, 2012 9:41 pm Post subject: |
|
|
I don't know if it will work, I did not test !
I don't in anyway pretend that this is best practice :
However, spontaneously, I would answer to :
a/ create a /etc/portage/env/sys-boot directory
b/ edit a file named grub so that it contents : Code: |
pre_pkg_setup () {
gcc-config The_ID_of_your_gcc_4_5_as_displayed_with_gcc-config-l
}
post_pkg_postinst () {
gcc-config The_ID_of_your_gcc_4_7_as_displayed_with_gcc-config-l
} |
_________________
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21605
|
Posted: Sat Dec 15, 2012 1:51 am Post subject: |
|
|
aCOSwt: please test before you propose solutions that are unnecessarily invasive. It should be sufficient to set $CC to the compiler you wish to use. If the build system respects $CC, it will call the chosen compiler. If the build system does not respect $CC, then the build system has a bug and needs to be fixed to respect $CC. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
dol-sen Retired Dev
Joined: 30 Jun 2002 Posts: 2805 Location: Richmond, BC, Canada
|
Posted: Sat Dec 15, 2012 2:01 am Post subject: |
|
|
For automatic repeatable behavior, you can also use /etc/portage/package.env...
Quote: | package.env
Per-package environment variable settings. Entries refer to environment files that are placed in the /etc/portage/env/ directory and have the same format as make.conf(5). |
see the manpage for more detail _________________ Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch... |
|
Back to top |
|
|
wichtounet Tux's lil' helper
Joined: 17 Mar 2012 Posts: 122
|
Posted: Tue Dec 18, 2012 7:07 pm Post subject: |
|
|
Thank you all for your answers
I added CC=XXX in a new env and set it in package.env
@Jaglover: Thanks for the feedback, but I don't want to take any risk |
|
Back to top |
|
|
|