Gentoo Archives: gentoo-dev

From: Maurice van der Pot <griffon26@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] What to do with things like -fpie in CFLAGS in environment?
Date: Tue, 12 Apr 2005 16:00:00
Message-Id: 20050412155953.GM8632@kfk4ever.com
1 I have the following situation:
2 - a package (valgrind) that can be compiled with PIE and uses PIE
3 for some purpose or other if it is supported
4 - tests (make check) that cannot be compiled with PIE
5
6 In the upstream release CFLAGS is reset to "-Wno-long-long", but I would
7 prefer to allow customised CFLAGS. I already asked the developers why
8 they reset the CFLAGS, but I haven't received an answer.
9 I made a small modification to configure to enable the use of make.conf's
10 CFLAGS, but now some problems occur. The first problem is a problem even
11 without this modification.
12
13 If compiled with the hardened gcc profile, -fno-pie has to be specified
14 when compiling the tests or it will fail. Specifying -fno-pie always
15 will force me to disable any PIE support through configure as well.
16
17 I tried to adapt the makefiles to disable pie themselves for the tests
18 only, but then I have another problem:
19
20 What if the user specifies -fpie in make.conf?
21 The compilation of the tests will fail because -fpie (from the environment)
22 will end up in CFLAGS after -fno-pie (from the makefile).
23 If I use flag-o-matic to filter out -fpie, it will add -fno-pie everywhere
24 and disable PIE altogether.
25
26 I'm looking for a solution that preferably:
27 - uses (some of) make.conf's CFLAGS
28 - compiles with all gcc profiles and all CFLAGS (filtering some is ok)
29 - does not disable PIE altogether
30
31 Is there such a solution?
32
33 Maurice.
34
35 --
36 Maurice van der Pot
37
38 Gentoo Linux Developer griffon26@g.o http://www.gentoo.org
39 Creator of BiteMe! griffon26@××××××××.com http://www.kfk4ever.com

Replies