Skip to content

Commit 08cc5ab

Browse files
alexrpoka4shi
authored andcommitted
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 4ba801f commit 08cc5ab

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For other versions, check the git tags of this repository.
3131
* all: Deleted unused files.
3232
* LLVM: Support .lib extension for static zstd.
3333
* LLVM: Portable handling of .def linker flag
34+
* LLVM: Don't pass -static when building executables.
3435
* Clang: Ignore the examples directory
3536
* Clang: Disable building of libclang-cpp.so.
3637
* LLD: Added additional include directory to Zig's libunwind.

llvm/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
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)