This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/69757] OpenBSD requires -fPIC to build.
- From: "edd at theunixzoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Feb 2016 11:03:20 +0000
- Subject: [Bug bootstrap/69757] OpenBSD requires -fPIC to build.
- Auto-submitted: auto-generated
- References: <bug-69757-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69757
--- Comment #7 from Edd Barrett <edd at theunixzoo dot co.uk> ---
Just to follow this up. I did manage to get GCC bootstrapped by taking a subset
of Pascal Stumpf's patches from OpenBSD ports.
Effectively these patches enable PIE and PIC by default on OpenBSD, which seems
to be required on amd64 at least. I'm not 100% certain why OpenBSD requires
this, but I'm guessing that some code outside of gcc (a static library perhaps)
that was compiled with PIE is always included when C compiling programs, thus
forcing the requirement of PIE(?).
I'm attaching the patches I distilled out of Pascal's patch set.
I wonder if it would be a good idea to add a configure flag --enable-always-pie
(or some such), which builds a GCC which always emits PIE executables?
Cheers