Skip to content

Commit 2fd9c31

Browse files
committed
LLVM patch: don't pass -static when building executables
This is problematic when targeting *-linux-gnu* and *-macos-none because Zig doesn't provide a static libc for these, resulting in early configure errors. Just rely on the Zig compiler to infer the executable link mode from the link inputs instead.
1 parent 773262e commit 2fd9c31

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ For other versions, check the git tags of this repository.
2020
* all: Deleted unused files.
2121
* LLVM: Support .lib extension for static zstd.
2222
* LLVM: Portable handling of .def linker flag
23+
* LLVM: Don't pass -static when building executables.
2324
* Clang: Ignore the examples directory
2425
* Clang: Disable building of libclang-cpp.so.
2526
* LLD: Added additional include directory to Zig's libunwind.

llvm/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,6 @@ if(NOT LLVM_INDIVIDUAL_TEST_COVERAGE)
932932
endif()
933933

934934
if (LLVM_BUILD_STATIC)
935-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
936935
# Remove shared library suffixes from use in find_library
937936
foreach (shared_lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_IMPORT_LIBRARY_SUFFIX})
938937
list(FIND CMAKE_FIND_LIBRARY_SUFFIXES ${shared_lib_suffix} shared_lib_suffix_idx)

0 commit comments

Comments
 (0)