nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 47 lines 2.0 kB view raw
1diff --git a/build_llvm.py b/build_llvm.py 2index 1aa8631a..2304ce1f 100644 3--- a/build_llvm.py 4+++ b/build_llvm.py 5@@ -346,34 +346,24 @@ def build_warp_clang_for_arch(args, lib_name: str, arch: str) -> None: 6 7 clang_dll_path = os.path.join(build_path, f"bin/{lib_name}") 8 9- if args.build_llvm: 10- # obtain Clang and LLVM libraries from the local build 11- install_path = os.path.join(llvm_install_path, f"{args.mode}-{arch}") 12- libpath = os.path.join(install_path, "lib") 13- else: 14- # obtain Clang and LLVM libraries from packman 15- fetch_prebuilt_libraries(arch) 16- libpath = os.path.join(base_path, f"_build/host-deps/llvm-project/release-{arch}/lib") 17- 18- libs = [] 19- 20- for _, _, libraries in os.walk(libpath): 21- libs.extend(libraries) 22- break # just the top level contains library files 23+ libs = ["LLVM", "clang-cpp"] 24+ install_paths = ["@LLVM_LIB@", "@LIBCLANG_LIB@"] 25+ libpaths = [os.path.join(install_path, "lib") for install_path in install_paths] 26 27 if os.name == "nt": 28 libs.append("Version.lib") 29 libs.append("Ws2_32.lib") 30 libs.append("ntdll.lib") 31- libs.append(f'/LIBPATH:"{libpath}"') 32+ libs.extend(f'/LIBPATH:"{libpath}"' for libpath in libpaths) 33 else: 34- libs = [f"-l{lib[3:-2]}" for lib in libs if os.path.splitext(lib)[1] == ".a"] 35+ libs = [f"-l{lib}" for lib in libs] 36 if sys.platform == "darwin": 37 libs += libs # prevents unresolved symbols due to link order 38 else: 39 libs.insert(0, "-Wl,--start-group") 40 libs.append("-Wl,--end-group") 41- libs.append(f"-L{libpath}") 42+ libs.extend(f"-L{libpath}" for libpath in libpaths) 43+ libs.append("-lz") 44 libs.append("-lpthread") 45 libs.append("-ldl") 46 if sys.platform != "darwin": 47