[clang] e22a60b - Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 07:07:15 PDT 2022


Author: Nico Weber
Date: 2022-04-07T10:07:07-04:00
New Revision: e22a60b1c898a760a73417fa225c2fbe0609a69f

URL: https://github.com/llvm/llvm-project/commit/e22a60b1c898a760a73417fa225c2fbe0609a69f
DIFF: https://github.com/llvm/llvm-project/commit/e22a60b1c898a760a73417fa225c2fbe0609a69f.diff

LOG: Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""

This reverts commit 2aca33baf15926afe2520a06b1427a9894226fd2.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305

Added: 
    

Modified: 
    clang/CMakeLists.txt
    clang/docs/ReleaseNotes.rst
    clang/test/Driver/hip-fpie-option.hip
    lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
    lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
    llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
    utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h

Removed: 
    


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 3a77e7b0c8d60..c0b1a20e8e8a0 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -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

diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a64d9d383d957..df6a7d7539ee6 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -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
 ------------
 

diff  --git a/clang/test/Driver/hip-fpie-option.hip b/clang/test/Driver/hip-fpie-option.hip
index ffd639dd5a6de..2e296a099dea5 100644
--- a/clang/test/Driver/hip-fpie-option.hip
+++ b/clang/test/Driver/hip-fpie-option.hip
@@ -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 \
@@ -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"}}

diff  --git a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
index cef500f0e7754..19aad2ab1ec32 100644
--- a/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
+++ b/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/TestUnambiguousTailCalls.py
@@ -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",

diff  --git a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
index a9650614674ea..f361ccb585783 100644
--- a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
+++ b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
@@ -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

diff  --git a/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn b/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
index 568cf345ad8b1..f4c51403db74d 100644
--- a/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
@@ -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=",

diff  --git a/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h b/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h
index e5e5dbc49bd4e..38c9756df262a 100644
--- a/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h
+++ b/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h
@@ -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 ""


        


More information about the cfe-commits mailing list