summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-08-07 14:40:33 +0100
committerIain Sandoe <iain@sandoe.co.uk>2021-08-18 19:46:32 +0100
commitd39367fa82d95b646f0587a442156069100ee245 (patch)
tree274ba48f97736f574e06a1bddb288ce68d4fd51e /config
parentd2aa4e0b3b5053df8f5853d9ed29022ff0d3ecf6 (diff)
downloadgcc-d39367fa82d95b646f0587a442156069100ee245.tar.gz
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 <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.
Diffstat (limited to 'config')
-rw-r--r--config/mh-darwin8
1 files changed, 8 insertions, 0 deletions
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