On 15.10.2021 18:58, Anthony PERARD wrote:
> On Thu, Oct 14, 2021 at 12:14:29PM +0200, Jan Beulich wrote:
>> On 24.08.2021 12:50, Anthony PERARD wrote:
>>> --- a/xen/Rules.mk
>>> +++ b/xen/Rules.mk
>>> @@ -38,7 +38,7 @@ SPECIAL_DATA_SECTIONS := rodata $(foreach a,1 2 4 8 16, \
>>>                           $(foreach r,rel rel.ro,data.$(r).local)
>>>  
>>>  # The filename build.mk has precedence over Makefile
>>> -mk-dir := $(src)
>>> +mk-dir := $(srctree)/$(src)
>>>  include $(if $(wildcard 
>>> $(mk-dir)/build.mk),$(mk-dir)/build.mk,$(mk-dir)/Makefile)
>>
>> Perhaps already when it was changed to $(src) the name has become
>> slightly misleading, at least imo: I would rather expect a variable
>> with this name to refer to the build dir/tree. Maybe "srcdir" or
>> even shorted "sd" right from the start? (Reaching here I can finally
>> see why having a shorthand is helpful.)
> 
> I have to think about that. I've made some further progress in order to
> be able to build the Xen pvhshim without a link farm and notice that
> nearly every source file needs to use "$(srctree)/$(src)"

Oh, now I'm curious as to the why here. I thought use of $(srctree)
ought to be the exception.

> and I'm not
> sure "$(src)" could be use alone. So having a single variable which have
> both would be useful.
> 
> "srcdir" might be to close to "srctree" and one might mistake it for the
> other, so "sd" might be better.

While I did suggest "sd" as an option, already when writing this I
wasn't convinced this would be descriptive enough. Personally I think
"dir" and "tree" are sufficiently different names. I would suggest
"srcroot" for what is now "srctree", but that would have the
disadvantage of getting us out of sync with Linux.

>>> --- a/xen/xsm/flask/ss/Makefile
>>> +++ b/xen/xsm/flask/ss/Makefile
>>> @@ -9,3 +9,6 @@ obj-y += conditional.o
>>>  obj-y += mls.o
>>>  
>>>  CFLAGS-y += -I$(srctree)/xsm/flask/include
>>> +ifdef building_out_of_srctree
>>> +    CFLAGS-y += -I$(objtree)/xsm/flask/include
>>
>> There's no header in $(srctree)/xsm/flask/include in this case, so if you
>> use "ifdef" here, shouldn't that other part move into an "else"?
> 
> Actually, there are headers in the source, like "security.h", and `git
> ls-files xen/xsm/flask/include` shows plenty other headers.

Hmm, I'm not sure now how I came to make that comment. I must have
mentally discarded the trailing "/include", looking at
xen/xsm/flask/Makefile generating a couple of headers, and then
blindly assumed these headers would land in xen/xsm/flask/. I'm
sorry for the noise.

Jan


Reply via email to