All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: fix dependencies for files compiled from their parent directory
@ 2015-11-25 16:16 Jan Beulich
  2015-11-25 16:26 ` Ian Campbell
  2015-11-30 16:31 ` Jonathan Creekmore
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Beulich @ 2015-11-25 16:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Jonathan Creekmore, Keir Fraser, Ian Jackson, Tim Deegan

The use of $(basename ...) here was wrong (yet I'm sure I tested it).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -105,7 +105,7 @@ include Makefile
 DEPS = .*.d
 define gendep
     ifneq ($(1),$(subst /,:,$(1)))
-        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
+        DEPS += $(dir $(1)).$(notdir $(1)).d
     endif
 endef
 $(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-25 16:16 [PATCH] build: fix dependencies for files compiled from their parent directory Jan Beulich
@ 2015-11-25 16:26 ` Ian Campbell
  2015-11-26  7:43   ` Jan Beulich
  2015-11-30 16:31 ` Jonathan Creekmore
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2015-11-25 16:26 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Jonathan Creekmore, Keir Fraser, Ian Jackson, Tim Deegan

On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
> The use of $(basename ...) here was wrong (yet I'm sure I tested it).

Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really to be
xen/arch/x86/.x86_64.compat.o.d?

Otherwise xen/arch/x86/Makefile (which contains obj-y := ...
x86_64/compat.o) does not correctly track the dependencies of that file?

But that being the case I'm then confused, since it doesn't seem that the
currently wrong version is missing the .o or anything like that which is
what I would have expected the basename to be doing.

This is all in a recently built x86_64 tree (the one I used when building
before push earlier today).

> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -105,7 +105,7 @@ include Makefile
>  DEPS = .*.d
>  define gendep
>      ifneq ($(1),$(subst /,:,$(1)))
> -        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
> +        DEPS += $(dir $(1)).$(notdir $(1)).d
>      endif
>  endef
>  $(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))
> 
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-25 16:26 ` Ian Campbell
@ 2015-11-26  7:43   ` Jan Beulich
  2015-11-26  9:51     ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2015-11-26  7:43 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Jonathan Creekmore, Tim Deegan, Keir Fraser, Ian Jackson, xen-devel

>>> On 25.11.15 at 17:26, <ian.campbell@citrix.com> wrote:
> On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
>> The use of $(basename ...) here was wrong (yet I'm sure I tested it).
> 
> Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really to be
> xen/arch/x86/.x86_64.compat.o.d?

No, xen/arch/x86/x86_64/.compat.o.d is the correct name. Just
that $(dir $(1)).$(basename $(notdir $(1))).d produces
xen/arch/x86/x86_64/.compat.d (i.e. strips the .o, which is not in
line with $(@D)/.$(@F).d used to generate those files), and hence
neither dependency tracking nor cleaning work.

Jan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-26  7:43   ` Jan Beulich
@ 2015-11-26  9:51     ` Ian Campbell
  2015-11-26 10:38       ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Campbell @ 2015-11-26  9:51 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Jonathan Creekmore, Tim Deegan, Keir Fraser, Ian Jackson, xen-devel

On Thu, 2015-11-26 at 00:43 -0700, Jan Beulich wrote:
> > > > On 25.11.15 at 17:26, <ian.campbell@citrix.com> wrote:
> > On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
> > > The use of $(basename ...) here was wrong (yet I'm sure I tested it).
> > 
> > Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really to
> > be
> > xen/arch/x86/.x86_64.compat.o.d?
> 
> No, xen/arch/x86/x86_64/.compat.o.d is the correct name. Just
> that $(dir $(1)).$(basename $(notdir $(1))).d produces
> xen/arch/x86/x86_64/.compat.d (i.e. strips the .o, which is not in
> line with $(@D)/.$(@F).d used to generate those files), and hence
> neither dependency tracking nor cleaning work.

My tree, which was last built with 98b69a010c24 has:

    ianc@cosworth    :committer-amd64.git$ find xen -name .\*compat\*
    xen/arch/x86/.compat.o.d
    xen/arch/x86/x86_64/.compat.o.d
    xen/arch/x86/efi/.compat.o.d
    ianc@cosworth    :committer-amd64.git$ 

Which is very odd, since the prevailing xen/Rules.mk has:

    define gendep
        ifneq ($(1),$(subst /,:,$(1)))
            DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
        endif
    endef

Which I agree looks as if it should have stripped the .o as you describe,
but it seems not to have done so. AIUI makes "basename" differs from the
CLI basename(1) in that the make one will always strip 

Just to double check I did:

    $ make --version
    GNU Make 4.0
    Built for x86_64-pc-linux-gnu
    Copyright (C) 1988-2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <    http://gnu.org/licenses/gpl.html    >
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    ianc@cosworth    :committer-amd64.git$ git clean -fdqx xen/
    ianc@cosworth    :committer-amd64.git$ make -j12 xen -s
     __  __            _  _   _____                  _        _     _      
     \ \/ /___ _ __   | || | |___  | _   _ _ __  ___| |_ __ _| |__ | | ___ 
      \  // _ \ '_ \  | || |_   / /_| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
      /  \  __/ | | | |__   _| / /__| |_| | | | \__ \ || (_| | |_) | |  __/
     /_/\_\___|_| |_|    |_|(_)_/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
                                                                           
    ianc@cosworth    :committer-amd64.git$ find xen -name .\*compat\*
    xen/arch/x86/.compat.o.d
    xen/arch/x86/x86_64/.compat.o.d
    xen/arch/x86/efi/.compat.o.d
    ianc@cosworth    :committer-amd64.git$ git grep -A4 define.gendep xen/Rules.mk
    xen/Rules.mk:define gendep
    xen/Rules.mk-    ifneq ($(1),$(subst /,:,$(1)))
    xen/Rules.mk-        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
    xen/Rules.mk-    endif
    xen/Rules.mk-endef

Maybe the behaviour of basename varies with make versions?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-26  9:51     ` Ian Campbell
@ 2015-11-26 10:38       ` Jan Beulich
  2015-11-26 10:47         ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2015-11-26 10:38 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Jonathan Creekmore, Tim Deegan, Keir Fraser, Ian Jackson, xen-devel

>>> On 26.11.15 at 10:51, <ian.campbell@citrix.com> wrote:
> On Thu, 2015-11-26 at 00:43 -0700, Jan Beulich wrote:
>> > > > On 25.11.15 at 17:26, <ian.campbell@citrix.com> wrote:
>> > On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
>> > > The use of $(basename ...) here was wrong (yet I'm sure I tested it).
>> > 
>> > Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really to
>> > be
>> > xen/arch/x86/.x86_64.compat.o.d?
>> 
>> No, xen/arch/x86/x86_64/.compat.o.d is the correct name. Just
>> that $(dir $(1)).$(basename $(notdir $(1))).d produces
>> xen/arch/x86/x86_64/.compat.d (i.e. strips the .o, which is not in
>> line with $(@D)/.$(@F).d used to generate those files), and hence
>> neither dependency tracking nor cleaning work.
> 
> My tree, which was last built with 98b69a010c24 has:
> 
>     ianc@cosworth    :committer-amd64.git$ find xen -name .\*compat\*
>     xen/arch/x86/.compat.o.d
>     xen/arch/x86/x86_64/.compat.o.d
>     xen/arch/x86/efi/.compat.o.d
>     ianc@cosworth    :committer-amd64.git$ 
> 
> Which is very odd, since the prevailing xen/Rules.mk has:
> 
>     define gendep
>         ifneq ($(1),$(subst /,:,$(1)))
>             DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
>         endif
>     endef
> 
> Which I agree looks as if it should have stripped the .o as you describe,
> but it seems not to have done so. AIUI makes "basename" differs from the
> CLI basename(1) in that the make one will always strip 

You're looking at the wrong thing I'm afraid: How the files get named
depends on the $(@D)/.$(@F).d thing in CFLAGS. What gets put in
$(DEPS) (and hence gets included) depends on the construct above.
So the correctly named files get generated, but they get neither
included for proper dependency checking, nor would they get
deleted by the "clean" rule. And since the inclusion of $(DEPS) has a
minus sign in front, make wouldn't complain about not finding these
files.

Jan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-26 10:38       ` Jan Beulich
@ 2015-11-26 10:47         ` Ian Campbell
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-11-26 10:47 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Jonathan Creekmore, Tim Deegan, Keir Fraser, Ian Jackson, xen-devel

On Thu, 2015-11-26 at 03:38 -0700, Jan Beulich wrote:
> > > > On 26.11.15 at 10:51, <ian.campbell@citrix.com> wrote:
> > On Thu, 2015-11-26 at 00:43 -0700, Jan Beulich wrote:
> > > > > > On 25.11.15 at 17:26, <ian.campbell@citrix.com> wrote:
> > > > On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
> > > > > The use of $(basename ...) here was wrong (yet I'm sure I tested
> > > > > it).
> > > > 
> > > > Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really
> > > > to
> > > > be
> > > > xen/arch/x86/.x86_64.compat.o.d?
> > > 
> > > No, xen/arch/x86/x86_64/.compat.o.d is the correct name. Just
> > > that $(dir $(1)).$(basename $(notdir $(1))).d produces
> > > xen/arch/x86/x86_64/.compat.d (i.e. strips the .o, which is not in
> > > line with $(@D)/.$(@F).d used to generate those files), and hence
> > > neither dependency tracking nor cleaning work.
> > 
> > My tree, which was last built with 98b69a010c24 has:
> > 
> >     ianc@cosworth    :committer-amd64.git$ find xen -name .\*compat\*
> >     xen/arch/x86/.compat.o.d
> >     xen/arch/x86/x86_64/.compat.o.d
> >     xen/arch/x86/efi/.compat.o.d
> >     ianc@cosworth    :committer-amd64.git$ 
> > 
> > Which is very odd, since the prevailing xen/Rules.mk has:
> > 
> >     define gendep
> >         ifneq ($(1),$(subst /,:,$(1)))
> >             DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
> >         endif
> >     endef
> > 
> > Which I agree looks as if it should have stripped the .o as you
> > describe,
> > but it seems not to have done so. AIUI makes "basename" differs from
> > the
> > CLI basename(1) in that the make one will always strip 
> 
> You're looking at the wrong thing I'm afraid: How the files get named
> depends on the $(@D)/.$(@F).d thing in CFLAGS. What gets put in
> $(DEPS) (and hence gets included) depends on the construct above.
> So the correctly named files get generated, but they get neither
> included for proper dependency checking, nor would they get
> deleted by the "clean" rule. And since the inclusion of $(DEPS) has a
> minus sign in front, make wouldn't complain about not finding these
> files.

Aha, gotcha now:

$ make clean
[...]
make[3]: Leaving directory '/local/scratch/ianc/devel/committer-amd64.git/xen/arch/x86/x86_64'
rm -f *.o *~ core .*.d x86_64/.compat.d x86_64/.mm.d x86_64/.physdev.d x86_64/.platform_hypercall.d

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-25 16:16 [PATCH] build: fix dependencies for files compiled from their parent directory Jan Beulich
  2015-11-25 16:26 ` Ian Campbell
@ 2015-11-30 16:31 ` Jonathan Creekmore
  2015-11-30 16:36   ` Jan Beulich
  1 sibling, 1 reply; 8+ messages in thread
From: Jonathan Creekmore @ 2015-11-30 16:31 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Ian Campbell, xen-devel, Keir Fraser, Ian Jackson, Tim Deegan

On Wed, Nov 25, 2015 at 10:16 AM, Jan Beulich <JBeulich@suse.com> wrote:
> The use of $(basename ...) here was wrong (yet I'm sure I tested it).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -105,7 +105,7 @@ include Makefile
>  DEPS = .*.d
>  define gendep
>      ifneq ($(1),$(subst /,:,$(1)))
> -        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
> +        DEPS += $(dir $(1)).$(notdir $(1)).d
>      endif
>  endef
>  $(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))

I finally got a chance to take a look at this patch today and it does fix the
dependency tracking for files in the xen/common/compat directory. However,
it still doesn't do anything to fix the failure to clean the object
files that are
left behind in that directory by 'make clean'. After running it, I still have:

$ find . -name "*.o*"
./common/compat/kernel.o
./common/compat/domain.o
./common/compat/tmem_xen.o
./common/compat/memory.o
./common/compat/multicall.o
./common/compat/xlat.o

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] build: fix dependencies for files compiled from their parent directory
  2015-11-30 16:31 ` Jonathan Creekmore
@ 2015-11-30 16:36   ` Jan Beulich
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Beulich @ 2015-11-30 16:36 UTC (permalink / raw)
  To: Jonathan Creekmore
  Cc: Ian Campbell, xen-devel, Keir Fraser, Ian Jackson, Tim Deegan

>>> On 30.11.15 at 17:31, <jonathan@thecreekmores.org> wrote:
> On Wed, Nov 25, 2015 at 10:16 AM, Jan Beulich <JBeulich@suse.com> wrote:
>> The use of $(basename ...) here was wrong (yet I'm sure I tested it).
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/Rules.mk
>> +++ b/xen/Rules.mk
>> @@ -105,7 +105,7 @@ include Makefile
>>  DEPS = .*.d
>>  define gendep
>>      ifneq ($(1),$(subst /,:,$(1)))
>> -        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
>> +        DEPS += $(dir $(1)).$(notdir $(1)).d
>>      endif
>>  endef
>>  $(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))
> 
> I finally got a chance to take a look at this patch today and it does fix 
> the
> dependency tracking for files in the xen/common/compat directory. However,
> it still doesn't do anything to fix the failure to clean the object
> files that are
> left behind in that directory by 'make clean'. After running it, I still 
> have:
> 
> $ find . -name "*.o*"
> ./common/compat/kernel.o
> ./common/compat/domain.o
> ./common/compat/tmem_xen.o
> ./common/compat/memory.o
> ./common/compat/multicall.o
> ./common/compat/xlat.o

Oh, it wasn't even clear to me that these too are a problem.
Mind contributing another patch?

Jan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-30 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-25 16:16 [PATCH] build: fix dependencies for files compiled from their parent directory Jan Beulich
2015-11-25 16:26 ` Ian Campbell
2015-11-26  7:43   ` Jan Beulich
2015-11-26  9:51     ` Ian Campbell
2015-11-26 10:38       ` Jan Beulich
2015-11-26 10:47         ` Ian Campbell
2015-11-30 16:31 ` Jonathan Creekmore
2015-11-30 16:36   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.