In 2015-05, GCC added the configure option --enable-default-pie. When enabled,
- in the absence of -fno-pic/-fpie/-fpic (and their upper-case variants), -fPIE is the default.
- in the absence of -no-pie/-pie/-shared/-static/-static-pie, -pie is the default.
This has been adopted by all(?) major distros.
I think default PIE is the majority in the Linux world, but
--disable-default-pie users is not that uncommon because GCC upstream hasn't
switched the default yet (https://gcc.gnu.org/PR103398).
This patch add CLANG_DEFAULT_PIE_ON_LINUX which allows distros to use default PIE.
The option is justified as its adoption can be very high among Linux distros
to make Clang default match GCC, and is likely a future-new-default, at which
point we will remove CLANG_DEFAULT_PIE_ON_LINUX.
The lit feature default-pie-on-linux can be handy to exclude default PIE sensitive tests.
This option should really be called something like CLANG_DEFAULT_PIE_ON_LINUX or so. It should be explicit from the name that it only effects that toolchain and not all the various toolchains that support PIE.