[llvm] r351515 - mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 19:36:04 PST 2019


Author: nico
Date: Thu Jan 17 19:36:04 2019
New Revision: 351515

URL: http://llvm.org/viewvc/llvm-project?rev=351515&view=rev
Log:
mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF

llvm/tools sets LLVM_TOOL_LTO_BUILD to Off if LLVM_ENABLE_PIC=OFF, but that's
not visible in llvm/test.

r289662 added the llvm_tool_lto_build lit parameter, there the intent was to
use it with an explicit -DLLVM_TOOL_LTO_BUILD=OFF, which is visible globally.
On the review for that (D27739), a mild preference was expressed for using a
lit parameter over checking the existence of libLTO.dylib. Since that works
with the LLVM_ENABLE_PIC=OFF case too and since it matches what we do for the
gold plugin, switch to that approach.

Differential Revision: https://reviews.llvm.org/D56805

Modified:
    llvm/trunk/test/lit.cfg.py
    llvm/trunk/test/lit.site.cfg.py.in
    llvm/trunk/utils/gn/secondary/llvm/test/BUILD.gn

Modified: llvm/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg.py?rev=351515&r1=351514&r2=351515&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg.py (original)
+++ llvm/trunk/test/lit.cfg.py Thu Jan 17 19:36:04 2019
@@ -278,7 +278,10 @@ if have_ld_plugin_support():
 
 
 def have_ld64_plugin_support():
-    if not config.llvm_tool_lto_build or config.ld64_executable == '':
+    if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO' + config.llvm_shlib_ext)):
+        return False
+
+    if config.ld64_executable == '':
         return False
 
     ld_cmd = subprocess.Popen(

Modified: llvm/trunk/test/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.py.in?rev=351515&r1=351514&r2=351515&view=diff
==============================================================================
--- llvm/trunk/test/lit.site.cfg.py.in (original)
+++ llvm/trunk/test/lit.site.cfg.py.in Thu Jan 17 19:36:04 2019
@@ -15,7 +15,6 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.gold_executable = "@GOLD_EXECUTABLE@"
 config.ld64_executable = "@LD64_EXECUTABLE@"
-config.llvm_tool_lto_build = @LLVM_TOOL_LTO_BUILD@
 config.ocamlfind_executable = "@OCAMLFIND@"
 config.have_ocamlopt = @HAVE_OCAMLOPT@
 config.have_ocaml_ounit = @HAVE_OCAML_OUNIT@

Modified: llvm/trunk/utils/gn/secondary/llvm/test/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/test/BUILD.gn?rev=351515&r1=351514&r2=351515&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/test/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/llvm/test/BUILD.gn Thu Jan 17 19:36:04 2019
@@ -59,7 +59,6 @@ write_lit_config("lit_site_cfg") {
     "LLVM_LINK_LLVM_DYLIB=0",
     "LLVM_LIT_TOOLS_DIR=",  # Intentionally empty, matches cmake build.
     "LLVM_NATIVE_ARCH=$native_target",
-    "LLVM_TOOL_LTO_BUILD=1",  # The GN build always builds //llvm/tools/lto.
     "LLVM_USE_INTEL_JITEVENTS=0",
     "LLVM_USE_SANITIZER=",
     "PYTHON_EXECUTABLE=$python_path",




More information about the llvm-commits mailing list