Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
(With C++ exceptions, `clang++ --target=mips64{,el}-linux-gnu -fpie -pie
-fuse-ld=lld` has link errors (lld does not implement some strange R_MIPS_64
.eh_frame handling in GNU ld). However, sanitizer-x86_64-linux-qemu used this to
build ScudoUnitTests. Pined ScudoUnitTests to -no-pie.)
Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future.
Differential Revision: https://reviews.llvm.org/D120305
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index c0b1a20..3a77e7b 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -245,7 +245,7 @@
set(CLANG_SPAWN_CC1 OFF CACHE BOOL
"Whether clang should use a new process for the CC1 invocation")
-option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on Linux" OFF)
+option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON)
# Manually handle default so we can change the meaning of a cached default.
set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING