configure: Allow host fragments to react to --enable-host-shared.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 7 Aug 2021 13:40:33 +0000 (14:40 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 18 Aug 2021 18:46:32 +0000 (19:46 +0100)
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 <iain@sandoe.co.uk>
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.

Makefile.in
Makefile.tpl
config/mh-darwin

index 3809d17..5c85fcc 100644 (file)
@@ -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
index bffd85b..9adf4f9 100644 (file)
@@ -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
index fb2bb5a..b72835a 100644 (file)
 # 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