aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-11-12 17:05:13 +0000
committerIain Sandoe <iain@sandoe.co.uk>2022-04-14 06:26:49 +0100
commit67d7ab011b87aad67ef5d3040366d78de3253457 (patch)
tree442fdbfe5b43b923fe932ee57755560fae4a16b2
parent6841e9fc63b260186f8c980c7e0534b6376b073f (diff)
downloadgcc-67d7ab011b87aad67ef5d3040366d78de3253457.zip
gcc-67d7ab011b87aad67ef5d3040366d78de3253457.tar.gz
gcc-67d7ab011b87aad67ef5d3040366d78de3253457.tar.bz2
configure, Darwin: Set appropriate defaults for host-shared.
Darwin x86_64 and aarch64 platforms are PIC (shared) by default, and user-space code must be built in this mode. The patch ensures that this is set correctly and applies a default when --enable-host-shared is not set. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> ChangeLog: * configure: Regenerate. * configure.ac: Ensure that PIC (shared) defaults are set correctly for Darwin. (cherry picked from commit a1d2b16202601e597fac1c0e6af6ee8cd09b52c0)
-rwxr-xr-xconfigure16
-rw-r--r--configure.ac15
2 files changed, 29 insertions, 2 deletions
diff --git a/configure b/configure
index 831a377..e218a19 100755
--- a/configure
+++ b/configure
@@ -8277,8 +8277,20 @@ fi
# Check whether --enable-host-shared was given.
if test "${enable_host_shared+set}" = set; then :
enableval=$enable_host_shared; host_shared=$enableval
+ case $target in
+ x86_64-*-darwin* | aarch64-*-darwin*)
+ if test x$host_shared != xyes ; then
+ # PIC is the default, and actually cannot be switched off.
+ echo configure.ac: warning: PIC code is required for the configured target, host-shared setting ignored. 1>&2
+ host_shared=yes
+ fi ;;
+ *) ;;
+ esac
else
- host_shared=no
+ case $target in
+ x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
+ *) host_shared=no ;;
+ esac
fi
@@ -9899,6 +9911,8 @@ done
+
+
# Generate default definitions for YACC, M4, LEX and other programs that run
# on the build machine. These are used if the Makefile can't locate these
# programs in objdir.
diff --git a/configure.ac b/configure.ac
index 74d9810..7e8e628 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1871,7 +1871,20 @@ AC_SUBST(extra_linker_plugin_flags)
AC_ARG_ENABLE(host-shared,
[AS_HELP_STRING([--enable-host-shared],
[build host code as shared libraries])],
-[host_shared=$enableval], [host_shared=no])
+[host_shared=$enableval
+ case $target in
+ x86_64-*-darwin* | aarch64-*-darwin*)
+ if test x$host_shared != xyes ; then
+ # PIC is the default, and actually cannot be switched off.
+ echo configure.ac: warning: PIC code is required for the configured target, host-shared setting ignored. 1>&2
+ host_shared=yes
+ fi ;;
+ *) ;;
+ esac],
+[case $target in
+ x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
+ *) host_shared=no ;;
+ esac])
AC_SUBST(host_shared)
# By default, C and C++ are the only stage 1 languages.