This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81170] powerpc*-linux --enable-default-pie chooses incorrect startup files
- From: "amodra at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 08:26:00 +0000
- Subject: [Bug target/81170] powerpc*-linux --enable-default-pie chooses incorrect startup files
- Auto-submitted: auto-generated
- References: <bug-81170-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81170
--- Comment #4 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Tue Aug 29 08:25:17 2017
New Revision: 251404
URL: https://gcc.gnu.org/viewcvs?rev=251404&root=gcc&view=rev
Log:
PR driver/81523: Make -static override -pie
-static and -pie together behave differently depending on whether GCC is
configured with --enable-default-pie. On x86, "-static -pie" fails to
create executable when --enable-default-pie isn't used, but creates a
static executable when --enable-default-pie is used. This patch makes
-static completely override -pie to create a static executable, regardless
if --enable-default-pie is used to configure GCC.
PR target/81170
PR target/81295
PR driver/81523
* gcc.c (NO_PIE_SPEC): Delete.
(PIE_SPEC): Define as !no-pie/pie. Move static|shared|r
exclusion..
(LINK_PIE_SPEC): ..to here.
(LINK_COMMAND_SPEC): Support -no-pie.
* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Correct
chain of crtbegin*.o selection, update for PIE_SPEC changes and
format.
(GNU_USER_TARGET_ENDFILE_SPEC): Similarly.
* config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Similarly.
(ENDFILE_CRTEND_SPEC): Similarly.
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/gnu-user.h
branches/gcc-6-branch/gcc/config/sol2.h
branches/gcc-6-branch/gcc/gcc.c