* [PATCH v2] xen: Add macOS hypervisor build configuration
@ 2026-02-05 11:33 Bertrand Marquis
2026-02-05 12:29 ` Jan Beulich
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-05 11:33 UTC (permalink / raw)
To: xen-devel
Cc: Andrew Cooper, Anthony PERARD, Michal Orzel, Jan Beulich,
Julien Grall, Roger Pau Monné, Stefano Stabellini
Xen does not currently document how to build the hypervisor on macOS, and
there is no Darwin configuration for selecting a Homebrew-based GNU
toolchain. Native builds are not supported; the hypervisor must be
cross-built with a GNU toolchain and GNU make/sed.
Add a minimal Darwin.mk which selects the GNU tool definitions used by
the macOS workflow and point to the build guide for required tools and
setup. Document the Homebrew cross toolchain and GNU tools needed to
build the hypervisor on macOS.
Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
config/Darwin.mk | 6 ++++
docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 config/Darwin.mk
create mode 100644 docs/misc/build-on-macos.md
diff --git a/config/Darwin.mk b/config/Darwin.mk
new file mode 100644
index 000000000000..a4e3efa81842
--- /dev/null
+++ b/config/Darwin.mk
@@ -0,0 +1,6 @@
+# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
+# See docs/misc/build-on-macos.md for required tools and setup.
+include $(XEN_ROOT)/config/StdGNU.mk
+
+# We are always cross compiling so fake COMPILE_ARCH
+XEN_COMPILE_ARCH = Darwin
diff --git a/docs/misc/build-on-macos.md b/docs/misc/build-on-macos.md
new file mode 100644
index 000000000000..6b56cd8eccab
--- /dev/null
+++ b/docs/misc/build-on-macos.md
@@ -0,0 +1,66 @@
+# Building Xen Hypervisor on macOS
+
+This guide explains how to cross-compile the Xen hypervisor (xen
+subdirectory only) on macOS. This does **not** build the tools.
+
+## Prerequisites
+
+Install the following packages using Homebrew:
+
+```bash
+# Cross-compilation toolchain for ARM64
+brew install aarch64-elf-gcc
+
+# GNU tools (required for compatibility)
+brew install make gnu-sed
+```
+
+Homebrew installs under `/opt/homebrew` on Apple Silicon and `/usr/local` on
+Intel Macs. Adjust paths below accordingly.
+
+### Verification
+
+Verify your installation:
+
+```bash
+# Check cross compiler
+aarch64-elf-gcc --version
+
+# Check GNU make (adjust prefix if needed)
+/opt/homebrew/opt/make/libexec/gnubin/make --version
+
+# Check GNU sed (adjust prefix if needed)
+/opt/homebrew/opt/gnu-sed/libexec/gnubin/sed --version
+```
+
+## Building the Hypervisor
+
+Set up GNU tools in PATH and build:
+
+```bash
+# Set up GNU tools in PATH (adjust prefix if needed)
+export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:$PATH"
+
+# Build Xen hypervisor only (in-tree)
+cd xen/
+make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc
+
+# Optional: out-of-tree build directory
+# make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc O=$PWD/build-mac
+```
+
+## Architecture Support
+
+Currently supported architectures:
+
+- **ARM64** (`arm64`) - Default, uses `aarch64-elf-gcc`
+
+Other targets may work if the corresponding cross toolchain is installed,
+but this guide has only been tested on ARM64.
+
+## Limitations
+
+- **Hypervisor only**: This only builds the Xen hypervisor, not the tools
+- **Cross-compilation only**: Native builds are not supported
+- **macOS-specific**: Instructions optimized for macOS with Homebrew
+- **GNU tools required**: Native BSD tools are not compatible
--
2.52.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 11:33 [PATCH v2] xen: Add macOS hypervisor build configuration Bertrand Marquis
@ 2026-02-05 12:29 ` Jan Beulich
2026-02-05 15:30 ` Bertrand Marquis
2026-02-05 17:07 ` Roger Pau Monné
2026-02-08 2:36 ` Demi Marie Obenour
2 siblings, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2026-02-05 12:29 UTC (permalink / raw)
To: Bertrand Marquis, Roger Pau Monné
Cc: Andrew Cooper, Anthony PERARD, Michal Orzel, Julien Grall,
Stefano Stabellini, xen-devel
On 05.02.2026 12:33, Bertrand Marquis wrote:
> Xen does not currently document how to build the hypervisor on macOS, and
> there is no Darwin configuration for selecting a Homebrew-based GNU
> toolchain. Native builds are not supported; the hypervisor must be
> cross-built with a GNU toolchain and GNU make/sed.
>
> Add a minimal Darwin.mk which selects the GNU tool definitions used by
> the macOS workflow and point to the build guide for required tools and
> setup. Document the Homebrew cross toolchain and GNU tools needed to
> build the hypervisor on macOS.
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> config/Darwin.mk | 6 ++++
> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 72 insertions(+)
> create mode 100644 config/Darwin.mk
> create mode 100644 docs/misc/build-on-macos.md
I'm sorry, I should have paid attention already on the RFC, but: With all
other Pandoc files in this directory being named *.pandoc, do we really want
to have an outlier named *.md there?
> --- /dev/null
> +++ b/config/Darwin.mk
> @@ -0,0 +1,6 @@
> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
> +# See docs/misc/build-on-macos.md for required tools and setup.
> +include $(XEN_ROOT)/config/StdGNU.mk
Given Roger's consideration towards possibly using a more MacOS-native
build arrangement as an alternative, I'm actually not quite sure this should
then be the default mode here. Roger, what are your thoughts?
Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 12:29 ` Jan Beulich
@ 2026-02-05 15:30 ` Bertrand Marquis
2026-02-05 15:43 ` Jan Beulich
0 siblings, 1 reply; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-05 15:30 UTC (permalink / raw)
To: Jan Beulich
Cc: Roger Pau Monné, Andrew Cooper, Anthony PERARD, Michal Orzel,
Julien Grall, Stefano Stabellini, xen-devel@lists.xenproject.org
Hi,
With Roger's patch removing the need for GNU sed, it appears that
compilation is also working with Mac OS make.
> On 5 Feb 2026, at 13:29, Jan Beulich <jbeulich@suse.com> wrote:
>
> On 05.02.2026 12:33, Bertrand Marquis wrote:
>> Xen does not currently document how to build the hypervisor on macOS, and
>> there is no Darwin configuration for selecting a Homebrew-based GNU
>> toolchain. Native builds are not supported; the hypervisor must be
>> cross-built with a GNU toolchain and GNU make/sed.
>>
>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>> the macOS workflow and point to the build guide for required tools and
>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>> build the hypervisor on macOS.
>>
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> ---
>> config/Darwin.mk | 6 ++++
>> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
>> 2 files changed, 72 insertions(+)
>> create mode 100644 config/Darwin.mk
>> create mode 100644 docs/misc/build-on-macos.md
>
> I'm sorry, I should have paid attention already on the RFC, but: With all
> other Pandoc files in this directory being named *.pandoc, do we really want
> to have an outlier named *.md there?
Right but this might not be needed anymore as the only thing needed after Roger's
patch is only a toolchain so brew is one solution but there are a lot of others.
>
>> --- /dev/null
>> +++ b/config/Darwin.mk
>> @@ -0,0 +1,6 @@
>> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
>> +# See docs/misc/build-on-macos.md for required tools and setup.
>> +include $(XEN_ROOT)/config/StdGNU.mk
>
> Given Roger's consideration towards possibly using a more MacOS-native
> build arrangement as an alternative, I'm actually not quite sure this should
> then be the default mode here. Roger, what are your thoughts?
Even with Mac OS sed and make working, something is still needed here to
compile on Mac OS.
What would you suggest the default mode should be here ? Mac OS is not GNU
but everything used correspond to what is defined by StdGNU.mk.
I am only forcing cross compilation here to prevent using the host toolchain.
What do you think i should put there instead ?
I have been keeping that downstream for a while, it is kind of sad that people cannot
compile on mac os just because of this file missing.
Cheers
Bertrand
>
> Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 15:30 ` Bertrand Marquis
@ 2026-02-05 15:43 ` Jan Beulich
2026-02-05 15:58 ` Bertrand Marquis
0 siblings, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2026-02-05 15:43 UTC (permalink / raw)
To: Bertrand Marquis
Cc: Roger Pau Monné, Andrew Cooper, Anthony PERARD, Michal Orzel,
Julien Grall, Stefano Stabellini, xen-devel@lists.xenproject.org
On 05.02.2026 16:30, Bertrand Marquis wrote:
>> On 5 Feb 2026, at 13:29, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>> Xen does not currently document how to build the hypervisor on macOS, and
>>> there is no Darwin configuration for selecting a Homebrew-based GNU
>>> toolchain. Native builds are not supported; the hypervisor must be
>>> cross-built with a GNU toolchain and GNU make/sed.
>>>
>>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>>> the macOS workflow and point to the build guide for required tools and
>>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>>> build the hypervisor on macOS.
>>>
>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>> ---
>>> config/Darwin.mk | 6 ++++
>>> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
>>> 2 files changed, 72 insertions(+)
>>> create mode 100644 config/Darwin.mk
>>> create mode 100644 docs/misc/build-on-macos.md
>>
>> I'm sorry, I should have paid attention already on the RFC, but: With all
>> other Pandoc files in this directory being named *.pandoc, do we really want
>> to have an outlier named *.md there?
>
> Right but this might not be needed anymore as the only thing needed after Roger's
> patch is only a toolchain so brew is one solution but there are a lot of others.
Even better.
>>> --- /dev/null
>>> +++ b/config/Darwin.mk
>>> @@ -0,0 +1,6 @@
>>> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
>>> +# See docs/misc/build-on-macos.md for required tools and setup.
>>> +include $(XEN_ROOT)/config/StdGNU.mk
>>
>> Given Roger's consideration towards possibly using a more MacOS-native
>> build arrangement as an alternative, I'm actually not quite sure this should
>> then be the default mode here. Roger, what are your thoughts?
>
> Even with Mac OS sed and make working, something is still needed here to
> compile on Mac OS.
>
> What would you suggest the default mode should be here ? Mac OS is not GNU
> but everything used correspond to what is defined by StdGNU.mk.
>
> I am only forcing cross compilation here to prevent using the host toolchain.
That part is okay with me.
> What do you think i should put there instead ?
Using StdGNU.mk may still be okay, as long as the comment properly represents
the overall situation.
Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 15:43 ` Jan Beulich
@ 2026-02-05 15:58 ` Bertrand Marquis
2026-02-05 16:52 ` Jan Beulich
0 siblings, 1 reply; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-05 15:58 UTC (permalink / raw)
To: Jan Beulich
Cc: Roger Pau Monné, Andrew Cooper, Anthony PERARD, Michal Orzel,
Julien Grall, Stefano Stabellini, xen-devel@lists.xenproject.org
Hi Jan,
> On 5 Feb 2026, at 16:43, Jan Beulich <jbeulich@suse.com> wrote:
>
> On 05.02.2026 16:30, Bertrand Marquis wrote:
>>> On 5 Feb 2026, at 13:29, Jan Beulich <jbeulich@suse.com> wrote:
>>>
>>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>>> Xen does not currently document how to build the hypervisor on macOS, and
>>>> there is no Darwin configuration for selecting a Homebrew-based GNU
>>>> toolchain. Native builds are not supported; the hypervisor must be
>>>> cross-built with a GNU toolchain and GNU make/sed.
>>>>
>>>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>>>> the macOS workflow and point to the build guide for required tools and
>>>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>>>> build the hypervisor on macOS.
>>>>
>>>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>>> ---
>>>> config/Darwin.mk | 6 ++++
>>>> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
>>>> 2 files changed, 72 insertions(+)
>>>> create mode 100644 config/Darwin.mk
>>>> create mode 100644 docs/misc/build-on-macos.md
>>>
>>> I'm sorry, I should have paid attention already on the RFC, but: With all
>>> other Pandoc files in this directory being named *.pandoc, do we really want
>>> to have an outlier named *.md there?
>>
>> Right but this might not be needed anymore as the only thing needed after Roger's
>> patch is only a toolchain so brew is one solution but there are a lot of others.
>
> Even better.
>
>>>> --- /dev/null
>>>> +++ b/config/Darwin.mk
>>>> @@ -0,0 +1,6 @@
>>>> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
>>>> +# See docs/misc/build-on-macos.md for required tools and setup.
>>>> +include $(XEN_ROOT)/config/StdGNU.mk
>>>
>>> Given Roger's consideration towards possibly using a more MacOS-native
>>> build arrangement as an alternative, I'm actually not quite sure this should
>>> then be the default mode here. Roger, what are your thoughts?
>>
>> Even with Mac OS sed and make working, something is still needed here to
>> compile on Mac OS.
>>
>> What would you suggest the default mode should be here ? Mac OS is not GNU
>> but everything used correspond to what is defined by StdGNU.mk.
>>
>> I am only forcing cross compilation here to prevent using the host toolchain.
>
> That part is okay with me.
>
>> What do you think i should put there instead ?
>
> Using StdGNU.mk may still be okay, as long as the comment properly represents
> the overall situation.
Agree.
What do you think of the following:
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.
Bertrand
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 15:58 ` Bertrand Marquis
@ 2026-02-05 16:52 ` Jan Beulich
0 siblings, 0 replies; 14+ messages in thread
From: Jan Beulich @ 2026-02-05 16:52 UTC (permalink / raw)
To: Bertrand Marquis
Cc: Roger Pau Monné, Andrew Cooper, Anthony PERARD, Michal Orzel,
Julien Grall, Stefano Stabellini, xen-devel@lists.xenproject.org
On 05.02.2026 16:58, Bertrand Marquis wrote:
>> On 5 Feb 2026, at 16:43, Jan Beulich <jbeulich@suse.com> wrote:
>> On 05.02.2026 16:30, Bertrand Marquis wrote:
>>>> On 5 Feb 2026, at 13:29, Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 05.02.2026 12:33, Bertrand Marquis wrote:
>>>>> --- /dev/null
>>>>> +++ b/config/Darwin.mk
>>>>> @@ -0,0 +1,6 @@
>>>>> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
>>>>> +# See docs/misc/build-on-macos.md for required tools and setup.
>>>>> +include $(XEN_ROOT)/config/StdGNU.mk
>>>>
>>>> Given Roger's consideration towards possibly using a more MacOS-native
>>>> build arrangement as an alternative, I'm actually not quite sure this should
>>>> then be the default mode here. Roger, what are your thoughts?
>>>
>>> Even with Mac OS sed and make working, something is still needed here to
>>> compile on Mac OS.
>>>
>>> What would you suggest the default mode should be here ? Mac OS is not GNU
>>> but everything used correspond to what is defined by StdGNU.mk.
>>>
>>> I am only forcing cross compilation here to prevent using the host toolchain.
>>
>> That part is okay with me.
>>
>>> What do you think i should put there instead ?
>>
>> Using StdGNU.mk may still be okay, as long as the comment properly represents
>> the overall situation.
>
> Agree.
>
> What do you think of the following:
>
> 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.
Sounds good.
Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 11:33 [PATCH v2] xen: Add macOS hypervisor build configuration Bertrand Marquis
2026-02-05 12:29 ` Jan Beulich
@ 2026-02-05 17:07 ` Roger Pau Monné
2026-02-06 6:22 ` Jan Beulich
2026-02-06 7:32 ` Bertrand Marquis
2026-02-08 2:36 ` Demi Marie Obenour
2 siblings, 2 replies; 14+ messages in thread
From: Roger Pau Monné @ 2026-02-05 17:07 UTC (permalink / raw)
To: Bertrand Marquis
Cc: xen-devel, Andrew Cooper, Anthony PERARD, Michal Orzel,
Jan Beulich, Julien Grall, Stefano Stabellini
On Thu, Feb 05, 2026 at 12:33:54PM +0100, Bertrand Marquis wrote:
> Xen does not currently document how to build the hypervisor on macOS, and
> there is no Darwin configuration for selecting a Homebrew-based GNU
> toolchain. Native builds are not supported; the hypervisor must be
> cross-built with a GNU toolchain and GNU make/sed.
>
> Add a minimal Darwin.mk which selects the GNU tool definitions used by
> the macOS workflow and point to the build guide for required tools and
> setup. Document the Homebrew cross toolchain and GNU tools needed to
> build the hypervisor on macOS.
>
> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> config/Darwin.mk | 6 ++++
> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 72 insertions(+)
> create mode 100644 config/Darwin.mk
> create mode 100644 docs/misc/build-on-macos.md
>
> diff --git a/config/Darwin.mk b/config/Darwin.mk
> new file mode 100644
> index 000000000000..a4e3efa81842
> --- /dev/null
> +++ b/config/Darwin.mk
> @@ -0,0 +1,6 @@
> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
> +# See docs/misc/build-on-macos.md for required tools and setup.
> +include $(XEN_ROOT)/config/StdGNU.mk
> +
> +# We are always cross compiling so fake COMPILE_ARCH
> +XEN_COMPILE_ARCH = Darwin
> diff --git a/docs/misc/build-on-macos.md b/docs/misc/build-on-macos.md
> new file mode 100644
> index 000000000000..6b56cd8eccab
> --- /dev/null
> +++ b/docs/misc/build-on-macos.md
> @@ -0,0 +1,66 @@
> +# Building Xen Hypervisor on macOS
> +
> +This guide explains how to cross-compile the Xen hypervisor (xen
> +subdirectory only) on macOS. This does **not** build the tools.
More on this below, I'm not sure I would call it a "cross-compile".
Only when doing so from a x86 silicon Mac?
> +## Prerequisites
> +
> +Install the following packages using Homebrew:
> +
> +```bash
> +# Cross-compilation toolchain for ARM64
> +brew install aarch64-elf-gcc
> +
> +# GNU tools (required for compatibility)
> +brew install make gnu-sed
> +```
Installing make / sed are not strictly needed.
> +
> +Homebrew installs under `/opt/homebrew` on Apple Silicon and `/usr/local` on
> +Intel Macs. Adjust paths below accordingly.
> +
> +### Verification
> +
> +Verify your installation:
> +
> +```bash
> +# Check cross compiler
> +aarch64-elf-gcc --version
> +
> +# Check GNU make (adjust prefix if needed)
> +/opt/homebrew/opt/make/libexec/gnubin/make --version
> +
> +# Check GNU sed (adjust prefix if needed)
> +/opt/homebrew/opt/gnu-sed/libexec/gnubin/sed --version
> +```
Checking for make / sed can be removed.
> +
> +## Building the Hypervisor
> +
> +Set up GNU tools in PATH and build:
> +
> +```bash
> +# Set up GNU tools in PATH (adjust prefix if needed)
> +export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:$PATH"
Do you really need the gnubin? I think this was only for sed / make,
which is not really needed.
> +
> +# Build Xen hypervisor only (in-tree)
> +cd xen/
> +make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc
> +
> +# Optional: out-of-tree build directory
> +# make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc O=$PWD/build-mac
> +```
> +
> +## Architecture Support
> +
> +Currently supported architectures:
> +
> +- **ARM64** (`arm64`) - Default, uses `aarch64-elf-gcc`
It could possibly also use the llvm package from homebrew, but I can
add later if I get some time to test.
> +
> +Other targets may work if the corresponding cross toolchain is installed,
> +but this guide has only been tested on ARM64.
> +
> +## Limitations
> +
> +- **Hypervisor only**: This only builds the Xen hypervisor, not the tools
> +- **Cross-compilation only**: Native builds are not supported
Probably a more philosophical question, but is it really a cross
compilation if I'm building an arm64 Xen on Apple arm64 silicon?
Sure, it might use a different toolchain from native, but it's still a
"native" build from an architectural perspective?
> +- **macOS-specific**: Instructions optimized for macOS with Homebrew
> +- **GNU tools required**: Native BSD tools are not compatible
That last item can be removed.
Thanks, Roger.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 17:07 ` Roger Pau Monné
@ 2026-02-06 6:22 ` Jan Beulich
2026-02-06 7:35 ` Bertrand Marquis
2026-02-06 7:32 ` Bertrand Marquis
1 sibling, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2026-02-06 6:22 UTC (permalink / raw)
To: Roger Pau Monné
Cc: xen-devel, Andrew Cooper, Anthony PERARD, Michal Orzel,
Julien Grall, Stefano Stabellini, Bertrand Marquis
On 05.02.2026 18:07, Roger Pau Monné wrote:
> On Thu, Feb 05, 2026 at 12:33:54PM +0100, Bertrand Marquis wrote:
>> +## Limitations
>> +
>> +- **Hypervisor only**: This only builds the Xen hypervisor, not the tools
>> +- **Cross-compilation only**: Native builds are not supported
>
> Probably a more philosophical question, but is it really a cross
> compilation if I'm building an arm64 Xen on Apple arm64 silicon?
>
> Sure, it might use a different toolchain from native, but it's still a
> "native" build from an architectural perspective?
"Cross" aiui covers both OS (i.e. ABI) and hardware. Building x86 Linux
binaries on e.g. Windows is "cross", too. (Strictly speaking it's the
target triplet that is commonly used in at least GNU - if any part
differs, it's "cross". It just so happens that Xen uses Linux'es ABI,
and hence its building is native on identical-arch Linux.)
Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 17:07 ` Roger Pau Monné
2026-02-06 6:22 ` Jan Beulich
@ 2026-02-06 7:32 ` Bertrand Marquis
1 sibling, 0 replies; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-06 7:32 UTC (permalink / raw)
To: Roger Pau Monné
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Anthony PERARD,
Michal Orzel, Jan Beulich, Julien Grall, Stefano Stabellini
Hi Roger,
> On 5 Feb 2026, at 18:07, Roger Pau Monné <roger.pau@citrix.com> wrote:
>
> On Thu, Feb 05, 2026 at 12:33:54PM +0100, Bertrand Marquis wrote:
>> Xen does not currently document how to build the hypervisor on macOS, and
>> there is no Darwin configuration for selecting a Homebrew-based GNU
>> toolchain. Native builds are not supported; the hypervisor must be
>> cross-built with a GNU toolchain and GNU make/sed.
>>
>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>> the macOS workflow and point to the build guide for required tools and
>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>> build the hypervisor on macOS.
>>
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> ---
>> config/Darwin.mk | 6 ++++
>> docs/misc/build-on-macos.md | 66 +++++++++++++++++++++++++++++++++++++
>> 2 files changed, 72 insertions(+)
>> create mode 100644 config/Darwin.mk
>> create mode 100644 docs/misc/build-on-macos.md
>>
>> diff --git a/config/Darwin.mk b/config/Darwin.mk
>> new file mode 100644
>> index 000000000000..a4e3efa81842
>> --- /dev/null
>> +++ b/config/Darwin.mk
>> @@ -0,0 +1,6 @@
>> +# Use GNU tool definitions; the macOS workflow relies on Homebrew GNU tools.
>> +# See docs/misc/build-on-macos.md for required tools and setup.
>> +include $(XEN_ROOT)/config/StdGNU.mk
>> +
>> +# We are always cross compiling so fake COMPILE_ARCH
>> +XEN_COMPILE_ARCH = Darwin
>> diff --git a/docs/misc/build-on-macos.md b/docs/misc/build-on-macos.md
>> new file mode 100644
>> index 000000000000..6b56cd8eccab
>> --- /dev/null
>> +++ b/docs/misc/build-on-macos.md
>> @@ -0,0 +1,66 @@
>> +# Building Xen Hypervisor on macOS
>> +
>> +This guide explains how to cross-compile the Xen hypervisor (xen
>> +subdirectory only) on macOS. This does **not** build the tools.
>
> More on this below, I'm not sure I would call it a "cross-compile".
> Only when doing so from a x86 silicon Mac?
As Jan mentioned we are not building on Linux so it can be considered
cross compiling.
>
>> +## Prerequisites
>> +
>> +Install the following packages using Homebrew:
>> +
>> +```bash
>> +# Cross-compilation toolchain for ARM64
>> +brew install aarch64-elf-gcc
>> +
>> +# GNU tools (required for compatibility)
>> +brew install make gnu-sed
>> +```
>
> Installing make / sed are not strictly needed.
Ack
>
>> +
>> +Homebrew installs under `/opt/homebrew` on Apple Silicon and `/usr/local` on
>> +Intel Macs. Adjust paths below accordingly.
>> +
>> +### Verification
>> +
>> +Verify your installation:
>> +
>> +```bash
>> +# Check cross compiler
>> +aarch64-elf-gcc --version
>> +
>> +# Check GNU make (adjust prefix if needed)
>> +/opt/homebrew/opt/make/libexec/gnubin/make --version
>> +
>> +# Check GNU sed (adjust prefix if needed)
>> +/opt/homebrew/opt/gnu-sed/libexec/gnubin/sed --version
>> +```
>
> Checking for make / sed can be removed.
Ack
>
>> +
>> +## Building the Hypervisor
>> +
>> +Set up GNU tools in PATH and build:
>> +
>> +```bash
>> +# Set up GNU tools in PATH (adjust prefix if needed)
>> +export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:$PATH"
>
> Do you really need the gnubin? I think this was only for sed / make,
> which is not really needed.
I do not need anything anymore, just the compiler ...
>
>> +
>> +# Build Xen hypervisor only (in-tree)
>> +cd xen/
>> +make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc
>> +
>> +# Optional: out-of-tree build directory
>> +# make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=gcc O=$PWD/build-mac
>> +```
>> +
>> +## Architecture Support
>> +
>> +Currently supported architectures:
>> +
>> +- **ARM64** (`arm64`) - Default, uses `aarch64-elf-gcc`
>
> It could possibly also use the llvm package from homebrew, but I can
> add later if I get some time to test.
yes ..
>
>> +
>> +Other targets may work if the corresponding cross toolchain is installed,
>> +but this guide has only been tested on ARM64.
>> +
>> +## Limitations
>> +
>> +- **Hypervisor only**: This only builds the Xen hypervisor, not the tools
>> +- **Cross-compilation only**: Native builds are not supported
>
> Probably a more philosophical question, but is it really a cross
> compilation if I'm building an arm64 Xen on Apple arm64 silicon?
>
> Sure, it might use a different toolchain from native, but it's still a
> "native" build from an architectural perspective?
>
>> +- **macOS-specific**: Instructions optimized for macOS with Homebrew
>> +- **GNU tools required**: Native BSD tools are not compatible
>
> That last item can be removed.
At the end almost everything can be removed, the only "mac os" specific
instruction would be to install gcc through homebrew but there are other
solutions (cross-tools, llvm, downloading a pre compiled gcc, compiling
it yourself, ....you name it) so what would only remain here would be
instructions on how to compile the hypervisor which is not mac os specific.
So i will remove that file and just push a small patch adding Darwin.mk
with an updated comment.
Cheers
Bertrand
>
> Thanks, Roger.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-06 6:22 ` Jan Beulich
@ 2026-02-06 7:35 ` Bertrand Marquis
0 siblings, 0 replies; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-06 7:35 UTC (permalink / raw)
To: Jan Beulich
Cc: Roger Pau Monné, xen-devel@lists.xenproject.org,
Andrew Cooper, Anthony PERARD, Michal Orzel, Julien Grall,
Stefano Stabellini
> On 6 Feb 2026, at 07:22, Jan Beulich <jbeulich@suse.com> wrote:
>
> On 05.02.2026 18:07, Roger Pau Monné wrote:
>> On Thu, Feb 05, 2026 at 12:33:54PM +0100, Bertrand Marquis wrote:
>>> +## Limitations
>>> +
>>> +- **Hypervisor only**: This only builds the Xen hypervisor, not the tools
>>> +- **Cross-compilation only**: Native builds are not supported
>>
>> Probably a more philosophical question, but is it really a cross
>> compilation if I'm building an arm64 Xen on Apple arm64 silicon?
>>
>> Sure, it might use a different toolchain from native, but it's still a
>> "native" build from an architectural perspective?
>
> "Cross" aiui covers both OS (i.e. ABI) and hardware. Building x86 Linux
> binaries on e.g. Windows is "cross", too. (Strictly speaking it's the
> target triplet that is commonly used in at least GNU - if any part
> differs, it's "cross". It just so happens that Xen uses Linux'es ABI,
> and hence its building is native on identical-arch Linux.)
Agree, i will put a small comment on top of the line in darwin.mk
spelling it out:
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.
Bertrand
>
> Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-05 11:33 [PATCH v2] xen: Add macOS hypervisor build configuration Bertrand Marquis
2026-02-05 12:29 ` Jan Beulich
2026-02-05 17:07 ` Roger Pau Monné
@ 2026-02-08 2:36 ` Demi Marie Obenour
2026-02-09 7:26 ` Bertrand Marquis
2 siblings, 1 reply; 14+ messages in thread
From: Demi Marie Obenour @ 2026-02-08 2:36 UTC (permalink / raw)
To: Bertrand Marquis, xen-devel
Cc: Andrew Cooper, Anthony PERARD, Michal Orzel, Jan Beulich,
Julien Grall, Roger Pau Monné, Stefano Stabellini
[-- Attachment #1.1.1: Type: text/plain, Size: 645 bytes --]
On 2/5/26 06:33, Bertrand Marquis wrote:
> Xen does not currently document how to build the hypervisor on macOS, and
> there is no Darwin configuration for selecting a Homebrew-based GNU
> toolchain. Native builds are not supported; the hypervisor must be
> cross-built with a GNU toolchain and GNU make/sed.
>
> Add a minimal Darwin.mk which selects the GNU tool definitions used by
> the macOS workflow and point to the build guide for required tools and
> setup. Document the Homebrew cross toolchain and GNU tools needed to
> build the hypervisor on macOS.
What is the use-case?
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-08 2:36 ` Demi Marie Obenour
@ 2026-02-09 7:26 ` Bertrand Marquis
2026-02-09 7:28 ` Demi Marie Obenour
0 siblings, 1 reply; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-09 7:26 UTC (permalink / raw)
To: Demi Marie Obenour
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Anthony PERARD,
Michal Orzel, Jan Beulich, Julien Grall, Roger Pau Monné,
Stefano Stabellini
Hi Demi,
> On 8 Feb 2026, at 03:36, Demi Marie Obenour <demiobenour@gmail.com> wrote:
>
> On 2/5/26 06:33, Bertrand Marquis wrote:
>> Xen does not currently document how to build the hypervisor on macOS, and
>> there is no Darwin configuration for selecting a Homebrew-based GNU
>> toolchain. Native builds are not supported; the hypervisor must be
>> cross-built with a GNU toolchain and GNU make/sed.
>>
>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>> the macOS workflow and point to the build guide for required tools and
>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>> build the hypervisor on macOS.
> What is the use-case?
My main use case is development and testing on MacOS.
I can do a lot of stuff by only recompiling and testing the hypervisor without
changing the rest of my test environment and being able to do it directly
on my mac is making things a lot faster and simpler.
I have been using this for a long time and someone asked me some weeks
ago if that was possible so i figured it would be a good idea to share.
Cheers
Bertrand
> --
> Sincerely,
> Demi Marie Obenour (she/her/hers)<OpenPGP_0xB288B55FFF9C22C1.asc>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-09 7:26 ` Bertrand Marquis
@ 2026-02-09 7:28 ` Demi Marie Obenour
2026-02-09 7:32 ` Bertrand Marquis
0 siblings, 1 reply; 14+ messages in thread
From: Demi Marie Obenour @ 2026-02-09 7:28 UTC (permalink / raw)
To: Bertrand Marquis
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Anthony PERARD,
Michal Orzel, Jan Beulich, Julien Grall, Roger Pau Monné,
Stefano Stabellini
[-- Attachment #1.1.1: Type: text/plain, Size: 1299 bytes --]
On 2/9/26 02:26, Bertrand Marquis wrote:
> Hi Demi,
>
>> On 8 Feb 2026, at 03:36, Demi Marie Obenour <demiobenour@gmail.com> wrote:
>>
>> On 2/5/26 06:33, Bertrand Marquis wrote:
>>> Xen does not currently document how to build the hypervisor on macOS, and
>>> there is no Darwin configuration for selecting a Homebrew-based GNU
>>> toolchain. Native builds are not supported; the hypervisor must be
>>> cross-built with a GNU toolchain and GNU make/sed.
>>>
>>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>>> the macOS workflow and point to the build guide for required tools and
>>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>>> build the hypervisor on macOS.
>> What is the use-case?
>
> My main use case is development and testing on MacOS.
> I can do a lot of stuff by only recompiling and testing the hypervisor without
> changing the rest of my test environment and being able to do it directly
> on my mac is making things a lot faster and simpler.
>
> I have been using this for a long time and someone asked me some weeks
> ago if that was possible so i figured it would be a good idea to share.
>
> Cheers
> Bertrand
How are you testing? QEMU TCG?
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] xen: Add macOS hypervisor build configuration
2026-02-09 7:28 ` Demi Marie Obenour
@ 2026-02-09 7:32 ` Bertrand Marquis
0 siblings, 0 replies; 14+ messages in thread
From: Bertrand Marquis @ 2026-02-09 7:32 UTC (permalink / raw)
To: Demi Marie Obenour
Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Anthony PERARD,
Michal Orzel, Jan Beulich, Julien Grall, Roger Pau Monné,
Stefano Stabellini
Hi Demi,
> On 9 Feb 2026, at 08:28, Demi Marie Obenour <demiobenour@gmail.com> wrote:
>
> On 2/9/26 02:26, Bertrand Marquis wrote:
>> Hi Demi,
>>
>>> On 8 Feb 2026, at 03:36, Demi Marie Obenour <demiobenour@gmail.com> wrote:
>>>
>>> On 2/5/26 06:33, Bertrand Marquis wrote:
>>>> Xen does not currently document how to build the hypervisor on macOS, and
>>>> there is no Darwin configuration for selecting a Homebrew-based GNU
>>>> toolchain. Native builds are not supported; the hypervisor must be
>>>> cross-built with a GNU toolchain and GNU make/sed.
>>>>
>>>> Add a minimal Darwin.mk which selects the GNU tool definitions used by
>>>> the macOS workflow and point to the build guide for required tools and
>>>> setup. Document the Homebrew cross toolchain and GNU tools needed to
>>>> build the hypervisor on macOS.
>>> What is the use-case?
>>
>> My main use case is development and testing on MacOS.
>> I can do a lot of stuff by only recompiling and testing the hypervisor without
>> changing the rest of my test environment and being able to do it directly
>> on my mac is making things a lot faster and simpler.
>>
>> I have been using this for a long time and someone asked me some weeks
>> ago if that was possible so i figured it would be a good idea to share.
>>
>> Cheers
>> Bertrand
>
> How are you testing? QEMU TCG?
FVP that i trigger remotely, qemu locally or remotely, real targets depends on what
i have available.
But while on the go, developing and testing compilation locally without even testing
on target so that i can later trigger on target is definitely very useful.
Want some tips on how to develop while on Mac OS ?
Cheers
Bertrand
> --
> Sincerely,
> Demi Marie Obenour (she/her/hers)<OpenPGP_0xB288B55FFF9C22C1.asc>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-02-09 7:34 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 11:33 [PATCH v2] xen: Add macOS hypervisor build configuration Bertrand Marquis
2026-02-05 12:29 ` Jan Beulich
2026-02-05 15:30 ` Bertrand Marquis
2026-02-05 15:43 ` Jan Beulich
2026-02-05 15:58 ` Bertrand Marquis
2026-02-05 16:52 ` Jan Beulich
2026-02-05 17:07 ` Roger Pau Monné
2026-02-06 6:22 ` Jan Beulich
2026-02-06 7:35 ` Bertrand Marquis
2026-02-06 7:32 ` Bertrand Marquis
2026-02-08 2:36 ` Demi Marie Obenour
2026-02-09 7:26 ` Bertrand Marquis
2026-02-09 7:28 ` Demi Marie Obenour
2026-02-09 7:32 ` Bertrand Marquis
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.