Skip to contentSkip to conversation

package/clang: fix host-clang binaries

PATCH New Valentin Korenblit 3 participants 3 messages May 30, 2018 – Jun 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/clang: fix host-clang binaries

This patch fixes the following error when trying to execute clang compiler (host-variant):

CommandLine Error: Option 'x86-use-base-pointer' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

The same happens for the other binaries, such as clang-format:

./clang-format
: CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

Clang binaries are tools, and given that DLLVM_LINK_LLVM_DYLIB is set, they are linked against libLLVM.so. The problem is that binaries are also linking against some LLVM static libraries, resulting in the error shown above. However, it is not the same case for libclang, which is also a tool but links only against libLLVM.so.

To fix this problem, add LLVM_DYLIB_COMPONENTS=all.

---
Currently there is no package in Buildroot that needs host-clang compiler. This error was found when trying to build libclc (WIP) after having applied:
http://lists.busybox.net/pipermail/buildroot/2018-May/221386.html

Changes v1 -> v2:

*Use LLVM_DYLIB_COMPONENTS=all instead of patching CMakeLists.txt of clang binaries.

 package/clang/clang.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/clang/clang.mk +4 -0
index ae0140c783..dc086c6eed 100644
@@ -89,5 +89,9 @@ HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN
 HOST_CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
 CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
 
+# Prevent clang binaries from linking against LLVM static libs
+HOST_CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all
+CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all
+
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 1/1 package/clang: fix host-clang binaries

Hi Valentin,

Quoted 18 lines · Valentin Korenblit

This patch fixes the following error when trying to execute clang compiler (host-variant):

CommandLine Error: Option 'x86-use-base-pointer' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

The same happens for the other binaries, such as clang-format:

./clang-format
: CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

Clang binaries are tools, and given that DLLVM_LINK_LLVM_DYLIB is set, they are linked against libLLVM.so. The problem is that binaries are also linking against some LLVM static libraries, resulting in the error shown above. However, it is not the same case for libclang, which is also a tool but links only against libLLVM.so.

Quoted 3 lines

To fix this problem, add LLVM_DYLIB_COMPONENTS=all.

Quoted 33 lines

---
Currently there is no package in Buildroot that needs host-clang compiler. This error was found when trying to build libclc (WIP) after having applied:
http://lists.busybox.net/pipermail/buildroot/2018-May/221386.html

Changes v1 -> v2:

*Use LLVM_DYLIB_COMPONENTS=all instead of patching CMakeLists.txt of clang binaries.

 package/clang/clang.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/clang/clang.mk +4 -1
index ae0140c783..dc086c6eed 100644
@@ -89,5 +89,9 @@ HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN
 HOST_CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
 CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON
 
+# Prevent clang binaries from linking against LLVM static libs
+HOST_CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all
+CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all
+
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
--

2.14.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#2 lore raw

PATCH v2 1/1 package/clang: fix host-clang binaries

In reply to Valentin Korenblit
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Valentin" == Valentin Korenblit <[email protected]> writes:

This patch fixes the following error when trying to execute clang compiler (host-variant):

CommandLine Error: Option 'x86-use-base-pointer' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

The same happens for the other binaries, such as clang-format:

./clang-format
: CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options

Clang binaries are tools, and given that DLLVM_LINK_LLVM_DYLIB is set, they are linked against libLLVM.so. The problem is that binaries are also linking against some LLVM static libraries, resulting in the error shown above. However, it is not the same case for libclang, which is also a tool but links only against libLLVM.so.

To fix this problem, add LLVM_DYLIB_COMPONENTS=all.

Quoted 8 lines

---
Currently there is no package in Buildroot that needs host-clang compiler. This error was found when trying to build libclc (WIP) after having applied:
http://lists.busybox.net/pipermail/buildroot/2018-May/221386.html

Changes v1 -> v2:

*Use LLVM_DYLIB_COMPONENTS=all instead of patching CMakeLists.txt of clang binaries.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard