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

Re: [RFC PATCH] xen: Add macOS hypervisor build support


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 5 Feb 2026 09:09:25 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=suse.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GJze7kEu5pNh4GwQaLr8lilZBUZikcp2XZkpTPWled8=; b=DYMdhrc45qRAVchdj+M58akrpwbXNcV+psiFy/wP0kve6C56RPEeXiSO0KlMQzq7A36plczH3DdAbfPFSbQXXjL+sXvmSwhXjFPv745vn9LXmZshZxrf1ROkUCroQotv0Vdyr/qh18ORsU6DLaSQ90ZhAgMvMi0T+x+Pugfb2SZg23Zb7VaMPnG55f1uILc+twqTkRrOW3rHMwUOtnBcLJSwyvMKQqmVo22MRhBtQs0V723DSfXflFlgSxRQ5pAkRGIh4evBLhd89y2Eal7RC4BdfnQ9HBaEtZ/oddkiW7B+QVhyrxwe/eddWXJKEdy3GgC4vxTgp1A7OyXBo+HQ9Q==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GJze7kEu5pNh4GwQaLr8lilZBUZikcp2XZkpTPWled8=; b=tMRooLU5FQquTPLrd57vWwPVXqKHwEB8tUKqo64Nt9FIqQqUGfmoVShX1BckKuytc+QHZPtciE6b2kDfVQ/PNUqfZpFAiQPSCmKw9VwoFIpfkaG349p6UjTAsd22u40Q9O1hYcPaeSOt4xH/h3Nag3nay/cfYrzn/l5mLzk6ELnsFis5gVIBiMtwV7A57YAIZWuHllvZ2jeFBSJBmypw8ePo0MwrQxtOaTYQjEmvsFiQV8Qra5vXmvFdg4qVhalbWDQiPxfuajz/NqaKttklTSrW17aKQnjldXSuZeF2xuDYvHuFq7mjyUm9XlNAa0AxBOBa2Td8kYplVkCSpvj1Hg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=G5nTpc33Jxr+33GsusUf2JklL5TEt/2xXWcWTc5izkUaTzKK/fxPuVUo5B9mH/2M2RgBXV6K/7J1AEXv9/n77ruBqjtN1eOiHWZvifc2pMPPwT1Im2gOxrhcF1e77Csy6QzdJEut8lYEWKdBG1/166xdd4BaZ5RDOx8jHvX8s2U9dHBdb1rMNh1QSSSkSnQyM2plGMCfwraN1iG/b4vqDZnIVv5/YOE0ch7CXI6jXdcwtYWD8DfhG4aengQ7RZporaynXCyLYxWRKfNL7mXPiJ3PV2yuJVvHMu6J8HrRl2U3xmbkMiuHuXNTFQrBG/TzSf/eDC9pjYyBH2P5SaXBuA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lMxdA9lO1hs1nzMXhLYLWJQV0/phUx4gwlu95MO0UxGbpNwAtx+qG0rE+wDcHWA2hWGSHmy/Qd1RjP0bARYou2PEMO+g37iCki/LYGEbJVuD7+BEa7cHMkFW3wU1N8T9hYod+Fd9expSJieJI3VttH4pxk8Tbgvdp85nZMKPGPDZT7PmL2F+zmjoUk+foWpp6n6HsWUIlYHsxYFYDPTYhxF4+olAfYf1QByeXww1h1jeL1SuzVkuwFaeeRVoyPCG89bY81CpkSBOpoyPwdNzsxm9AZ7zBXHFB8AlW8/8/jyIZr70d8RUYmxjlLDNg/Z9KsfFCsG/g7+6mI+5l424xA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 05 Feb 2026 09:10:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHcldiTYCc32vRyb0mp6O53Aox8PLVyquQAgAAD9QCAAAhKAIABA5IAgAALHACAAAXaAIAAA1oAgAADfYA=
  • Thread-topic: [RFC PATCH] xen: Add macOS hypervisor build support

Hi Jan,

> On 5 Feb 2026, at 09:56, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 05.02.2026 09:44, Bertrand Marquis wrote:
>> Hi Jan,
>> 
>>> On 5 Feb 2026, at 09:23, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> 
>>> On 05.02.2026 08:44, Bertrand Marquis wrote:
>>>>> On 4 Feb 2026, at 17:15, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>> On 04.02.2026 16:45, Bertrand Marquis wrote:
>>>>>>> On 4 Feb 2026, at 16:31, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>>>>>> On 04.02.2026 14:16, Bertrand Marquis wrote:
>>>>>>>> Xen does not currently document how to build the hypervisor on macOS, 
>>>>>>>> and
>>>>>>>> there is no Darwin configuration for a Homebrew-based toolchain. In
>>>>>>>> addition, the Makefile silent-mode detection can be tripped by -I paths
>>>>>>>> that contain an "s", which hides build commands unexpectedly.
>>>>>>> 
>>>>>>> This wants submitting as a standalone fix, so it can be backported. But 
>>>>>>> see
>>>>>>> also below. I don't, however, understand how -I could be useful here - 
>>>>>>> our
>>>>>>> build system is self-contained, so any include directives used should be
>>>>>>> satisfiable without any -I.
>>>>>> 
>>>>>> This is added automatically inside our Makefile if you build out of tree:
>>>>>> 
>>>>>> MAKEFLAGS += --include-dir=$(abs_srctree)
>>>>>> 
>>>>>> which ends up being -Ixxx when tested.
>>>>> 
>>>>> Hmm, but I do have an 's' in my source path, yet I need to explicitly pass
>>>>> -s for the build to be silent.
>>>> 
>>>> I did further investigations and my previous assumptions where actually
>>>> wrong because i looked tat MAKEFLAGS value once the whole Makefile
>>>> was parsed and the include-dir flag is added after so it was not the reason
>>>> of the issue.
>>>> 
>>>> In fact the issue is coming from variables set on the command line (and
>>>> in my case O= with a path containing a s).
>>>> So you can easily reproduce the issue by just passing XX=s to the make
>>>> command line to do a test.
>>>> 
>>>> As a consequence, your proposed solution filtering -% is not working and
>>>> the only reliable solution is to actually use firstword to actually get the
>>>> short options list. This is making an assumption on MAKEFLAGS having
>>>> them first but my tests are showing that it is always the case.
>>>> I would propose to put a comment to explain the assumptions on which
>>>> the filtering is based on top:
>>>> 
>>>> Something like this:
>>>> diff --git a/xen/Makefile b/xen/Makefile
>>>> index 13e336ba5484..a7924fcb7af5 100644
>>>> --- a/xen/Makefile
>>>> +++ b/xen/Makefile
>>>> @@ -113,10 +113,10 @@ else
>>>>    Q := @
>>>> endif
>>>> 
>>>> -# If the user is running make -s (silent mode), suppress echoing of
>>>> -# commands
>>>> -
>>>> -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>>>> +# If the user is running make -s (silent mode), suppress echoing of 
>>>> commands.
>>>> +# This relies on GNU make encoding short options in the first MAKEFLAGS 
>>>> word;
>>>> +# if this changes in the future, this check may need revisiting.
>>>> +ifneq ($(findstring s,$(firstword $(MAKEFLAGS))),)
>>>>    quiet := silent_
>>>> endif
>>>> 
>>>> Also i can put a fixes tag if you think that is useful:
>>>> Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
>>>> 
>>>> Please tell me if that sounds ok for you and I will resubmit this as 2 
>>>> different patches
>>>> instead of a single one.
>>> 
>>> Sadly no, see my other reply sent earlier today. Furthermore, as said 
>>> there, even
>> 
>> Sorry missed you reply when i wrote mine.
>> 
>>> with O= I can't repro what you say. In fact with a Makefile containing just
>> 
>> interesting
>> 
>>> 
>>> $(warning MAKEFLAGS="$(MAKEFLAGS)" ABC="$(ABC)" XYZ="$(XYZ)")
>>> 
>>> all:
>>> @echo 'MFLAGS=$(MFLAGS)'
>>> @echo 'MAKEFLAGS=$(MAKEFLAGS)'
>>> 
>>> I can observe (with both make 4.0 and make 4.2.1) $(MAKEFLAGS) expanding
>>> differently depending on where it's used (I'm passing ABC= and/or XYZ= to
>>> experiment): Only the use in the rule has the variables. What version of 
>>> make are
>>> you using?
>> 
>> I am using make 4.4.1 on both my Linux and brew based builds which might 
>> explain
>> why i always see the same.
>> 
>> I have an other linux system where i have make 4.3 and in this one, 
>> MAKEFLAGS does
>> not contain O= options when the test is done so the issue is not appearing 
>> there:
>> 
>> adding:
>> @@ -116,6 +116,7 @@ endif
>> # If the user is running make -s (silent mode), suppress echoing of
>> # commands
>> 
>> +$(info MAKEFLAGS=$(MAKEFLAGS))
>> +$(info MFLAGS=$(MFLAGS))
>> ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
>>     quiet := silent_
>> endif
>> 
>> ## On linux with make 4.3 i see:
>> MAKEFLAGS=-rR
>> MFLAGS=
>> and the build is not silent
>> 
>> with -s:
>> MAKEFLAGS=s -rR
>> MFLAGS=-s
>> 
>> with --warn-undefined-variables
>> MAKEFLAGS= --warn-undefined-variables -rR
>> MFLAGS=--warn-undefined-variables
>> 
>> ## but on linux with 4.4.1 i see (same with brew make 4.4.4:
>> MAKEFLAGS=rR -- XEN_TARGET_ARCH=arm64 O=builddir-s-test
>> MFLAGS=-rR
>> and the build is silent
>> 
>> with -s:
>> MAKEFLAGS=rRs -- XEN_TARGET_ARCH=arm64 O=/home/bermar01/Work/xen/xen/builddir
>> MFLAGS=-rRs
>> 
>> with --warn-undefined-variables
>> MAKEFLAGS=rR --warn-undefined-variables -- XEN_TARGET_ARCH=arm64 
>> O=/home/bermar01/Work/xen/xen/builddir
>> MFLAGS=-rR --warn-undefined-variables
> 
> Ah yes, and here is a quote from make 4.4's NEWS:
> 
> "* WARNING: Backward-incompatibility!
>   Previously only simple (one-letter) options were added to the MAKEFLAGS
>   variable that was visible while parsing makefiles.  Now, all options are
>   available in MAKEFLAGS.  If you want to check MAKEFLAGS for a one-letter
>   option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return
>   the set of one-letter options which can be examined via findstring, etc."

Nice

> 
>> So i think the working solution would be to keep the current test but do it 
>> on MFLAGS instead of MAKEFLAGS:
>> 
>> ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
>>     quiet := silent_
>> endif
>> 
>> Could you quickly do the same test than me on make 4.0 and 4.2.1 to confirm ?
> 
> Well, I did confirm this already with my earlier experimenting. IOW either
> this or the $(firstword -$(MAKEFLAGS)) they suggest (effectively matching my
> earlier suggestion, prepending '.' instead of '-', as really any char other
> than 's' or a whitespace one will do here). Personally I'm slightly in favor
> of the MFLAGS variant.

Agree, i will use MFLAGS as this looks more reliable.

Thanks i will submit this and the mac os build thing as independent patches.

Cheers
Bertrand




 


Rackspace

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