[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC 1/7] xen: clang: Support correctly cross-compile



On Wed, Nov 06, 2019 at 11:19:07AM +0200, Andrii Anisov wrote:
> From: Julien Grall <julien.grall@xxxxxxx>
> 
> Clang uses "-target" option for cross-compilation.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
> ---
>  config/StdGNU.mk | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/config/StdGNU.mk b/config/StdGNU.mk
> index 039274e..48c50b5 100644
> --- a/config/StdGNU.mk
> +++ b/config/StdGNU.mk
> @@ -1,8 +1,13 @@
>  AS         = $(CROSS_COMPILE)as
>  LD         = $(CROSS_COMPILE)ld
>  ifeq ($(clang),y)
> -CC         = $(CROSS_COMPILE)clang
> -CXX        = $(CROSS_COMPILE)clang++
> +ifneq ($(CROSS_COMPILE),)
> +CC         = clang -target $(CROSS_COMPILE:-=)
> +CXX        = clang++ -target $(CROSS_COMPILE:-=)
> +else
> +CC         = clang
> +CXX        = clang++
> +endif
>  LD_LTO     = $(CROSS_COMPILE)llvm-ld

Do you not need to fix llvm-ld too? I _think_ the relevant option is
-march.

Wei.

>  else
>  CC         = $(CROSS_COMPILE)gcc
> -- 
> 2.7.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.