From nobody Mon Feb 9 13:24:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1770291260456675.0841855472819; Thu, 5 Feb 2026 03:34:20 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1221775.1529929 (Exim 4.92) (envelope-from ) id 1vnxcd-0004MZ-Gt; Thu, 05 Feb 2026 11:34:07 +0000 Received: by outflank-mailman (output) from mailman id 1221775.1529929; Thu, 05 Feb 2026 11:34:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnxcd-0004MP-EO; Thu, 05 Feb 2026 11:34:07 +0000 Received: by outflank-mailman (input) for mailman id 1221775; Thu, 05 Feb 2026 11:34:05 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnxcb-0003et-TY for xen-devel@lists.xenproject.org; Thu, 05 Feb 2026 11:34:05 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 938d62e2-0286-11f1-b161-2bf370ae4941; Thu, 05 Feb 2026 12:34:05 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1C3A1339; Thu, 5 Feb 2026 03:33:58 -0800 (PST) Received: from C3HXLD123V.arm.com (unknown [10.57.53.248]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B2E3A3F778; Thu, 5 Feb 2026 03:34:02 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 938d62e2-0286-11f1-b161-2bf370ae4941 From: Bertrand Marquis To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2] xen: Add macOS hypervisor build configuration Date: Thu, 5 Feb 2026 12:33:54 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1770291262510158500 Content-Type: text/plain; charset="utf-8" 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 --- 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 tool= s. +# 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 =3D 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=3D"/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=3Darm64 CROSS_COMPILE=3Daarch64-elf- HOSTCC=3Dgcc + +# Optional: out-of-tree build directory +# make XEN_TARGET_ARCH=3Darm64 CROSS_COMPILE=3Daarch64-elf- HOSTCC=3Dgcc O= =3D$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 --=20 2.52.0