This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/69757] OpenBSD requires -fPIC to build.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]