[PATCH] D124018: [compiler-rt] Use ld64 flag -lto_library instead of DYLD_LIBRARY_PATH

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 10:55:18 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf6b2ddbf381d: [compiler-rt] Use ld64 flag -lto_library instead of DYLD_LIBRARY_PATH (authored by thakis).
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124018/new/

https://reviews.llvm.org/D124018

Files:
  compiler-rt/test/lit.common.cfg.py
  compiler-rt/test/profile/lit.cfg.py
  compiler-rt/test/safestack/lit.cfg.py


Index: compiler-rt/test/safestack/lit.cfg.py
===================================================================
--- compiler-rt/test/safestack/lit.cfg.py
+++ compiler-rt/test/safestack/lit.cfg.py
@@ -16,7 +16,7 @@
 config.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") )
 
 if config.lto_supported:
-  config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=safe-stack '])))
+  config.substitutions.append((r"%clang_lto_safestack ", ' '.join([config.clang] + config.lto_flags + ['-fsanitize=safe-stack '])))
 
 if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD']:
    config.unsupported = True
Index: compiler-rt/test/profile/lit.cfg.py
===================================================================
--- compiler-rt/test/profile/lit.cfg.py
+++ compiler-rt/test/profile/lit.cfg.py
@@ -44,11 +44,9 @@
 
 def build_invocation(compile_flags, with_lto = False):
   lto_flags = []
-  lto_prefix = []
   if with_lto and config.lto_supported:
     lto_flags += config.lto_flags
-    lto_prefix += config.lto_launch
-  return " " + " ".join(lto_prefix + [config.clang] + lto_flags + compile_flags) + " "
+  return " " + " ".join([config.clang] + lto_flags + compile_flags) + " "
 
 def exclude_unsupported_files_for_aix(dirname):
    for filename in os.listdir(dirname):
Index: compiler-rt/test/lit.common.cfg.py
===================================================================
--- compiler-rt/test/lit.common.cfg.py
+++ compiler-rt/test/lit.common.cfg.py
@@ -520,8 +520,11 @@
   config.available_features.add("has_sancovcc")
   config.substitutions.append( ("%sancovcc ", sancovcc_path) )
 
+def liblto_path():
+  return os.path.join(config.llvm_shlib_dir, 'libLTO.dylib')
+
 def is_darwin_lto_supported():
-  return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib'))
+  return os.path.exists(liblto_path())
 
 def is_binutils_lto_supported():
   if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
@@ -543,8 +546,7 @@
 
 if config.host_os == 'Darwin' and is_darwin_lto_supported():
   config.lto_supported = True
-  config.lto_launch = ["env", "DYLD_LIBRARY_PATH=" + config.llvm_shlib_dir]
-  config.lto_flags = []
+  config.lto_flags = [ '-Wl,-lto_library,' + liblto_path() ]
 elif config.host_os in ['Linux', 'FreeBSD', 'NetBSD']:
   config.lto_supported = False
   if config.use_lld:
@@ -554,14 +556,12 @@
     config.lto_supported = True
 
   if config.lto_supported:
-    config.lto_launch = []
     if config.use_lld:
       config.lto_flags = ["-fuse-ld=lld"]
     else:
       config.lto_flags = ["-fuse-ld=gold"]
 elif config.host_os == 'Windows' and is_windows_lto_supported():
   config.lto_supported = True
-  config.lto_launch = []
   config.lto_flags = ["-fuse-ld=lld"]
 else:
   config.lto_supported = False
@@ -692,7 +692,6 @@
 extra_cflags = []
 
 if config.use_lto and config.lto_supported:
-  run_wrapper += config.lto_launch
   extra_cflags += config.lto_flags
 elif config.use_lto and (not config.lto_supported):
   config.unsupported = True


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124018.423676.patch
Type: text/x-patch
Size: 3129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220419/ff5f5f16/attachment.bin>


More information about the llvm-commits mailing list