This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how to turn off PIE on Fedora?
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Per Bothner <per at bothner dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 14 Dec 2003 00:14:45 -0800
- Subject: Re: how to turn off PIE on Fedora?
- References: <3FDA77E7.20202@bothner.com>
Per Bothner <per@bothner.com> writes:
> Can any Red Hat engineers shed light on this:
>
> Data seems to move around unpredictably under Fedora Core.
> I.e. I run cc1 under gdb to a breakpoint or error, and note
> the memory address of some variable. I then re-run cc1 with
> no changes, and the variable has jumped to a different address.
> This complicates debugging, and specifically setting conditional
> breakpoints.
>
> This presumably is because of PIE "position independent
> executables", which is supoosed to increase security. Fine -
> but how can I turn it off for development builds?
>
> PIE also breaks PCH, and hence running the gcc testsuite.
The PCH problem has come up before, I responded to it in
<http://gcc.gnu.org/ml/gcc/2003-11/msg00242.html>. I didn't realise
this would apply to the GCC executable, too; for that, I suggest
adding -fno-pie to CFLAGS. (I don't believe PCH requires any library
function addresses to stay constant, so long as they don't move into
address space that PCH needs.)
--
- Geoffrey Keating <geoffk@geoffk.org>