[llvm-branch-commits] [lld] fc043d8 - Revert "[lld][CMake] Add LLD_DEFAULT_NOSTART_STOP_GC"

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jan 14 21:39:03 PST 2022


Author: Tom Stellard
Date: 2022-01-14T21:36:27-08:00
New Revision: fc043d8a256b1e431aa1297dffba154a7dd46b25

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

LOG: Revert "[lld][CMake] Add LLD_DEFAULT_NOSTART_STOP_GC"

This reverts commit 9d9efb1f67ff70e996b1cb7fa00e24b9121be226.

This commit caused #53185.

Added: 
    

Modified: 
    lld/CMakeLists.txt
    lld/ELF/Driver.cpp
    lld/test/CMakeLists.txt
    lld/test/ELF/gc-sections-metadata-startstop.s
    lld/test/ELF/gc-sections-startstop-hint.s
    lld/test/ELF/gc-sections-startstop.s
    lld/test/lit.cfg.py
    lld/test/lit.site.cfg.py.in

Removed: 
    


################################################################################
diff  --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 2e8b502a28559..2e99564f4e3e9 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -176,15 +176,6 @@ if (LLD_DEFAULT_LD_LLD_IS_MINGW)
   add_definitions("-DLLD_DEFAULT_LD_LLD_IS_MINGW=1")
 endif()
 
-option(LLD_DEFAULT_NOSTART_STOP_GC
-  "Default ld.lld to -z nostart-stop-gc. If ON, C identifier name sections are
-  forced retained by __start_/__stop_ references. This may increase output size
-  for many instrumentations, but is compatible with GNU ld newer than 2015-10"
-  ON)
-if (LLD_DEFAULT_NOSTART_STOP_GC)
-  add_definitions("-DLLD_DEFAULT_NOSTART_STOP_GC=1")
-endif()
-
 if (MSVC)
   add_definitions(-wd4530) # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.'
   add_definitions(-wd4062) # Suppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system header.

diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index a4187eeda15c8..594c20016827e 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1193,17 +1193,8 @@ static void readConfigs(opt::InputArgList &args) {
   config->zSeparate = getZSeparate(args);
   config->zShstk = hasZOption(args, "shstk");
   config->zStackSize = args::getZOptionValue(args, OPT_z, "stack-size", 0);
-#ifdef LLD_DEFAULT_NOSTART_STOP_GC
-  // -z start-stop-gc default matches GNU ld<2015-10 and ld64 section$start
-  // symbols and can decrease file size for many instrumentations.  However,
-  // some users need time to accommodate the -z nostart-stop-gc default, so this
-  // is added as a temporary workaround.
-  config->zStartStopGC =
-      getZFlag(args, "start-stop-gc", "nostart-stop-gc", false);
-#else
   config->zStartStopGC =
       getZFlag(args, "start-stop-gc", "nostart-stop-gc", true);
-#endif
   config->zStartStopVisibility = getZStartStopVisibility(args);
   config->zText = getZFlag(args, "text", "notext", true);
   config->zWxneeded = hasZOption(args, "wxneeded");

diff  --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index f0a5493c4c3f2..0c42427e006be 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -11,7 +11,6 @@ llvm_canonicalize_cmake_booleans(
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_LIBXML2
   LLD_DEFAULT_LD_LLD_IS_MINGW
-  LLD_DEFAULT_NOSTART_STOP_GC
   LLVM_HAVE_LIBXAR
   )
 

diff  --git a/lld/test/ELF/gc-sections-metadata-startstop.s b/lld/test/ELF/gc-sections-metadata-startstop.s
index d77de240957c1..76134525b4ce5 100644
--- a/lld/test/ELF/gc-sections-metadata-startstop.s
+++ b/lld/test/ELF/gc-sections-metadata-startstop.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# UNSUPPORTED: default-nostart-stop-gc
 # LINK_ORDER cnamed sections are not kept alive by the __start_* reference.
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o

diff  --git a/lld/test/ELF/gc-sections-startstop-hint.s b/lld/test/ELF/gc-sections-startstop-hint.s
index 4069d1cb4bcb5..33d088fa3af77 100644
--- a/lld/test/ELF/gc-sections-startstop-hint.s
+++ b/lld/test/ELF/gc-sections-startstop-hint.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# UNSUPPORTED: default-nostart-stop-gc
 ## Some projects may not work with GNU ld<2015-10 (ld.lld 13.0.0) --gc-sections behavior.
 ## Give a hint.
 

diff  --git a/lld/test/ELF/gc-sections-startstop.s b/lld/test/ELF/gc-sections-startstop.s
index 6f327a8c37dd2..569cd3cdd10f9 100644
--- a/lld/test/ELF/gc-sections-startstop.s
+++ b/lld/test/ELF/gc-sections-startstop.s
@@ -1,7 +1,6 @@
 ## Check that group members are retained or discarded as a unit.
 
 # REQUIRES: x86
-# UNSUPPORTED: default-nostart-stop-gc
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: ld.lld %t.o --gc-sections -o %t

diff  --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index c23a6467fc42f..225104243bf26 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -118,6 +118,3 @@
 # ELF tests expect the default target for ld.lld to be ELF.
 if config.ld_lld_default_mingw:
     config.excludes.append('ELF')
-
-if config.ld_lld_default_nostart_stop_gc:
-    config.available_features.add('default-nostart-stop-gc')

diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index 19be1a395fc88..f9f695b624340 100644
--- a/lld/test/lit.site.cfg.py.in
+++ b/lld/test/lit.site.cfg.py.in
@@ -19,7 +19,6 @@ config.have_libxar = @LLVM_HAVE_LIBXAR@
 config.have_libxml2 = @LLVM_ENABLE_LIBXML2@
 config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@
 config.ld_lld_default_mingw = @LLD_DEFAULT_LD_LLD_IS_MINGW@
-config.ld_lld_default_nostart_stop_gc = @LLD_DEFAULT_NOSTART_STOP_GC@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.


        


More information about the llvm-branch-commits mailing list