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

Re: [PATCH v3] xen: Add Darwin.mk for GNU toolchains


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 6 Feb 2026 13:34:23 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=citrix.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/iP7mUcdvII2+7Ig+jjc9vW2Lpo6q0aXzlOhYgh9G3Y=; b=qUTeBsTX0XVHE54g5QYDZ6VV+gGiqK4VP5w0qaafJOl1AOBgxNtpMuQIEd7A5My2tcs62ZPiv/GMaUaKUCJdD7bSIZoSR1xuokDcf/brtZLExb5w55seZ2B/Yaqw3DoGc8AAVmjQfWM4W0v4qS+TRPA/AUOYzTg8JtTLHc42neSQxBLF4H5w/iQFWrumn/IhnUeRUp2rp23bvgsulfSP3ILQBcPKcIUI5Xd4gjQRcbBDygsKcwlr8syZFTY6ITLJak3G67iTBFxvscLUyeTIuBR6jdQYzT6R1hq2h5e/P2CkPPLyk89mlKX62GaLuBQMfT0C9RRVlb0eAl/jurkUDA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/iP7mUcdvII2+7Ig+jjc9vW2Lpo6q0aXzlOhYgh9G3Y=; b=ZM7oHbif7MAlSZnTLhJtOH+u7xwh8btqSHjhlfthx+vCXaywBr6I1Xt8TG8dYavP+ogpgrcKXjSYMShjkFBaIouqNTA1wM0hkh3y1cq/A8lWTtSOXe15i8BSZTw8X/SWBjVR88u3iySH9jwhpGbHY9uqEt8cm+k523vmP+IF2E5ibcPnj8tckCjILqbROZ28q5bNYY9QikgT+MGtZvVCYxx/dJVUz0edCFj/U8ho8zX5Pw1JLUUfquX69FolW6h3Mym8Pa6TwjLLRsOkg+cbM9gsd2keX0rEubfILLaCgGSM5/XU9liAnwKP5Yo/E8yNwbtBEQoUfX3Tj5UaEdkixA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=IJQZkIDKDY6AihAnQjAGprUvIqnozLfiRfbdqKce72ncxnQ3e0T/+GtEeILW1MTJpF4wTTduHFNEH8r/Rs47QfUajio9P9eIoI1BQo88qgcaV2upHgcG0NRNQKT3NIM9nsnzSgdPSPrj4O8vwwsjWq/bOB62Q/5YUo/19kR5nUlKDyreIHKskAb0BNQCN3N7reT74Im7oO7hFVeRFXLnOz040itYrHlbyKeNanI1LG7uUhiW1cqp0SbZeOx5Y+eGGN0dUoyYhMOKWn7JGR73DMA14A6WgUS1lDTH6mqjq/TfWJwO1rNE1eZE5dDYhsDgOiG2LQaZoTfRYolw+pyKGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZgFLMd+2HBguI5YROR6rAoYpCIVz7LHBy/IdBP65RL3DYZrWlco9I0gg5IBu96HKj1KaETkb1BV5yZZ32eLQ8rTiOhWjSEufVgvqph3XXWNGaRIrcTclzh/T/XkS2stZhvNzRfLjc3pVcqV5umclCkje1WiCSHMOd8hZ7A7Nw12cSze6+m+ciL76xoipmz85ntXQmy7WThq7qBOIIvTBmwMJ4oORmBW80a82Wi1rtqh4tKnH7Jx1DHygmLZeZUBgb1SBwVoCuDLLPVO+dnJ5wez7PM99XjDnJvyekW8hzQdYSg5TW1UI0+VQbn6SjOKX4haTa4gb3aawWzhFT9oprQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 06 Feb 2026 13:35:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHcl0ETIV6m5wqgrECh60MWgPTuGLV1etQAgAAv7QCAAAFMgA==
  • Thread-topic: [PATCH v3] xen: Add Darwin.mk for GNU toolchains


> On 6 Feb 2026, at 14:29, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> 
> On Fri, Feb 06, 2026 at 11:38:02AM +0100, Jan Beulich wrote:
>> On 06.02.2026 09:17, Bertrand Marquis wrote:
>>> Xen does not provide a Darwin build configuration for selecting
>>> GNU tool definitions. On macOS, the tools we use are either GNU
>>> compatible or we only rely on features supported by Mac OS, so
>>> using the GNU tool definitions is appropriate.
>>> 
>>> Add config/Darwin.mk to include StdGNU.mk and force
>>> XEN_COMPILE_ARCH=Darwin, ensuring Darwin builds always follow
>>> the cross-compile path as we depend on the Linux ABI so compiling
>>> on Mac OS is always a cross compilation case.
>>> 
>>> An example of how to build the hypervisor for arm64 on Mac OS
>>> (tools cannot be build for now) using a compiler from brew:
>>> - brew install aarch64-elf-gcc
>>> - cd xen
>>> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc
>>> 
>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>>> ---
>>> Changes since v2:
>>> - Subject was "xen: Add macOS hypervisor build configuration"
>>> - Update Darwin.mk comments to more accurate versions (Jan)
>>> - Remove the build-on-macos help as we have no dependency on anything
>>>  coming from brew anymore and the toolchain can be retrieved by lots of
>>>  other solutions than brew on mac os. Switch to a simple doc in the
>>>  commit message instead
>> 
>> Did you see Roger's notice on Matrix about objcopy?
> 
> I think Bertrand considers objcopy to be part of the toolchain, hence
> "retrieving a toolchain" is meant to include objcopy (either the GNU,
> LLVM or elftoolchain one)

Sorry i only saw your message in matrix.

I checked and i installed both gcc and binutils in homebrew.

So i think the commit message needs modifying to stay:

brew install aarch64-elf-gcc aarch64-elf-binutils

to be fully complete.

> 
>>> --- /dev/null
>>> +++ b/config/Darwin.mk
>>> @@ -0,0 +1,7 @@
>>> +# Use GNU tool definitions as the tools we are using are either GNU 
>>> compatible
>>> +# or we only use features which are supported on Mac OS.
>>> +include $(XEN_ROOT)/config/StdGNU.mk
>>> +
>>> +# Xen uses Linux'es ABI so we are cross compiling on Mac OS.
>>> +# Force COMPILE_ARCH to a fake value to make sure it is always the case.
>>> +XEN_COMPILE_ARCH = Darwin
>> 
>> I first wondered why you say "fake", seeing the file is named Darwin.mk. But
>> in Config.mk's cross-compile check the build host OS doesn't even matter. So
>> yes, it needs faking here for the time being.
> 
> Hm, setting it to "Darwin" seems weird to me.  I understand the
> purpose of this is to force the user to set XEN_TARGET_ARCH
> explicitly.  I however wouldn't see it as fully uncorrect to not set
> this.  It will then execute `uname -m` and get `arm64` back for Apple
> silicon macs (which is kind of OK?).  Other I suggest we use a non-OSX
> specific value here, so that if required we could distinguish this
> case where the user is expected to provide XEN_COMPILE_ARCH.
> 
> Maybe XEN_COMPILE_ARCH = { unknown | undefined }?

I am ok to change this with either but maybe unsupported could be
a third choice?

Cheers
Bertrand

> 
> Thanks, Roger.



 


Rackspace

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