All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.