Skip to contentSkip to conversation

package/llvm: set the path to llvm-config

PATCH New Romain Naour 4 participants 5 messages Jan 16, 2019 – Jan 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/llvm: set the path to llvm-config

While building llvm for the target (x86_64), the build failded due to path poisoning (-I/usr/include/libxml2) while building NATIVE tools (i.e for the host). The llvm package try to build a tool for the host with the cross-compiler which doesn't work when the paranoid toolchain wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config build by host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target) fixes the path poisoining issue since llvm doesn't build the NATIVE variant.

Cc Valentin Korenblit <[email protected]>
Cc Matthew Weber <[email protected]>

---
Valentin, I'm not sure why we don't set LLVM_CONFIG_PATH in llvm.mk for the target variant? We provide it for clang and libclc, why not for llvm ?

---
 package/llvm/llvm.mk | 3 +++
 1 file changed, 3 insertions(+)
package/llvm/llvm.mk +3 -0
index f33ec11fbf..952f678eee 100644
@@ -57,6 +57,9 @@ endif
 # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
 
+# Use native llvm-config from host-llvm (needed for cross-compilation)
+LLVM_CONF_OPTS += -DLLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config
+
 # BUILD_SHARED_LIBS has a misleading name. It is in fact an option for
 # LLVM developers to build all LLVM libraries as separate shared libraries.
 # For normal use of LLVM, it is recommended to build a single
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/llvm: set the path to llvm-config

Romain,

Quoted 13 lines · Romain Naour

While building llvm for the target (x86_64), the build failded due to path poisoning (-I/usr/include/libxml2) while building NATIVE tools (i.e for the host). The llvm package try to build a tool for the host with the cross-compiler which doesn't work when the paranoid toolchain wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config build by host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target) fixes the path poisoining issue since llvm doesn't build the NATIVE variant.

Quoted 3 lines
Cc Valentin Korenblit <[email protected]>
Cc Matthew Weber <[email protected]>
Quoted 4 lines

---
Valentin, I'm not sure why we don't set LLVM_CONFIG_PATH in llvm.mk for the target variant? We provide it for clang and libclc, why not for llvm ?

I'm not sure.

package/llvm/llvm.mk endif · line 60

Quoted 13 lines
---
 package/llvm/llvm.mk | 3 +++
 1 file changed, 3 insertions(+)
package/llvm/llvm.mk +1 -0
index f33ec11fbf..952f678eee 100644
@@ -57,6 +57,9 @@ endif
 # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
 
+# Use native llvm-config from host-llvm (needed for cross-compilation)

The goal is not to use this as a compiler for applications but for building of the compiler-rt tools which have advanced fuzzing and address sanitizing debug/analysis features.

Quoted 8 lines
package/llvm/llvm.mk +2 -1
+LLVM_CONF_OPTS += -DLLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config
+
 # BUILD_SHARED_LIBS has a misleading name. It is in fact an option for
 # LLVM developers to build all LLVM libraries as separate shared libraries.
 # For normal use of LLVM, it is recommended to build a single
--

2.20.1

#2 lore raw

PATCH 1/1 package/llvm: set the path to llvm-config

In reply to Romain Naour
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

While building llvm for the target (x86_64), the build failded due to path poisoning (-I/usr/include/libxml2) while building NATIVE tools (i.e for the host). The llvm package try to build a tool for the host with the cross-compiler which doesn't work when the paranoid toolchain wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config build by host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target) fixes the path poisoining issue since llvm doesn't build the NATIVE variant.

Quoted 3 lines
Cc Valentin Korenblit <[email protected]>
Cc Matthew Weber <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 package/llvm: set the path to llvm-config

In reply to Romain Naour

Romain,

Quoted 12 lines

While building llvm for the target (x86_64), the build failded due to path poisoning (-I/usr/include/libxml2) while building NATIVE tools (i.e for the host). The llvm package try to build a tool for the host with the cross-compiler which doesn't work when the paranoid toolchain wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config build by host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target) fixes the path poisoining issue since llvm doesn't build the NATIVE variant.

Quoted 7 lines
Cc Valentin Korenblit <[email protected]>
Cc Matthew Weber <[email protected]>

---
Valentin, I'm not sure why we don't set LLVM_CONFIG_PATH in llvm.mk for the target variant? We provide it for clang and libclc, why not for llvm ?

It was not set because the only necessary tool to build target llvm was llvm-tblgen.

Valentin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190117/59eab66c/attachment.html>

#4 lore raw

PATCH 1/1 package/llvm: set the path to llvm-config

In reply to Romain Naour
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

While building llvm for the target (x86_64), the build failded due to path poisoning (-I/usr/include/libxml2) while building NATIVE tools (i.e for the host). The llvm package try to build a tool for the host with the cross-compiler which doesn't work when the paranoid toolchain wrapper (BR2_COMPILER_PARANOID_UNSAFE_PATH) is enabled.

We know that llvm (target) needs llvm-tablegen and llvm-config build by host-llvm, but only LLVM_TABLEGEN is provided by llvm.mk. Adding LLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config for llvm (target) fixes the path poisoining issue since llvm doesn't build the NATIVE variant.

Quoted 7 lines
Cc Valentin Korenblit <[email protected]>
Cc Matthew Weber <[email protected]>

---
Valentin, I'm not sure why we don't set LLVM_CONFIG_PATH in llvm.mk for the target variant? We provide it for clang and libclc, why not for llvm ?

Committed to 2018.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard