From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Bertrand Marquis <bertrand.marquis@arm.com>
Cc: xen-devel@lists.xenproject.org,
Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v4] xen: Add Darwin.mk for GNU toolchains
Date: Fri, 6 Feb 2026 18:25:22 +0100 [thread overview]
Message-ID: <aYYkAvGQygf2eNI7@Mac.lan> (raw)
In-Reply-To: <ff14a313c6ec9b487263e8f823c96533bb70fe1d.1770394705.git.bertrand.marquis@arm.com>
On Fri, Feb 06, 2026 at 05:21:44PM +0100, 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=unknown, 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 toolchain from brew:
> - brew install aarch64-elf-gcc aarch64-elf-binutils
> - cd xen
> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang
Instead of `cd xen` I would use `make xen ...`.
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
One comment below.
> ---
> Changes since v3:
> - set XEN_COMPILE_ARCH to unknown instead of Darwin
> - list binutils as a dependency to install in brew in commit message
>
> 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
> ---
> config/Darwin.mk | 7 +++++++
> 1 file changed, 7 insertions(+)
> create mode 100644 config/Darwin.mk
>
> diff --git a/config/Darwin.mk b/config/Darwin.mk
> new file mode 100644
> index 000000000000..176b27eac676
> --- /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.
Hm, is this actually fully true? What's the Linux ABI exactly here?
FreeBSD builds Xen natively, and it's not using the Linux ABI.
FreeBSD uses no specific -target to the compiler invocations, and the
linker emulation is set to elf_x86_64_fbsd.
I think the point here is that the toolchain must support building ELF
objects / images, because that's the binary format supported by Xen.
Whether it's Linux ELF or FreeBSD ELF doesn't make a difference for
standalone environments like the Xen kernel.
Thanks, Roger.
next prev parent reply other threads:[~2026-02-06 17:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 16:21 [PATCH v4] xen: Add Darwin.mk for GNU toolchains Bertrand Marquis
2026-02-06 17:25 ` Roger Pau Monné [this message]
2026-02-09 7:30 ` Bertrand Marquis
2026-02-09 9:11 ` Roger Pau Monné
2026-02-09 9:45 ` Jan Beulich
2026-02-09 10:02 ` Bertrand Marquis
2026-02-09 10:17 ` Jan Beulich
2026-02-09 10:36 ` Bertrand Marquis
2026-02-09 9:35 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYYkAvGQygf2eNI7@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.