[Lldb-commits] [lldb] r278527 - Link LLDB only against libclang and libLLVM .a files to fix macOS build

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 12 10:01:20 PDT 2016


Author: tfiala
Date: Fri Aug 12 12:01:19 2016
New Revision: 278527

URL: http://llvm.org/viewvc/llvm-project?rev=278527&view=rev
Log:
Link LLDB only against libclang and libLLVM .a files to fix macOS build

The Xcode macOS build of LLDB is currently broken after
https://reviews.llvm.org/D23232 landed, see
http://lab.llvm.org:8080/green/job/lldb_build_test/20014/console,
because we’re trying to link against all .a files found in the
llvm-build/lib directory. Let’s be more specific in what we link
against. This patch applies a regexp to only use “libclang.*”,
“libLLVM.*” and not “libclang_rt.*” static archives.

Change by Kuba Mracek (formerly Kuba Brecka)

See review here:
https://reviews.llvm.org/D23444

Reviewers: tfiala, compnerd

Modified:
    lldb/trunk/scripts/Xcode/build-llvm.py

Modified: lldb/trunk/scripts/Xcode/build-llvm.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=278527&r1=278526&r2=278527&view=diff
==============================================================================
--- lldb/trunk/scripts/Xcode/build-llvm.py (original)
+++ lldb/trunk/scripts/Xcode/build-llvm.py Fri Aug 12 12:01:19 2016
@@ -5,6 +5,7 @@ import hashlib
 import fnmatch
 import os
 import platform
+import re
 import subprocess
 import sys
 
@@ -132,7 +133,9 @@ def CMAKE_ENVIRONMENT ():
 
 def collect_archives_in_path (path): 
     files = os.listdir(path)
-    return [os.path.join(path, file) for file in files if file.endswith(".a")]
+    # Only use libclang and libLLVM archives, and exclude libclang_rt
+    regexp = "^lib(clang[^_]|LLVM).*$"
+    return [os.path.join(path, file) for file in files if file.endswith(".a") and re.match(regexp, file)]
 
 def archive_list ():
     paths = library_paths()




More information about the lldb-commits mailing list