Gentoo Archives: gentoo-dev

From: Douglas Russell <puggy@×××××××××.com>
To: gentoo-dev@g.o
Subject: [gentoo-dev] flag-o-matic eclass strip-unsupported-flags function
Date: Tue, 05 Aug 2003 16:02:01
Message-Id: 200308051659.51418.puggy@bobspants.com
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 While fixing a bug it came to my attention that when an ebuild may wish to
5 strip off CFLAGS known not to work, it will have to either strip off
6 unnecessarily large amounts of optimisations or run the risk of being
7 incompatible with different versions of gcc.
8
9 For example, if removing -finline-functions from -O3, the optimal result with
10 gcc 3 or greater is -O2 -frename-functions. However, gcc versions less than 3
11 have no -frename-functions and will hence fail. Either dropping all the way
12 down to -O2 unnecessarily on some systems or some conditional statements are
13 required. The latter is obviously desirable to maximise optimisations.
14
15 Rather than have conditional statements for every possible connotation of gcc
16 in the ebuild however, I have written this addition to the flag-o-matic
17 eclass which basically queries gcc for each of the used optimisations and
18 strips the unsupported ones.
19
20 Attached is a patch for the flag-o-matic eclass. Any feedback or suggestions
21 would be appreciated.
22
23 Puggy
24 -----BEGIN PGP SIGNATURE-----
25 Version: GnuPG v1.2.2 (GNU/Linux)
26
27 iD8DBQE/L9RwXYnvgFdTojMRAuruAKCfyBswJqQB50OTVRkLlWH1BMl5ugCfRe8W
28 kmUf7S1UuOTJ9yFkqCoMydg=
29 =66Lv
30 -----END PGP SIGNATURE-----

Attachments

File name MIME type
flag-o-matic.eclass.patch text/x-diff

Replies

Subject Author
Re: [gentoo-dev] flag-o-matic eclass strip-unsupported-flags function Martin Schlemmer <azarah@g.o>