Skip to content

Commit

Permalink
[Driver] Set CLANG_DEFAULT_PIE_ON_LINUX OFF
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pavel V Chupin committed Apr 12, 2022
1 parent 4e1bfe2 commit a9ac167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ set(PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL
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-gnu" ON)
# Turn this OFF downstream for compatibility reasons. GCC default is no-pie
# and many distros, e.g. RedHat has no-pie by default for GCC.
option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" OFF)

# Manually handle default so we can change the meaning of a cached default.
set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/clang-offload-wrapper-exe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// --- Create the wrapper object
// -host omitted - generate object for the host triple:
// RUN: clang-offload-wrapper -kind=sycl -target=TARGET -format=native -batch %t.batch -o %t.wrapped.bc
// RUN: llc --filetype=obj %t.wrapped.bc -o %t.wrapped.o --relocation-model=pic
// RUN: llc --filetype=obj %t.wrapped.bc -o %t.wrapped.o
// --- Compile & link the test with the wrapper
// RUN: %clangxx %t.wrapped.o %s -o %t.batch.exe -v
// --- Run and check ignoring white spaces
Expand Down

0 comments on commit a9ac167

Please sign in to comment.