Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: per-package CFLAGS
Date: Tue, 27 Jan 2015 14:13:26
Message-Id: CAGfcS_kia9thwk5CAz6qCOY1R9KhDtGBYQi_i7xTkVi9FcOkmg@mail.gmail.com
In Reply to: [gentoo-user] Re: per-package CFLAGS by "Holger Hoffstätte"
1 On Tue, Jan 27, 2015 at 8:54 AM, Holger Hoffstätte
2 <holger.hoffstaette@××××××××××.com> wrote:
3 > On Tue, 27 Jan 2015 14:35:35 +0100, Raffaele BELARDI wrote:
4 >
5 >> I have a package failing build (media-tv/mythtv). One resource on the
6 >> net suggests using the -fno-devirtualize gcc flag. Google tells me that
7 >> the way to do that would be something like
8 >>
9 >> $ echo "CFLAGS=\"${CFLAGS} -fno-devirtualize\"" >
10 >> /etc/portage/env/media-tv/mythtv
11 >>
12 >> but the references are pretty old. Is this still the preferred way?
13 >
14 > This alone won't work and might also be more confusing than necessary, as
15 > the package-hierarchy-like naming is not required.
16
17 This alone works fine for me, and I don't find the naming confusing.
18 I'm sure the way you referenced would also work, though it ends up
19 dumping the configuration for every package into a single file.
20
21 cat /etc/portage/env/media-tv/mythtv
22 CFLAGS="-march=amdfam10 -Os -pipe -frename-registers -fweb"
23 CXXFLAGS="-march=amdfam10 -Os -pipe -frename-registers -fweb"
24
25 I would recommend that instead of just putting flags for each package
26 in a separate file that you instead create a per-package config and
27 then symlink it from the package name. As in:
28 ls -l /etc/portage/env/media-tv/mythtv
29 lrwxrwxrwx 1 root root 13 Oct 5 2012
30 /etc/portage/env/media-tv/mythtv -> ../noparallel
31
32 --
33 Rich