* [Buildroot] [PATCH] package/llvm: set the path to llvm-config
@ 2019-01-16 21:39 Romain Naour
2019-01-16 23:54 ` Matthew Weber
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Romain Naour @ 2019-01-16 21:39 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
---
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(+)
diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
index f33ec11fbf..952f678eee 100644
--- a/package/llvm/llvm.mk
+++ b/package/llvm/llvm.mk
@@ -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
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: set the path to llvm-config
2019-01-16 21:39 [Buildroot] [PATCH] package/llvm: set the path to llvm-config Romain Naour
@ 2019-01-16 23:54 ` Matthew Weber
2019-01-17 8:55 ` Peter Korsgaard
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Matthew Weber @ 2019-01-16 23:54 UTC (permalink / raw)
To: buildroot
Romain,
On Wed, Jan 16, 2019 at 3:39 PM Romain Naour <romain.naour@smile.fr> wrote:
>
> 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.
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Tested-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
> 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 | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
> index f33ec11fbf..952f678eee 100644
> --- a/package/llvm/llvm.mk
> +++ b/package/llvm/llvm.mk
> @@ -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.
> +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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: set the path to llvm-config
2019-01-16 21:39 [Buildroot] [PATCH] package/llvm: set the path to llvm-config Romain Naour
2019-01-16 23:54 ` Matthew Weber
@ 2019-01-17 8:55 ` Peter Korsgaard
2019-01-17 20:53 ` Valentin Korenblit
2019-01-28 17:04 ` Peter Korsgaard
3 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2019-01-17 8:55 UTC (permalink / raw)
To: buildroot
>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> 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.
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: set the path to llvm-config
2019-01-16 21:39 [Buildroot] [PATCH] package/llvm: set the path to llvm-config Romain Naour
2019-01-16 23:54 ` Matthew Weber
2019-01-17 8:55 ` Peter Korsgaard
@ 2019-01-17 20:53 ` Valentin Korenblit
2019-01-28 17:04 ` Peter Korsgaard
3 siblings, 0 replies; 5+ messages in thread
From: Valentin Korenblit @ 2019-01-17 20:53 UTC (permalink / raw)
To: buildroot
Romain,
> 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.
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
> 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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: set the path to llvm-config
2019-01-16 21:39 [Buildroot] [PATCH] package/llvm: set the path to llvm-config Romain Naour
` (2 preceding siblings ...)
2019-01-17 20:53 ` Valentin Korenblit
@ 2019-01-28 17:04 ` Peter Korsgaard
3 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2019-01-28 17:04 UTC (permalink / raw)
To: buildroot
>>>>> "Romain" == Romain Naour <romain.naour@smile.fr> 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.
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Valentin Korenblit <valentinkorenblit@gmail.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
> 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.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-28 17:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 21:39 [Buildroot] [PATCH] package/llvm: set the path to llvm-config Romain Naour
2019-01-16 23:54 ` Matthew Weber
2019-01-17 8:55 ` Peter Korsgaard
2019-01-17 20:53 ` Valentin Korenblit
2019-01-28 17:04 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox