Skip to contentSkip to conversation

package/clang: link libclang against libLLVM.so

PATCH New Valentin Korenblit 2 participants 2 messages May 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/clang: link libclang against libLLVM.so

libclang.so is statically linking against all LLVM static libraries instead of linking dynamically against libLLVM.so.

This patch fixes this problem by setting LLVM_LINK_LLVM_DYLIB to ON.

---

Changes v1 -> v2

*Avoid patching libclang's CMakeLists.txt
*Use LLVM_LINK_LLVM_DYLIB=ON

 package/clang/clang.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/clang/clang.mk +4 -0
index 8d86c5edda..14d6441c9a 100644
@@ -85,5 +85,9 @@ define HOST_CLANG_INSTALL_CLANG_TBLGEN
 endef
 HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN
 
+# This option must be enabled to link libclang dynamically against libLLVM.so
+HOST_CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
+CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
+
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 1/1 package/clang: link libclang against libLLVM.so

Hello,

Quoted 7 lines · Valentin Korenblit

libclang.so is statically linking against all LLVM static libraries instead of linking dynamically against libLLVM.so.

This patch fixes this problem by setting LLVM_LINK_LLVM_DYLIB to ON.

---

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com