summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2023-08-07 13:07:11 +0200
committerAlan Modra <amodra@gmail.com>2023-08-12 09:58:23 +0930
commit947edb094ece682e6642c497a871749e8c12d5a5 (patch)
tree6515d45379570342b144461b9c78c38d5bb6bd7b /configure.ac
parent6d80d4cf716e4d8d066cba03915cc794dde65110 (diff)
configure: When host-shared, pass --with-pic to in-tree lib configs.
If we are building PIC/PIE host executables, and we are building dependent libs (e.g. GMP) in-tree those libs need to be configured to generate PIC code. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> * Makefile.def: Pass host_libs_picflag to host dependent library configures. * configure.ac (host_libs_picflag): New configure variable set to '--with-pic' when building 'host_shared'.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e95a9ed116e..86d10a6af8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2006,8 +2006,18 @@ AC_ARG_ENABLE(host-shared,
x86_64-*-darwin* | aarch64-*-darwin*) host_shared=yes ;;
*) host_shared=no ;;
esac])
+
AC_SUBST(host_shared)
+# If we are building PIC/PIE host executables, and we are building dependent
+# libs (e.g. GMP) in-tree those libs need to be configured to generate PIC
+# code.
+host_libs_picflag=
+if test "$host_shared" = "yes";then
+host_libs_picflag='--with-pic'
+fi
+AC_SUBST(host_libs_picflag)
+
# By default, C and C++ are the only stage 1 languages.
stage1_languages=,c,