From 11c2a85db8849db1a5907e80d9966592248ef825 Mon Sep 17 00:00:00 2001 From: David Tenty Date: Thu, 24 Oct 2019 16:18:26 -0400 Subject: [PATCH] [NFC] Rename LLVM_NO_DEAD_STRIP Summary: The variable LLVM_NO_DEAD_STRIP is set in LLVM cmake files when building executables that might make use of plugins .The name of the variable does not convey the actual intended usage (i.e. for use with tools that have plugins), just what the eventual effect of setting in on some (i.e. not garbage collecting unused symbols). This patch renames it to LLVM_SUPPORT_PLUGINS to convey the intended usage, which will allow subsequent patches to add behavior to support that in different ways without confusion about whether it will do on, for example, non-gnu platforms. Reviewers: hubert.reinterpretcast, stevewan Reviewed By: stevewan Subscribers: cfe-commits, mgorny, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D69356 --- clang/tools/driver/CMakeLists.txt | 4 ++-- llvm/cmake/modules/AddLLVM.cmake | 4 ++-- llvm/cmake/modules/HandleLLVMOptions.cmake | 2 +- llvm/tools/bugpoint/CMakeLists.txt | 2 +- llvm/tools/llc/CMakeLists.txt | 2 +- llvm/tools/opt/CMakeLists.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt index 590d708..5a8f57e 100644 --- a/clang/tools/driver/CMakeLists.txt +++ b/clang/tools/driver/CMakeLists.txt @@ -20,9 +20,9 @@ set( LLVM_LINK_COMPONENTS option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON) # Support plugins. This must be before add_clang_executable as it reads -# LLVM_NO_DEAD_STRIP. +# LLVM_SUPPORT_PLUGINS. if(CLANG_PLUGIN_SUPPORT) - set(LLVM_NO_DEAD_STRIP 1) + set(LLVM_SUPPORT_PLUGINS 1) endif() if(NOT CLANG_BUILT_STANDALONE) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index b5f6124..41e72c7 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -228,7 +228,7 @@ function(add_link_opts target_name) # to enable. See https://sourceware.org/bugzilla/show_bug.cgi?id=17704. endif() - if(NOT LLVM_NO_DEAD_STRIP) + if(NOT LLVM_SUPPORT_PLUGINS) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # ld64's implementation of -dead_strip breaks tools that use plugins. set_property(TARGET ${target_name} APPEND_STRING PROPERTY @@ -245,7 +245,7 @@ function(add_link_opts target_name) set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--gc-sections") endif() - else() #LLVM_NO_DEAD_STRIP + else() #LLVM_SUPPORT_PLUGINS if(${CMAKE_SYSTEM_NAME} MATCHES "AIX") set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-bnogc") diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index a84aff1..75c2df9 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -772,7 +772,7 @@ endif() # Add flags for add_dead_strip(). # FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF? # But MinSizeRel seems to add that automatically, so maybe disable these -# flags instead if LLVM_NO_DEAD_STRIP is set. +# flags instead if LLVM_SUPPORT_PLUGINS is set. if(NOT CYGWIN AND NOT WIN32) if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") diff --git a/llvm/tools/bugpoint/CMakeLists.txt b/llvm/tools/bugpoint/CMakeLists.txt index 031f514..8b46869 100644 --- a/llvm/tools/bugpoint/CMakeLists.txt +++ b/llvm/tools/bugpoint/CMakeLists.txt @@ -22,7 +22,7 @@ set(LLVM_LINK_COMPONENTS ) # Support plugins. -set(LLVM_NO_DEAD_STRIP 1) +set(LLVM_SUPPORT_PLUGINS 1) add_llvm_tool(bugpoint BugDriver.cpp diff --git a/llvm/tools/llc/CMakeLists.txt b/llvm/tools/llc/CMakeLists.txt index 300efda..8435b9d 100644 --- a/llvm/tools/llc/CMakeLists.txt +++ b/llvm/tools/llc/CMakeLists.txt @@ -20,7 +20,7 @@ set(LLVM_LINK_COMPONENTS ) # Support plugins. -set(LLVM_NO_DEAD_STRIP 1) +set(LLVM_SUPPORT_PLUGINS 1) add_llvm_tool(llc llc.cpp diff --git a/llvm/tools/opt/CMakeLists.txt b/llvm/tools/opt/CMakeLists.txt index cb4ba5c..4f74a05 100644 --- a/llvm/tools/opt/CMakeLists.txt +++ b/llvm/tools/opt/CMakeLists.txt @@ -25,7 +25,7 @@ set(LLVM_LINK_COMPONENTS ) # Support plugins. -set(LLVM_NO_DEAD_STRIP 1) +set(LLVM_SUPPORT_PLUGINS 1) add_llvm_tool(opt AnalysisWrappers.cpp -- 2.7.4