From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id DD46E3853822; Wed, 18 Aug 2021 18:47:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD46E3853822 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3007] configure: Allow host fragments to react to --enable-host-shared. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: d2aa4e0b3b5053df8f5853d9ed29022ff0d3ecf6 X-Git-Newrev: d39367fa82d95b646f0587a442156069100ee245 Message-Id: <20210818184710.DD46E3853822@sourceware.org> Date: Wed, 18 Aug 2021 18:47:10 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 18:47:11 -0000 https://gcc.gnu.org/g:d39367fa82d95b646f0587a442156069100ee245 commit r12-3007-gd39367fa82d95b646f0587a442156069100ee245 Author: Iain Sandoe Date: Sat Aug 7 14:40:33 2021 +0100 configure: Allow host fragments to react to --enable-host-shared. This makes the host_shared value available to host makefile fragments. It uses this to adjust Darwin's mdynamic-no-pic in the case that shared host resources are required. Signed-off-by: Iain Sandoe ChangeLog: * Makefile.in: Regenerate. * Makefile.tpl: Make the state of the configured host shared flag available to makefile fragements. config/ChangeLog: * mh-darwin: Require a non-shared host configuration to enable mdynamic-no-pic where that is supported. Diff: --- Makefile.in | 3 +++ Makefile.tpl | 3 +++ config/mh-darwin | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/Makefile.in b/Makefile.in index 3809d177a99..5c85fcc5dd0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -109,6 +109,9 @@ RPATH_ENVVAR = @RPATH_ENVVAR@ # executables in PATH. GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@ +# If the build should make suitable code for shared host resources. +host_shared = @host_shared@ + # Build programs are put under this directory. BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring diff --git a/Makefile.tpl b/Makefile.tpl index bffd85bd68e..9adf4f94728 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -112,6 +112,9 @@ RPATH_ENVVAR = @RPATH_ENVVAR@ # executables in PATH. GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@ +# If the build should make suitable code for shared host resources. +host_shared = @host_shared@ + # Build programs are put under this directory. BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring diff --git a/config/mh-darwin b/config/mh-darwin index fb2bb5ad1d9..b72835ae953 100644 --- a/config/mh-darwin +++ b/config/mh-darwin @@ -11,9 +11,15 @@ # non-bootstrapped compiler), later stages will be built by GCC which supports # the required flags. +# We cannot use mdynamic-no-pic when building shared host resources. + +ifeq (${host_shared},no) BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC := $(shell \ $(CC) -S -xc /dev/null -o /dev/null -Werror -mno-dynamic-no-pic 2>/dev/null \ && echo true) +else +BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC := false +endif @if gcc-bootstrap ifeq (${BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC},true) @@ -21,8 +27,10 @@ STAGE1_CFLAGS += -mdynamic-no-pic else STAGE1_CFLAGS += -fPIC endif +ifeq (${host_shared},no) # Add -mdynamic-no-pic to later stages when we know it is built with GCC. BOOT_CFLAGS += -mdynamic-no-pic +endif @endif gcc-bootstrap @unless gcc-bootstrap