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

Re: [Xen-devel] [PATCH 01/12] xen: clang: Support correctly cross-compile



Hi,

On 4/19/19 7:47 PM, Stefano Stabellini wrote:
On Fri, 29 Mar 2019, Jan Beulich wrote:
On 29.03.19 at 10:41, <julien.grall@xxxxxxx> wrote:
On 28/03/2019 09:55, Jan Beulich wrote:
On 27.03.19 at 19:45, <julien.grall@xxxxxxx> wrote:
Clang uses "-target" option for cross-compilation.

--- 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:-=)

Is dropping dashes from the variable uniformly correct? If so,
could you please clarify in the commit message why that is?
The target option requires the following format:

<arch><sub>-<vendor>-<sys>-<abi>

In other places, we need the trailing dash as GNU tools are using the same
format as above with a dash to separate the tool name.

Oh, I'm sorry - I keep forgetting that the substitution form you
use only fiddles with trailing dashes. Of course I won't insist, but
I'd prefer the more obvious $(patsubst %-,%,$(CROSS_COMPILE))
to be used instead, despite realizing that it's meaningfully longer.

Either way to do variable manipulation is OK, but it would be good to
add Julien's explanation of the -target expected format in the commit
message. I don't have any other comments on this patch.

Not even regarding <b4405caf-6b06-6066-8f48-f35ba67bbdd2@xxxxxxx>?

Cheers,

--
Julien Grall

_______________________________________________
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®.