Gentoo Archives: gentoo-user

From: ABCD <en.ABCD@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Multiple architectures for portage CFLAGS?
Date: Sat, 07 Feb 2009 05:55:19
Message-Id: gmj7na$kbf$1@ger.gmane.org
In Reply to: [gentoo-user] Multiple architectures for portage CFLAGS? by daid kahl
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 daid kahl wrote:
5 > Hello,
6 >
7 > I have encountered a problem maintaining my system using revdep-rebuild. I
8 > have both gcc-3.4.6 and gcc-4.3.2 installed on my machine. I mainly use
9 > gcc4, but sometimes I need g77 because many people at my laboratory use
10 > fortran code that is not compliant with gfortran standards.
11 >
12 > However, I have an Intel duo Core machine, so I usually have the CFLAG
13 > march=core2, but this is not supported in gcc3. Thus, if I need to rebuild
14 > gcc3 during revdep-rebuild, I have to do most of the updates by hand so that
15 > I can turn on an older march setting for gcc3 (such as march=nocona).
16 >
17 > Is there some way to set specfic CFLAGS for different gcc installs? Is my
18 > method of manually having different architectures for different gcc
19 > installations a risk?
20 >
21 > Regards,
22 > daid
23 >
24
25 It is possible, although unsupported, to set CFLAGS/CXXFLAGS for a
26 particular version of a package. The bashrc for the base profile (which
27 all modern profiles inherit from) will attempt to source, if they exist,
28 the following files:
29
30 /etc/portage/env/${CATEGORY}/${PN}
31 /etc/portage/env/${CATEGORY}/${PN}-${PV}
32 /etc/portage/env/${CATEGORY}/${PN}-${PV}-${PR}
33
34 (where for sys-devel/gcc-3.4.6-r2, CATEGORY=sys-devel, PN=gcc, PV=3.4.6,
35 and PR=r2 (when there is no "-r#" part, PR=r0))
36
37 In one of those files, you can export a new value for CFLAGS/CXXFLAGS.
38 Note that not all portage variables can be changed in this manner. (To
39 be precise, variables that are referenced from the parts of portage
40 written in bash can be changed in this manner.) Also note that if you
41 have 'CXXFLAGS="${CFLAGS}"' in your make.conf, this will set CXXFLAGS to
42 the value of CFLAGS *that is in make.conf*, so you will need to modify
43 CXXFLAGS as well as CFLAGS.
44
45 - --
46 ABCD
47 -----BEGIN PGP SIGNATURE-----
48 Version: GnuPG v2.0.9 (GNU/Linux)
49 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
50
51 iEYEARECAAYFAkmNIhcACgkQOypDUo0oQOpmzwCbBmDk9w0vdr1OxO8YPBeLhQBq
52 lqkAoJ41FE04llfOHF1RH1DG0rUxJg9d
53 =rEti
54 -----END PGP SIGNATURE-----