|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4] xen: Add Darwin.mk for GNU toolchains
On 06.02.2026 18:25, Roger Pau Monné wrote: > 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 ...`. There are subtle differences, though. (Really I first wondered whether you omitted -C ...) >> --- /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. It's the ELF SVR4 psABI that we're after. This is more than just building ELF objects: It's also about calling convention, for example. Which would not matter much if Xen code was all written in C, as the ABI Xen surfaces to guests is entirely different anyway. Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |