diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2023-08-07 13:07:11 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-08-12 09:58:23 +0930 |
commit | 947edb094ece682e6642c497a871749e8c12d5a5 (patch) | |
tree | 6515d45379570342b144461b9c78c38d5bb6bd7b /configure.ac | |
parent | 6d80d4cf716e4d8d066cba03915cc794dde65110 (diff) | |
download | fsf-binutils-gdb-947edb094ece682e6642c497a871749e8c12d5a5.zip fsf-binutils-gdb-947edb094ece682e6642c497a871749e8c12d5a5.tar.gz fsf-binutils-gdb-947edb094ece682e6642c497a871749e8c12d5a5.tar.bz2 |
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.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index e95a9ed..86d10a6 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, |