Skip to content

Commit 8bc1c56

Browse files
committed
Fix linked libs for linux
Link `pthread` and `z` on linux as well. Link `tinfo` if `/usr/lib/libtinfo.so` file exists. This is required because despite explicitly disabling these libs in LLVM build config they still somehow get pulled in on some systems. `pthread` and `z` are standard components of every linux distribution therefore linking them unconditionally is OK. `tinfo` may not exist on some systems therefore it's existence is checked first. With this patch finally builds produced on Archlinux no longer result in `DllNotFoundException`.
1 parent 7b9a40d commit 8bc1c56

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/LLVM.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,20 @@ function SetupLLVMLibs()
9494
defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" }
9595

9696
filter { "system:macosx" }
97-
links { "c++", "curses", "pthread", "z" }
98-
97+
links { "c++", "curses" }
98+
99+
filter { "system:macosx or system:linux" }
100+
links { "pthread", "z" }
101+
99102
filter { "action:vs*" }
100103
links { "version" }
101104

102105
filter {}
103106

107+
if os.ishost("linux") and os.isfile("/usr/lib/libtinfo.so") then
108+
links { "tinfo" }
109+
end
110+
104111
if LLVMDirPerConfiguration then
105112
filter { "configurations:Debug" }
106113
libdirs { path.join(LLVMRootDirDebug, "build/lib") }

0 commit comments

Comments
 (0)