[Buildroot] [PATCH 1/4] llvm: fix build of host-llvm

Romain Naour romain.naour at gmail.com
Sat Nov 3 14:15:30 UTC 2018


Hi Fabrice,

Le 03/11/2018 à 13:27, Fabrice Fontaine a écrit :
> If BR2_PACKAGE_LLVM_TARGET_ARCH is empty because llvm is not supported
> on target, build of the host-llvm will fail on "Unknown architecture".
> 
> This is an issue because host-llvm (and host-clang) can be needed on
> host. For example the libv4l package uses clang to build BPF (in-kernel
> bytecode machine) files.
> 
> To fix this, add a new "host" default value to
> BR2_PACKAGE_LLVM_TARGET_ARCH
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> ---
>  package/llvm/Config.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/llvm/Config.in b/package/llvm/Config.in
> index 83e94660eb..0e111f1b76 100644
> --- a/package/llvm/Config.in
> +++ b/package/llvm/Config.in
> @@ -10,6 +10,7 @@ config BR2_PACKAGE_LLVM_TARGET_ARCH
>  	default "AArch64" if BR2_aarch64
>  	default "ARM" if BR2_arm || BR2_armeb
>  	default "X86" if BR2_i386 || BR2_x86_64
> +	default "host"

I'm not sure this is the correct thing to do since BR2_PACKAGE_LLVM_TARGET_ARCH
will be used for the target variant.

"host" stand for "automatic detection"

Maybe you want to add "X86" along with LLVM_TARGETS_TO_BUILD for host-llvm ?

Something like:

HOST_LLVM_TARGETS_TO_BUILD = $(LLVM_TARGETS_TO_BUILD) X86

HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst
$(space),;,$(HOST_LLVM_TARGETS_TO_BUILD))"

Also your host must be an x86 or x86_64.

Best regards,
Romain

>  
>  config BR2_PACKAGE_LLVM
>  	bool "llvm"
> 




More information about the buildroot mailing list