configure: Implement --enable-host-pie
authorMarek Polacek <polacek@redhat.com>
Mon, 7 Aug 2023 11:07:12 +0000 (13:07 +0200)
committerAlan Modra <amodra@gmail.com>
Sat, 12 Aug 2023 00:28:23 +0000 (09:58 +0930)
commit60b42421e900f9bb186c306a657f41b88e422bcd
tree129840da06f088a9758bcb3b903fb476bdd5323c
parent947edb094ece682e6642c497a871749e8c12d5a5
configure: Implement --enable-host-pie

This patch implements the --enable-host-pie configure option which
makes the compiler executables PIE.  This can be used to enhance
protection against ROP attacks, and can be viewed as part of a wider
trend to harden binaries.

Co-Authored by: Iain Sandoe  <iain@sandoe.co.uk>

* configure.ac (--enable-host-pie): New check.  Set PICFLAG after this
check.

intl/
* configure.ac (--enable-host-shared): Don't set PICFLAG here.
(--enable-host-pie): New check.  Set PICFLAG after this check.

libdecnumber/
* configure.ac (--enable-host-shared): Don't set PICFLAG here.
(--enable-host-pie): New check.  Set PICFLAG after this check.

zlib/
* configure.ac (--enable-host-shared): Don't set PICFLAG here.
(--enable-host-pie): New check.  Set PICFLAG after this check.
configure.ac
intl/configure.ac
libdecnumber/configure.ac
zlib/configure.ac