From 947edb094ece682e6642c497a871749e8c12d5a5 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Mon, 7 Aug 2023 13:07:11 +0200 Subject: 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 * 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'. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') 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, -- cgit v1.2.3