public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9865] configure: Avoid unnecessary constraints on executables for $build. Date: Thu, 14 Apr 2022 05:24:28 +0000 (GMT) [thread overview] Message-ID: <20220414052428.177D63858D3C@sourceware.org> (raw) https://gcc.gnu.org/g:b26b67136688d9f75a95949201a74952328dc993 commit r11-9865-gb26b67136688d9f75a95949201a74952328dc993 Author: Iain Sandoe <iain@sandoe.co.uk> Date: Thu Aug 26 12:52:29 2021 +0100 configure: Avoid unnecessary constraints on executables for $build. The executables for GCC's c-family compilers must be built with no-PIE because they use PCH and the current model for this requires that the exe is always lauched at the same address. Since the other language compilers share code with the c-family this constraint is also applied to them. However, the executables that run on $build (generators, and parsers for md and def files) need not have any such constraint they do not consume PCH files. This change simplifies the configuration and Makefile content by removing the code enforcing no-PIE on these exes. This also fixes a bootstrap issue with some Darwin versions and clang as the bootstrap compiler, where -no-PIE causes the correct relocation model to be switched off leading to invalid user-space code. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * Makefile.in: Remove variables related to applying no-PIE to the exes on $build. * configure: Regenerate. * configure.ac: Remove configuration related to applying no-PIE to the exes on $build. (cherry picked from commit fb32372651882adee2d41052f1e59012e8bb32a7) Diff: --- gcc/Makefile.in | 7 ------- gcc/configure | 18 ++---------------- gcc/configure.ac | 10 ---------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8a5fb3fd99c..7bfd6ce653f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -798,13 +798,8 @@ DIR = ../gcc # Native compiler for the build machine and its switches. CC_FOR_BUILD = @CC_FOR_BUILD@ CXX_FOR_BUILD = @CXX_FOR_BUILD@ -NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ -NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ BUILD_CFLAGS= @BUILD_CFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE -BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ -BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) -BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) # Native compiler that we use. This may be C++ some day. COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) @@ -816,8 +811,6 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) # Native linker and preprocessor flags. For x-fragment overrides. BUILD_LDFLAGS=@BUILD_LDFLAGS@ -BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@ -BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG) BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) diff --git a/gcc/configure b/gcc/configure index ff355644722..7218b0c331a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -753,10 +753,6 @@ FGREP SED LIBTOOL collect2 -NO_PIE_FLAG_FOR_BUILD -NO_PIE_CFLAGS_FOR_BUILD -BUILD_NO_PIE_FLAG -BUILD_NO_PIE_CFLAGS STMP_FIXINC BUILD_LDFLAGS BUILD_CXXFLAGS @@ -13293,24 +13289,14 @@ BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' BUILD_LDFLAGS='$(LDFLAGS)' STMP_FIXINC=stmp-fixinc -BUILD_NO_PIE_CFLAGS='$(NO_PIE_CFLAGS)' -BUILD_NO_PIE_FLAG='$(NO_PIE_FLAG)' - # And these apply if build != host, or we are generating coverage data if test x$build != x$host || test "x$coverage_flags" != x then BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CXXFLAGS_FOR_BUILD)' BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' - - NO_PIE_CFLAGS_FOR_BUILD=${NO_PIE_CFLAGS_FOR_BUILD-${NO_PIE_CFLAGS}} - NO_PIE_FLAG_FOR_BUILD=${NO_PIE_FLAG_FOR_BUILD-${NO_PIE_FLAG}} - BUILD_NO_PIE_CFLAGS='$(NO_PIE_CFLAGS_FOR_BUILD)' - BUILD_NO_PIE_FLAG='$(NO_PIE_FLAG_FOR_BUILD)' fi - - # Expand extra_headers to include complete path. # This substitutes for lots of t-* files. extra_headers_list= @@ -19437,7 +19423,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19440 "configure" +#line 19426 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19543,7 +19529,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19546 "configure" +#line 19532 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 56554d057f7..49f043ed29b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2455,23 +2455,13 @@ BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' AC_SUBST(BUILD_CXXFLAGS) BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) -BUILD_NO_PIE_CFLAGS='$(NO_PIE_CFLAGS)' AC_SUBST(BUILD_NO_PIE_CFLAGS) -BUILD_NO_PIE_FLAG='$(NO_PIE_FLAG)' AC_SUBST(BUILD_NO_PIE_FLAG) - # And these apply if build != host, or we are generating coverage data if test x$build != x$host || test "x$coverage_flags" != x then BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CXXFLAGS_FOR_BUILD)' BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' - - NO_PIE_CFLAGS_FOR_BUILD=${NO_PIE_CFLAGS_FOR_BUILD-${NO_PIE_CFLAGS}} - NO_PIE_FLAG_FOR_BUILD=${NO_PIE_FLAG_FOR_BUILD-${NO_PIE_FLAG}} - BUILD_NO_PIE_CFLAGS='$(NO_PIE_CFLAGS_FOR_BUILD)' - BUILD_NO_PIE_FLAG='$(NO_PIE_FLAG_FOR_BUILD)' fi -AC_SUBST(NO_PIE_CFLAGS_FOR_BUILD) -AC_SUBST(NO_PIE_FLAG_FOR_BUILD) # Expand extra_headers to include complete path. # This substitutes for lots of t-* files.
reply other threads:[~2022-04-14 5:24 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220414052428.177D63858D3C@sourceware.org \ --to=iains@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).