Re: [PATCH v5] xen: Add Darwin.mk
On 10.02.2026 13:56, Bertrand Marquis wrote: > Hi Roger, > >> On 10 Feb 2026, at 12:41, Roger Pau Monné wrote: >> >> On Tue, Feb 10, 2026 at 11:46:44AM +0100, Jan Beulich wrote: >>> On 09.02.2026 11:46, Bertrand Marquis wrote: --- /dev/null +++ b/config/Darwin.mk @@ -0,0 +1,6 @@ +# 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 + +# Cross compile on Mac OS, only hypervisor build has been tested, no tools +XEN_COMPILE_ARCH = unknow >>> >>> While editing in the ABI aspect, it occurred to me to check what Apple has >>> to say regarding their ABI. For both aarch64 and x86-64 they say they use >>> the standard ABI with some modifications. We may want to evaluate whether >>> those modifications are actually compatible with what we need. >>> >>> Talking of x86-64: Has building on an x86 Mac been tested as well? >>> Especially if that doesn't work, it may want mentioning. >> >> I no longer have access to an x86 Mac, those are about to disappear. >> >> FWIW, I build x86 on Mac using the Docker containers, just as the CI >> does. OSX Docker allows running x86 containers on arm64 using the >> "Rosetta 2" binary translation layer. >> >> I've attempted doing a cross-build from an arm64 Mac using the x86-elf >> toolchain, but got the following error: If it's really x86-elf (not x86-linux), then likely ... >> % make XEN_TARGET_ARCH=x86_64 CROSS_COMPILE=x86_64-elf- HOSTCC=gcc -C xen V=1 >> [...] >> /Library/Developer/CommandLineTools/usr/bin/make -f ./Rules.mk obj=common >> need-builtin=1 >> x86_64-elf-gcc -MMD -MP -MF common/.bitmap.o.d -m64 -DBUILD_ID >> -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes >> -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 >> -fno-omit-frame-pointer -nostdinc -fno-builtin -fno-common >> -fzero-init-padding-bits=all -Werror -Wredundant-decls -Wwrite-strings >> -Wno-pointer-arith -Wdeclaration-after-statement -Wuninitialized -Wvla >> -Wflex-array-member-not-at-end -Winit-self -pipe -D__XEN__ -include >> ./include/xen/config.h -Wa,--strip-local-absolute -ffunction-sections >> -fdata-sections -g -malign-data=abi -mindirect-branch=thunk-extern >> -mindirect-branch-register -fno-jump-tables -mfunction-return=thunk-extern >> -Wa,-mx86-used-note=no -fno-stack-protector -I./include >> -I./arch/x86/include -I./arch/x86/include/generated >> -DXEN_IMG_OFFSET=0x20 -msoft-float -fno-pie -fno-exceptions >> -fno-asynchronous-unwind-tables -Wnested-externs -DHAVE_AS_QUOTED_SYM >> -DHAVE_AS_MOVDIR -DHAVE_AS_ENQCMD -DHAVE_AS_NOPS_DIRECTIVE -mno-red-zone >> -fpic -mno-mmx -mno-sse -mskip-rax-setup -fcf-protection=branch >> -mmanual-endbr -fno-jump-tables >> -mmemcpy-strategy=unrolled_loop:16:noalign,libcall:-1:noalign >> -mmemset-strategy=unrolled_loop:16:noalign,libcall:-1:noalign >> -Wa,-I./include -Wa,-I./include '-D__OBJECT_LABEL__=common/bitmap.o' >> -mpreferred-stack-boundary=3 -c common/bitmap.c -o common/.bitmap.o.tmp >> -MQ common/bitmap.o >> ./arch/x86/include/asm/bitops.h: Assembler messages: >> ./arch/x86/include/asm/bitops.h:511: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/bitops.h:511: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/bitops.h:511: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/bitops.h:511: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:28: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:20: Error: found ' >> ', expected: ')' >> ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of >> featureset range >> ./arch/x86/include/asm/nospec.h:
Re: [PATCH v5] xen: Add Darwin.mk
Hi Roger, > On 10 Feb 2026, at 12:41, Roger Pau Monné wrote: > > On Tue, Feb 10, 2026 at 11:46:44AM +0100, Jan Beulich wrote: >> On 09.02.2026 11:46, Bertrand Marquis wrote: >>> --- /dev/null >>> +++ b/config/Darwin.mk >>> @@ -0,0 +1,6 @@ >>> +# 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 >>> + >>> +# Cross compile on Mac OS, only hypervisor build has been tested, no tools >>> +XEN_COMPILE_ARCH = unknow >> >> While editing in the ABI aspect, it occurred to me to check what Apple has >> to say regarding their ABI. For both aarch64 and x86-64 they say they use >> the standard ABI with some modifications. We may want to evaluate whether >> those modifications are actually compatible with what we need. >> >> Talking of x86-64: Has building on an x86 Mac been tested as well? >> Especially if that doesn't work, it may want mentioning. > > I no longer have access to an x86 Mac, those are about to disappear. > > FWIW, I build x86 on Mac using the Docker containers, just as the CI > does. OSX Docker allows running x86 containers on arm64 using the > "Rosetta 2" binary translation layer. > > I've attempted doing a cross-build from an arm64 Mac using the x86-elf > toolchain, but got the following error: > > % make XEN_TARGET_ARCH=x86_64 CROSS_COMPILE=x86_64-elf- HOSTCC=gcc -C xen V=1 > [...] > /Library/Developer/CommandLineTools/usr/bin/make -f ./Rules.mk obj=common > need-builtin=1 > x86_64-elf-gcc -MMD -MP -MF common/.bitmap.o.d -m64 -DBUILD_ID > -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 > -fno-omit-frame-pointer -nostdinc -fno-builtin -fno-common > -fzero-init-padding-bits=all -Werror -Wredundant-decls -Wwrite-strings > -Wno-pointer-arith -Wdeclaration-after-statement -Wuninitialized -Wvla > -Wflex-array-member-not-at-end -Winit-self -pipe -D__XEN__ -include > ./include/xen/config.h -Wa,--strip-local-absolute -ffunction-sections > -fdata-sections -g -malign-data=abi -mindirect-branch=thunk-extern > -mindirect-branch-register -fno-jump-tables -mfunction-return=thunk-extern > -Wa,-mx86-used-note=no -fno-stack-protector -I./include -I./arch/x86/include > -I./arch/x86/include/generated -DXEN_IMG_OFFSET=0x20 -msoft-float > -fno-pie -fno-exceptions -fno-asynchronous-unwind-tables -Wnested-externs > -DHAVE_AS_QUOTED_SYM -DHAVE_AS_MOVDIR -DHAVE_AS_ENQCMD > -DHAVE_AS_NOPS_DIRECTIVE -mno-red-zone -fpic -mno-mmx -mno-sse > -mskip-rax-setup -fcf-protection=branch -mmanual-endbr -fno-jump-tables > -mmemcpy-strategy=unrolled_loop:16:noalign,libcall:-1:noalign > -mmemset-strategy=unrolled_loop:16:noalign,libcall:-1:noalign -Wa,-I./include > -Wa,-I./include '-D__OBJECT_LABEL__=common/bitmap.o' > -mpreferred-stack-boundary=3 -c common/bitmap.c -o common/.bitmap.o.tmp -MQ > common/bitmap.o > ./arch/x86/include/asm/bitops.h: Assembler messages: > ./arch/x86/include/asm/bitops.h:511: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/bitops.h:511: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/bitops.h:511: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/bitops.h:511: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:28: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of > featureset range > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:20: Error: found ' > ', expected: ')' > ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of > featureset rang
Re: [PATCH v5] xen: Add Darwin.mk
On Tue, Feb 10, 2026 at 11:46:44AM +0100, Jan Beulich wrote: > On 09.02.2026 11:46, Bertrand Marquis wrote: > > --- /dev/null > > +++ b/config/Darwin.mk > > @@ -0,0 +1,6 @@ > > +# 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 > > + > > +# Cross compile on Mac OS, only hypervisor build has been tested, no tools > > +XEN_COMPILE_ARCH = unknow > > While editing in the ABI aspect, it occurred to me to check what Apple has > to say regarding their ABI. For both aarch64 and x86-64 they say they use > the standard ABI with some modifications. We may want to evaluate whether > those modifications are actually compatible with what we need. > > Talking of x86-64: Has building on an x86 Mac been tested as well? > Especially if that doesn't work, it may want mentioning. I no longer have access to an x86 Mac, those are about to disappear. FWIW, I build x86 on Mac using the Docker containers, just as the CI does. OSX Docker allows running x86 containers on arm64 using the "Rosetta 2" binary translation layer. I've attempted doing a cross-build from an arm64 Mac using the x86-elf toolchain, but got the following error: % make XEN_TARGET_ARCH=x86_64 CROSS_COMPILE=x86_64-elf- HOSTCC=gcc -C xen V=1 [...] /Library/Developer/CommandLineTools/usr/bin/make -f ./Rules.mk obj=common need-builtin=1 x86_64-elf-gcc -MMD -MP -MF common/.bitmap.o.d -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 -fno-omit-frame-pointer -nostdinc -fno-builtin -fno-common -fzero-init-padding-bits=all -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith -Wdeclaration-after-statement -Wuninitialized -Wvla -Wflex-array-member-not-at-end -Winit-self -pipe -D__XEN__ -include ./include/xen/config.h -Wa,--strip-local-absolute -ffunction-sections -fdata-sections -g -malign-data=abi -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -mfunction-return=thunk-extern -Wa,-mx86-used-note=no -fno-stack-protector -I./include -I./arch/x86/include -I./arch/x86/include/generated -DXEN_IMG_OFFSET=0x20 -msoft-float -fno-pie -fno-exceptions -fno-asynchronous-unwind-tables -Wnested-externs -DHAVE_AS_QUOTED_SYM -DHAVE_AS_MOVDIR -DHAVE_AS_ENQCMD -DHAVE_AS_NOPS_DIRECTIVE -mno-red-zone -fpic -mno-mmx -mno-sse -mskip-rax-setup -fcf-protection=branch -mmanual-endbr -fno-jump-tables -mmemcpy-strategy=unrolled_loop:16:noalign,libcall:-1:noalign -mmemset-strategy=unrolled_loop:16:noalign,libcall:-1:noalign -Wa,-I./include -Wa,-I./include '-D__OBJECT_LABEL__=common/bitmap.o' -mpreferred-stack-boundary=3 -c common/bitmap.c -o common/.bitmap.o.tmp -MQ common/bitmap.o ./arch/x86/include/asm/bitops.h: Assembler messages: ./arch/x86/include/asm/bitops.h:511: Error: found ' ', expected: ')' ./arch/x86/include/asm/bitops.h:511: Error: found ' ', expected: ')' ./arch/x86/include/asm/bitops.h:511: Error: found ' ', expected: ')' ./arch/x86/include/asm/bitops.h:511: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:20: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:21: Error: alternative feature outside of featureset range ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:28: Error: found ' ', expected: ')' ./arch/x86/include/asm/nospec.h:29: Error: alternative feature outside of featureset range I haven't investi
Re: [PATCH v5] xen: Add Darwin.mk
Hi Jan, > On 10 Feb 2026, at 11:46, Jan Beulich wrote: > > On 09.02.2026 11:46, Bertrand Marquis wrote: >> --- /dev/null >> +++ b/config/Darwin.mk >> @@ -0,0 +1,6 @@ >> +# 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 >> + >> +# Cross compile on Mac OS, only hypervisor build has been tested, no tools >> +XEN_COMPILE_ARCH = unknow > > While editing in the ABI aspect, it occurred to me to check what Apple has > to say regarding their ABI. For both aarch64 and x86-64 they say they use > the standard ABI with some modifications. We may want to evaluate whether > those modifications are actually compatible with what we need. > > Talking of x86-64: Has building on an x86 Mac been tested as well? No i did not tested that (and i have no x86 mac i can use to do so). > Especially if that doesn't work, it may want mentioning. We might have to say that it was only tested on arm mac. I would expect that it works on x86 mac but i cannot sign on that. Cheers Bertrand > > Jan
Re: [PATCH v5] xen: Add Darwin.mk
On 09.02.2026 11:46, Bertrand Marquis wrote: > --- /dev/null > +++ b/config/Darwin.mk > @@ -0,0 +1,6 @@ > +# 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 > + > +# Cross compile on Mac OS, only hypervisor build has been tested, no tools > +XEN_COMPILE_ARCH = unknow While editing in the ABI aspect, it occurred to me to check what Apple has to say regarding their ABI. For both aarch64 and x86-64 they say they use the standard ABI with some modifications. We may want to evaluate whether those modifications are actually compatible with what we need. Talking of x86-64: Has building on an x86 Mac been tested as well? Especially if that doesn't work, it may want mentioning. Jan
Re: [PATCH v5] xen: Add Darwin.mk
On Mon, Feb 09, 2026 at 01:42:05PM +, Bertrand Marquis wrote: > > > > On 9 Feb 2026, at 14:39, Roger Pau Monné wrote: > > > > On Mon, Feb 09, 2026 at 01:33:13PM +, Bertrand Marquis wrote: > >> Hi Roger > >> > >>> On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: > >>> > >>> On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: > Xen does not provide a Darwin build configuration useable on Mac OS. > It is possible to build Xen Hypervisor (tools are not supported) with a > toolchain able to produce ELF binaries (GCC or others). > > Add config/Darwin.mk to include StdGNU.mk and force > XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow > the cross-compile path so compiling on Mac OS is always handled as a > cross compilation case. > > Only compiling the hypervisor has been tested ! > > An example of how to build the hypervisor for arm64 on Mac OS > (tools cannot be build for now) using a compiler from brew: > - brew install aarch64-elf-gcc aarch64-elf-binutils > - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang > >>> > >>> This needs 'xen' target passed. > >> > >> Without any target, xen is built by default so i kept the simplest > >> possible command > >> But I am ok with adding xen > > > > With the `cd xen` omitted, won't that also attempt to build the tools > > then? > > This is supposed to be called in the xen sub-directory not in the main > directory. > > Now i get why you wanted the xen (and hence why there was the cd xen before) > > Maybe having -C xen would be a better idea, building from main Makefile could > bring other side effects i guess. I don't have a strong opinion, both -C xen or xen seem to work for me. Thanks, Roger.
Re: [PATCH v5] xen: Add Darwin.mk
Hi Jan, > On 9 Feb 2026, at 15:13, Jan Beulich wrote: > > On 09.02.2026 14:42, Bertrand Marquis wrote: >>> On 9 Feb 2026, at 14:39, Roger Pau Monné wrote: >>> On Mon, Feb 09, 2026 at 01:33:13PM +, Bertrand Marquis wrote: > On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: > On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: >> Xen does not provide a Darwin build configuration useable on Mac OS. >> It is possible to build Xen Hypervisor (tools are not supported) with a >> toolchain able to produce ELF binaries (GCC or others). >> >> Add config/Darwin.mk to include StdGNU.mk and force >> XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow >> the cross-compile path so compiling on Mac OS is always handled as a >> cross compilation case. >> >> Only compiling the hypervisor has been tested ! >> >> An example of how to build the hypervisor for arm64 on Mac OS >> (tools cannot be build for now) using a compiler from brew: >> - brew install aarch64-elf-gcc aarch64-elf-binutils >> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang > > This needs 'xen' target passed. Without any target, xen is built by default so i kept the simplest possible command But I am ok with adding xen >>> >>> With the `cd xen` omitted, won't that also attempt to build the tools >>> then? >> >> This is supposed to be called in the xen sub-directory not in the main >> directory. >> >> Now i get why you wanted the xen (and hence why there was the cd xen before) >> >> Maybe having -C xen would be a better idea, building from main Makefile could >> bring other side effects i guess. > > Happy to add "-C xen" while committing, if that's what we now have settled > upon? Yes I think this will make it clearer and obvious that we only operate in the hypervisor sub-directory. Thanks Bertrand > > Jan
Re: [PATCH v5] xen: Add Darwin.mk
On 09.02.2026 14:42, Bertrand Marquis wrote: >> On 9 Feb 2026, at 14:39, Roger Pau Monné wrote: >> On Mon, Feb 09, 2026 at 01:33:13PM +, Bertrand Marquis wrote: On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: > Xen does not provide a Darwin build configuration useable on Mac OS. > It is possible to build Xen Hypervisor (tools are not supported) with a > toolchain able to produce ELF binaries (GCC or others). > > Add config/Darwin.mk to include StdGNU.mk and force > XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow > the cross-compile path so compiling on Mac OS is always handled as a > cross compilation case. > > Only compiling the hypervisor has been tested ! > > An example of how to build the hypervisor for arm64 on Mac OS > (tools cannot be build for now) using a compiler from brew: > - brew install aarch64-elf-gcc aarch64-elf-binutils > - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang This needs 'xen' target passed. >>> >>> Without any target, xen is built by default so i kept the simplest possible >>> command >>> But I am ok with adding xen >> >> With the `cd xen` omitted, won't that also attempt to build the tools >> then? > > This is supposed to be called in the xen sub-directory not in the main > directory. > > Now i get why you wanted the xen (and hence why there was the cd xen before) > > Maybe having -C xen would be a better idea, building from main Makefile could > bring other side effects i guess. Happy to add "-C xen" while committing, if that's what we now have settled upon? Jan
Re: [PATCH v5] xen: Add Darwin.mk
> On 9 Feb 2026, at 14:39, Roger Pau Monné wrote: > > On Mon, Feb 09, 2026 at 01:33:13PM +, Bertrand Marquis wrote: >> Hi Roger >> >>> On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: >>> >>> On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: Xen does not provide a Darwin build configuration useable on Mac OS. It is possible to build Xen Hypervisor (tools are not supported) with a toolchain able to produce ELF binaries (GCC or others). Add config/Darwin.mk to include StdGNU.mk and force XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow the cross-compile path so compiling on Mac OS is always handled as a cross compilation case. Only compiling the hypervisor has been tested ! An example of how to build the hypervisor for arm64 on Mac OS (tools cannot be build for now) using a compiler from brew: - brew install aarch64-elf-gcc aarch64-elf-binutils - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang >>> >>> This needs 'xen' target passed. >> >> Without any target, xen is built by default so i kept the simplest possible >> command >> But I am ok with adding xen > > With the `cd xen` omitted, won't that also attempt to build the tools > then? This is supposed to be called in the xen sub-directory not in the main directory. Now i get why you wanted the xen (and hence why there was the cd xen before) Maybe having -C xen would be a better idea, building from main Makefile could bring other side effects i guess. Cheers Bertrand > > Thanks, Roger.
Re: [PATCH v5] xen: Add Darwin.mk
On Mon, Feb 09, 2026 at 01:33:13PM +, Bertrand Marquis wrote: > Hi Roger > > > On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: > > > > On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: > >> Xen does not provide a Darwin build configuration useable on Mac OS. > >> It is possible to build Xen Hypervisor (tools are not supported) with a > >> toolchain able to produce ELF binaries (GCC or others). > >> > >> Add config/Darwin.mk to include StdGNU.mk and force > >> XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow > >> the cross-compile path so compiling on Mac OS is always handled as a > >> cross compilation case. > >> > >> Only compiling the hypervisor has been tested ! > >> > >> An example of how to build the hypervisor for arm64 on Mac OS > >> (tools cannot be build for now) using a compiler from brew: > >> - brew install aarch64-elf-gcc aarch64-elf-binutils > >> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang > > > > This needs 'xen' target passed. > > Without any target, xen is built by default so i kept the simplest possible > command > But I am ok with adding xen With the `cd xen` omitted, won't that also attempt to build the tools then? Thanks, Roger.
Re: [PATCH v5] xen: Add Darwin.mk
Hi Roger > On 9 Feb 2026, at 14:26, Roger Pau Monné wrote: > > On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: >> Xen does not provide a Darwin build configuration useable on Mac OS. >> It is possible to build Xen Hypervisor (tools are not supported) with a >> toolchain able to produce ELF binaries (GCC or others). >> >> Add config/Darwin.mk to include StdGNU.mk and force >> XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow >> the cross-compile path so compiling on Mac OS is always handled as a >> cross compilation case. >> >> Only compiling the hypervisor has been tested ! >> >> An example of how to build the hypervisor for arm64 on Mac OS >> (tools cannot be build for now) using a compiler from brew: >> - brew install aarch64-elf-gcc aarch64-elf-binutils >> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang > > This needs 'xen' target passed. Without any target, xen is built by default so i kept the simplest possible command But I am ok with adding xen > >> >> Signed-off-by: Bertrand Marquis > > Acked-by: Roger Pau Monné Thanks Bertrand > > Thanks, Roger.
Re: [PATCH v5] xen: Add Darwin.mk
On Mon, Feb 09, 2026 at 11:46:44AM +0100, Bertrand Marquis wrote: > Xen does not provide a Darwin build configuration useable on Mac OS. > It is possible to build Xen Hypervisor (tools are not supported) with a > toolchain able to produce ELF binaries (GCC or others). > > Add config/Darwin.mk to include StdGNU.mk and force > XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow > the cross-compile path so compiling on Mac OS is always handled as a > cross compilation case. > > Only compiling the hypervisor has been tested ! > > An example of how to build the hypervisor for arm64 on Mac OS > (tools cannot be build for now) using a compiler from brew: > - brew install aarch64-elf-gcc aarch64-elf-binutils > - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang This needs 'xen' target passed. > > Signed-off-by: Bertrand Marquis Acked-by: Roger Pau Monné Thanks, Roger.
Re: [PATCH v5] xen: Add Darwin.mk
> On 9 Feb 2026, at 14:01, Jan Beulich wrote: > > On 09.02.2026 11:46, Bertrand Marquis wrote: >> Xen does not provide a Darwin build configuration useable on Mac OS. >> It is possible to build Xen Hypervisor (tools are not supported) with a >> toolchain able to produce ELF binaries (GCC or others). >> >> Add config/Darwin.mk to include StdGNU.mk and force >> XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow >> the cross-compile path so compiling on Mac OS is always handled as a >> cross compilation case. >> >> Only compiling the hypervisor has been tested ! >> >> An example of how to build the hypervisor for arm64 on Mac OS >> (tools cannot be build for now) using a compiler from brew: >> - brew install aarch64-elf-gcc aarch64-elf-binutils >> - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang >> >> Signed-off-by: Bertrand Marquis > > Acked-by: Jan Beulich > >> Change-Id: Iba91634afbaab58767bb8744b4b722ce5732a6dd > > This wants removing, I suppose. oh yes sorry for that > >> --- /dev/null >> +++ b/config/Darwin.mk >> @@ -0,0 +1,6 @@ >> +# 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 >> + >> +# Cross compile on Mac OS, only hypervisor build has been tested, no tools >> +XEN_COMPILE_ARCH = unknow > > There was an 'n' lost, as the reason for forcing cross-compilation also > isn't stated. I'll take the liberty to add both back in. ok with me. Cheers Bertrand > > Jan
Re: [PATCH v5] xen: Add Darwin.mk
On 09.02.2026 11:46, Bertrand Marquis wrote: > Xen does not provide a Darwin build configuration useable on Mac OS. > It is possible to build Xen Hypervisor (tools are not supported) with a > toolchain able to produce ELF binaries (GCC or others). > > Add config/Darwin.mk to include StdGNU.mk and force > XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow > the cross-compile path so compiling on Mac OS is always handled as a > cross compilation case. > > Only compiling the hypervisor has been tested ! > > An example of how to build the hypervisor for arm64 on Mac OS > (tools cannot be build for now) using a compiler from brew: > - brew install aarch64-elf-gcc aarch64-elf-binutils > - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang > > Signed-off-by: Bertrand Marquis Acked-by: Jan Beulich > Change-Id: Iba91634afbaab58767bb8744b4b722ce5732a6dd This wants removing, I suppose. > --- /dev/null > +++ b/config/Darwin.mk > @@ -0,0 +1,6 @@ > +# 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 > + > +# Cross compile on Mac OS, only hypervisor build has been tested, no tools > +XEN_COMPILE_ARCH = unknow There was an 'n' lost, as the reason for forcing cross-compilation also isn't stated. I'll take the liberty to add both back in. Jan
