aboutsummaryrefslogtreecommitdiff
path: root/Makefile.def
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2023-08-07 13:07:14 +0200
committerAlan Modra <amodra@gmail.com>2023-08-12 09:58:23 +0930
commited0a861b072c94b686c5078a7d323cd96e67a0c1 (patch)
tree49785b8a0cc5cf903df0281cfafc84743e7df5e3 /Makefile.def
parentd0aa61ca5cfc9b7d401fb5e494d977e3beb90275 (diff)
downloadgdb-ed0a861b072c94b686c5078a7d323cd96e67a0c1.zip
gdb-ed0a861b072c94b686c5078a7d323cd96e67a0c1.tar.gz
gdb-ed0a861b072c94b686c5078a7d323cd96e67a0c1.tar.bz2
configure, Darwin: Ensure overrides to host-pie are passed to gcc configure.
The latest versions of Darwin on the Aarch64 platform mandate PIE executables. On x86_64 it remains optional, but produces tool warnings after Darwin20, so we default to PIE executables there too. All (non-PowerPC) 64b Darwin platforms mandate PIC code and therefore force host_shared on (we issue a diagnostic if the user tries to configure them non-shared). However, this also means we cannot test the host_shared setting independently of the host_pie setting so that the logic for setting PICFLAG must be amended for Darwin. For Darwin versions required to have PIE executables, in the event that the user tries to configure these as --disable-host-pie, we issue a warning and override the setting. These versions must also switch host_pie on even if it is not given in the configure line. To cater for this we pass the current value of host_pie, as determined by top-level configure, to the GCC configure. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> * Makefile.def: Pass the enable-host-pie value to GCC configure. * configure.ac: Adjust the logic for shared and PIE host flags to ensure that PIE is passed for hosts that require it.
Diffstat (limited to 'Makefile.def')
-rw-r--r--Makefile.def3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.def b/Makefile.def
index de86056..705602c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -47,7 +47,8 @@ host_modules= { module= fixincludes; bootstrap=true;
host_modules= { module= flex; no_check_cross= true; };
host_modules= { module= gas; bootstrap=true; };
host_modules= { module= gcc; bootstrap=true;
- extra_make_flags="$(EXTRA_GCC_FLAGS)"; };
+ extra_make_flags="$(EXTRA_GCC_FLAGS)";
+ extra_configure_flags='@gcc_host_pie@'; };
host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
// Work around in-tree gmp configure bug with missing flex.
extra_configure_flags='--disable-shared LEX="touch lex.yy.c" @host_libs_picflag@';