Skip to content

Commit

Permalink
Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""
Browse files Browse the repository at this point in the history
This reverts commit 2aca33b.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305
  • Loading branch information
nico committed Apr 7, 2022
1 parent 1f6aa90 commit e22a60b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ 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)
option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on Linux" OFF)

# Manually handle default so we can change the meaning of a cached default.
set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING
Expand Down
6 changes: 0 additions & 6 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ Internal API Changes
Build System Changes
--------------------

* CMake ``-DCLANG_DEFAULT_PIE_ON_LINUX=ON`` is now the default. This is used by
linux-gnu systems to decide whether ``-fPIE -pie`` is the default (instead of
``-fno-pic -no-pie``). This matches GCC installations on many Linux distros.
Note: linux-android and linux-musl always default to ``-fPIE -pie``, ignoring
this variable. ``-DCLANG_DEFAULT_PIE_ON_LINUX`` may be removed in the future.

AST Matchers
------------

Expand Down
7 changes: 4 additions & 3 deletions clang/test/Driver/hip-fpie-option.hip
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// REQUIRES: clang-driver, amdgpu-registered-target, default-pie-on-linux
// REQUIRES: clang-driver, amdgpu-registered-target

// -fPIC and -fPIE only affects host relocation model.
// device compilation always uses PIC.

// RUN: %clang -### -target x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s

// RUN: %clang -### -target x86_64-unknown-linux-gnu \
// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-STATIC %s

// RUN: %clang -### -target x86_64-unknown-linux-gnu \
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
Expand All @@ -32,6 +32,7 @@
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s

// DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}}
// HOST-STATIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "static"}}
// HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}}
// HOST-PIC-NOT: "-pic-is-pie"
// HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from lldbsuite.test import decorators

decor = [decorators.skipUnlessHasCallSiteInfo,
decorators.skipIf(archs=['arm'],oslist=["linux"]),
decorators.skipIf(dwarf_version=['<', '4']),
decorators.skipIf(compiler="clang", compiler_version=['<', '11.0'])]
lldbinline.MakeInlineTest(__file__, globals(), name="UnambiguousTailCalls_V5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# XFAIL: target-arm && linux-gnu
# REQUIRES: system-linux, lzma, xz

# We want to keep the symbol "multiplyByThree" in the .dynamic section and not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ write_cmake_config("Config") {
output = "$target_gen_dir/config.h"
values = [
"BUG_REPORT_URL=https://github.com/llvm/llvm-project/issues/",
"CLANG_DEFAULT_PIE_ON_LINUX=1",
"CLANG_DEFAULT_PIE_ON_LINUX=",
"CLANG_DEFAULT_LINKER=",
"CLANG_DEFAULT_STD_C=",
"CLANG_DEFAULT_STD_CXX=",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define BUG_REPORT_URL "https://github.com/llvm/llvm-project/issues/"

/* Default to -fPIE and -pie on Linux. */
#define CLANG_DEFAULT_PIE_ON_LINUX 1
#define CLANG_DEFAULT_PIE_ON_LINUX 0

/* Default linker to use. */
#define CLANG_DEFAULT_LINKER ""
Expand Down

0 comments on commit e22a60b

Please sign in to comment.