]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - Makefile.def
configure, Darwin: Ensure overrides to host-pie are passed to gcc configure.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 7 Aug 2023 11:07:14 +0000 (13:07 +0200)
committerAlan Modra <amodra@gmail.com>
Sat, 12 Aug 2023 00:28:23 +0000 (09:58 +0930)
commited0a861b072c94b686c5078a7d323cd96e67a0c1
tree49785b8a0cc5cf903df0281cfafc84743e7df5e3
parentd0aa61ca5cfc9b7d401fb5e494d977e3beb90275
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.
Makefile.def
configure.ac