From 1dc065b659cc2b45b750b3773cbf7331289bf9e9 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Fri, 12 Aug 2016 17:01:19 +0000 Subject: [PATCH] Link LLDB only against libclang and libLLVM .a files to fix macOS build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 llvm-svn: 278527 --- lldb/scripts/Xcode/build-llvm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/scripts/Xcode/build-llvm.py b/lldb/scripts/Xcode/build-llvm.py index b594a8c..e8d1b63 100755 --- a/lldb/scripts/Xcode/build-llvm.py +++ b/lldb/scripts/Xcode/build-llvm.py @@ -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() -- 2.7.4