Skip to content

Commit a9ac167

Browse files
author
Pavel V Chupin
committed
[Driver] Set CLANG_DEFAULT_PIE_ON_LINUX OFF
GCC in major distros (such as RedHat) stays on no-pie by default. Also GCC trunk is not going to change this default (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103398). Keeping this OFF for compatibility reasons.
1 parent 4e1bfe2 commit a9ac167

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ set(PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL
245245
set(CLANG_SPAWN_CC1 OFF CACHE BOOL
246246
"Whether clang should use a new process for the CC1 invocation")
247247

248-
option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON)
248+
# Turn this OFF downstream for compatibility reasons. GCC default is no-pie
249+
# and many distros, e.g. RedHat has no-pie by default for GCC.
250+
option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" OFF)
249251

250252
# Manually handle default so we can change the meaning of a cached default.
251253
set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING

clang/test/Driver/clang-offload-wrapper-exe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// --- Create the wrapper object
2626
// -host omitted - generate object for the host triple:
2727
// RUN: clang-offload-wrapper -kind=sycl -target=TARGET -format=native -batch %t.batch -o %t.wrapped.bc
28-
// RUN: llc --filetype=obj %t.wrapped.bc -o %t.wrapped.o --relocation-model=pic
28+
// RUN: llc --filetype=obj %t.wrapped.bc -o %t.wrapped.o
2929
// --- Compile & link the test with the wrapper
3030
// RUN: %clangxx %t.wrapped.o %s -o %t.batch.exe -v
3131
// --- Run and check ignoring white spaces

0 commit comments

Comments
 (0)