[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] xen: Add Darwin.mk


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 10 Feb 2026 14:45:58 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Feb 2026 13:46:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.02.2026 13:56, Bertrand Marquis wrote:
> Hi Roger,
> 
>> On 10 Feb 2026, at 12:41, Roger Pau Monné <roger.pau@xxxxxxxxxx> 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=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).

... the wrong conclusion is being drawn here. It's not the parenthesis then,
but the fact that '/' is a comment character there. Requires adding --divide
to the command line options to have the character re-obtain its meaning as
division operator. (GNU, Linux, FreeBSD, NetBSD, Haiku, and Dragonfly are
the targets where '/' isn't a comment character by default, at present. Yes,
this is pretty confusing.)

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.