Hi Roger,

> On 10 Feb 2026, at 12:41, Roger Pau Monné <[email protected]> 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=0x200000 -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 investigated further.  Seems like some issue with
> alternative and the uses of CPUID defines.  We probably want to
> mention in the commit message that only arm64 builds have been tested
> so far.

I just tried the same and could reproduce that.

This is apparently not related to mac os but to binutils (2.45.1 on my side)

After some digging i found out that this can be triggered with a simple 
assembler test where
.if (2/32) 
triggers the same error, while
.if 2/32
is fine (ie parenthesis are the source of the issue).

So the same error would probably occur with the same binutils version in linux 
i guess (unless it
brew specific version or patches which are creating that).

I did not dig further than that but we should keep that in mind in case this 
comes back in other
scenarios.

Cheers
Bertrand

> 
> Thanks, Roger.


Reply via email to