public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* arch/x86/kernel/acpi/realmode/Makefile
@ 2008-05-01  1:05 Roland McGrath
  2008-05-01  9:31 ` [PATCH] fix rebuild of wakeup.bin Sam Ravnborg
  2008-05-01  9:39 ` arch/x86/kernel/acpi/realmode/Makefile Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Roland McGrath @ 2008-05-01  1:05 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Pavel Machek, linux-kernel

I noticed that arch/x86/kernel/acpi/realmode/wakeup.lds was being remade on
every make.  A run with V=2 nicely told me why.  I did what it told me:

--- a/arch/x86/kernel/acpi/realmode/Makefile
+++ b/arch/x86/kernel/acpi/realmode/Makefile
@@ -6,7 +6,7 @@
 # for more details.
 #
 
-targets		:= wakeup.bin wakeup.elf
+targets		:= wakeup.bin wakeup.elf wakeup.lds
 
 wakeup-y	+= wakeup.o wakemain.o video-mode.o copy.o
 

That made it no longer rebuild that stuff every time.
But now it says:

make[5]: `arch/x86/kernel/acpi/realmode/wakeup.bin' is up to date.
  LD      vmlinux.o - due to: init/built-in.o

and still relinks the kernel on every make run.  

Can you figure it out, please?  "make; make" should not relink.


Thanks,
Roland

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

* [PATCH] fix rebuild of wakeup.bin
  2008-05-01  1:05 arch/x86/kernel/acpi/realmode/Makefile Roland McGrath
@ 2008-05-01  9:31 ` Sam Ravnborg
  2008-05-01 10:48   ` Rafael J. Wysocki
  2008-05-01  9:39 ` arch/x86/kernel/acpi/realmode/Makefile Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2008-05-01  9:31 UTC (permalink / raw)
  To: Roland McGrath, Ingo Molnar
  Cc: Pavel Machek, linux-kernel, Rafael J. Wysocki, Thomas Gleixner,
	H. Peter Anvin, Ingo Molnar, Roland McGrath

In kernel/acpi/realmode/Makefile use the 'always'
variable to say that wakeup.bin should always
be made.

In acpi/Makefile we then do not need to specify the
requested target and we avoid the message from make:

   `arch/x86/kernel/acpi/realmode/wakeup.bin' is up to date.

Add wakeup.lds to list af targets to avoid rebuilding
wakeup.bin - from Roland McGrath.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Pavel Machek <pavel@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de> 
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>
---
diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile
index 7335959..fd5ca97 100644
--- a/arch/x86/kernel/acpi/Makefile
+++ b/arch/x86/kernel/acpi/Makefile
@@ -10,5 +10,5 @@ endif
 $(obj)/wakeup_rm.o:    $(obj)/realmode/wakeup.bin
 
 $(obj)/realmode/wakeup.bin: FORCE
-	$(Q)$(MAKE) $(build)=$(obj)/realmode $@
+	$(Q)$(MAKE) $(build)=$(obj)/realmode
 
diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile
index 0929008..1c31cc0 100644
--- a/arch/x86/kernel/acpi/realmode/Makefile
+++ b/arch/x86/kernel/acpi/realmode/Makefile
@@ -6,7 +6,8 @@
 # for more details.
 #
 
-targets		:= wakeup.bin wakeup.elf
+always		:= wakeup.bin
+targets		:= wakeup.elf wakeup.lds
 
 wakeup-y	+= wakeup.o wakemain.o video-mode.o copy.o
 
@@ -48,7 +49,7 @@ LDFLAGS_wakeup.elf	:= -T
 
 CPPFLAGS_wakeup.lds += -P -C
 
-$(obj)/wakeup.elf: $(src)/wakeup.lds $(WAKEUP_OBJS) FORCE
+$(obj)/wakeup.elf: $(obj)/wakeup.lds $(WAKEUP_OBJS) FORCE
 	$(call if_changed,ld)
 
 OBJCOPYFLAGS_wakeup.bin	:= -O binary

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

* Re: arch/x86/kernel/acpi/realmode/Makefile
  2008-05-01  1:05 arch/x86/kernel/acpi/realmode/Makefile Roland McGrath
  2008-05-01  9:31 ` [PATCH] fix rebuild of wakeup.bin Sam Ravnborg
@ 2008-05-01  9:39 ` Sam Ravnborg
  1 sibling, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2008-05-01  9:39 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Pavel Machek, linux-kernel

On Wed, Apr 30, 2008 at 06:05:16PM -0700, Roland McGrath wrote:
> I noticed that arch/x86/kernel/acpi/realmode/wakeup.lds was being remade on
> every make.

We have an additional bug where we always do a link of vmlinux.
Testing the following patch atm:

diff --git a/Makefile b/Makefile
index d3634cd..5cf8258 100644
--- a/Makefile
+++ b/Makefile
@@ -794,7 +794,7 @@ endif # ifdef CONFIG_KALLSYMS
 quiet_cmd_vmlinux-modpost = LD      $@
       cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@                          \
 	 $(vmlinux-init) --start-group $(vmlinux-main) --end-group             \
-	 $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^)
+	 $(filter-out $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
 define rule_vmlinux-modpost
 	:
 	+$(call cmd,vmlinux-modpost)
@@ -818,7 +818,9 @@ endif
 ifdef CONFIG_KALLSYMS
 .tmp_vmlinux1: vmlinux.o
 endif
-vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE
+
+modpost-init := $(filter-out init/built-in.o, $(vmlinux-init))
+vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
 	$(call if_changed_rule,vmlinux-modpost)
 
 # The actual objects are generated when descending, 

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

* Re: [PATCH] fix rebuild of wakeup.bin
  2008-05-01  9:31 ` [PATCH] fix rebuild of wakeup.bin Sam Ravnborg
@ 2008-05-01 10:48   ` Rafael J. Wysocki
  2008-05-03 18:06     ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2008-05-01 10:48 UTC (permalink / raw)
  To: Sam Ravnborg, Ingo Molnar
  Cc: Roland McGrath, Pavel Machek, linux-kernel, Thomas Gleixner,
	H. Peter Anvin

On Thursday, 1 of May 2008, Sam Ravnborg wrote:
> In kernel/acpi/realmode/Makefile use the 'always'
> variable to say that wakeup.bin should always
> be made.
> 
> In acpi/Makefile we then do not need to specify the
> requested target and we avoid the message from make:
> 
>    `arch/x86/kernel/acpi/realmode/wakeup.bin' is up to date.
> 
> Add wakeup.lds to list af targets to avoid rebuilding
> wakeup.bin - from Roland McGrath.

Thanks for fixing this!

Ingo, please merge.

> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Pavel Machek <pavel@suse.cz>
> Cc: Thomas Gleixner <tglx@linutronix.de> 
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Roland McGrath <roland@redhat.com>
> ---
> diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile
> index 7335959..fd5ca97 100644
> --- a/arch/x86/kernel/acpi/Makefile
> +++ b/arch/x86/kernel/acpi/Makefile
> @@ -10,5 +10,5 @@ endif
>  $(obj)/wakeup_rm.o:    $(obj)/realmode/wakeup.bin
>  
>  $(obj)/realmode/wakeup.bin: FORCE
> -	$(Q)$(MAKE) $(build)=$(obj)/realmode $@
> +	$(Q)$(MAKE) $(build)=$(obj)/realmode
>  
> diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile
> index 0929008..1c31cc0 100644
> --- a/arch/x86/kernel/acpi/realmode/Makefile
> +++ b/arch/x86/kernel/acpi/realmode/Makefile
> @@ -6,7 +6,8 @@
>  # for more details.
>  #
>  
> -targets		:= wakeup.bin wakeup.elf
> +always		:= wakeup.bin
> +targets		:= wakeup.elf wakeup.lds
>  
>  wakeup-y	+= wakeup.o wakemain.o video-mode.o copy.o
>  
> @@ -48,7 +49,7 @@ LDFLAGS_wakeup.elf	:= -T
>  
>  CPPFLAGS_wakeup.lds += -P -C
>  
> -$(obj)/wakeup.elf: $(src)/wakeup.lds $(WAKEUP_OBJS) FORCE
> +$(obj)/wakeup.elf: $(obj)/wakeup.lds $(WAKEUP_OBJS) FORCE
>  	$(call if_changed,ld)
>  
>  OBJCOPYFLAGS_wakeup.bin	:= -O binary

Thanks,
Rafael

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

* Re: [PATCH] fix rebuild of wakeup.bin
  2008-05-01 10:48   ` Rafael J. Wysocki
@ 2008-05-03 18:06     ` Ingo Molnar
  2008-05-03 18:15       ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Ingo Molnar @ 2008-05-03 18:06 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Sam Ravnborg, Roland McGrath, Pavel Machek, linux-kernel,
	Thomas Gleixner, H. Peter Anvin


* Rafael J. Wysocki <rjw@sisk.pl> wrote:

> > Add wakeup.lds to list af targets to avoid rebuilding wakeup.bin - 
> > from Roland McGrath.
> 
> Thanks for fixing this!
> 
> Ingo, please merge.

applied - thanks all!

	Ingo

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

* Re: [PATCH] fix rebuild of wakeup.bin
  2008-05-03 18:06     ` Ingo Molnar
@ 2008-05-03 18:15       ` Sam Ravnborg
  2008-05-03 19:41         ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2008-05-03 18:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Rafael J. Wysocki, Roland McGrath, Pavel Machek, linux-kernel,
	Thomas Gleixner, H. Peter Anvin

On Sat, May 03, 2008 at 08:06:12PM +0200, Ingo Molnar wrote:
> 
> * Rafael J. Wysocki <rjw@sisk.pl> wrote:
> 
> > > Add wakeup.lds to list af targets to avoid rebuilding wakeup.bin - 
> > > from Roland McGrath.
> > 
> > Thanks for fixing this!
> > 
> > Ingo, please merge.
> 
> applied - thanks all!

Just a note - I do not think this solves the problem Daniel
has reported with respect to first build of -next.
I am awaiting more data before I can analyse it further.

	Sam

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

* Re: [PATCH] fix rebuild of wakeup.bin
  2008-05-03 18:15       ` Sam Ravnborg
@ 2008-05-03 19:41         ` Ingo Molnar
  2008-05-04  7:21           ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Ingo Molnar @ 2008-05-03 19:41 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Rafael J. Wysocki, Roland McGrath, Pavel Machek, linux-kernel,
	Thomas Gleixner, H. Peter Anvin


* Sam Ravnborg <sam@ravnborg.org> wrote:

> On Sat, May 03, 2008 at 08:06:12PM +0200, Ingo Molnar wrote:
> > 
> > * Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > 
> > > > Add wakeup.lds to list af targets to avoid rebuilding wakeup.bin - 
> > > > from Roland McGrath.
> > > 
> > > Thanks for fixing this!
> > > 
> > > Ingo, please merge.
> > 
> > applied - thanks all!
> 
> Just a note - I do not think this solves the problem Daniel has 
> reported with respect to first build of -next. I am awaiting more data 
> before I can analyse it further.

yeah, i suspected that - that appears to be a race of some sort, i.e. a 
missing dependency coupled with parallelizable rules, not an over-eager 
dependency as fixed by this patch, right?

	Ingo

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

* Re: [PATCH] fix rebuild of wakeup.bin
  2008-05-03 19:41         ` Ingo Molnar
@ 2008-05-04  7:21           ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2008-05-04  7:21 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Rafael J. Wysocki, Roland McGrath, Pavel Machek, linux-kernel,
	Thomas Gleixner, H. Peter Anvin

On Sat, May 03, 2008 at 09:41:49PM +0200, Ingo Molnar wrote:
> 
> * Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > On Sat, May 03, 2008 at 08:06:12PM +0200, Ingo Molnar wrote:
> > > 
> > > * Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > 
> > > > > Add wakeup.lds to list af targets to avoid rebuilding wakeup.bin - 
> > > > > from Roland McGrath.
> > > > 
> > > > Thanks for fixing this!
> > > > 
> > > > Ingo, please merge.
> > > 
> > > applied - thanks all!
> > 
> > Just a note - I do not think this solves the problem Daniel has 
> > reported with respect to first build of -next. I am awaiting more data 
> > before I can analyse it further.
> 
> yeah, i suspected that - that appears to be a race of some sort, i.e. a 
> missing dependency coupled with parallelizable rules, not an over-eager 
> dependency as fixed by this patch, right?

In the end it should be fixed by this patch.
It turned out to be a user rights issue where I assume
wakeup-lds were owned by root because we created it
despite have a fully build kernel.

This also explains why we did not see more reports on the subject.

So please push this fix towards linus soonish.

Thanks,
	Sam

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

end of thread, other threads:[~2008-05-04  7:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01  1:05 arch/x86/kernel/acpi/realmode/Makefile Roland McGrath
2008-05-01  9:31 ` [PATCH] fix rebuild of wakeup.bin Sam Ravnborg
2008-05-01 10:48   ` Rafael J. Wysocki
2008-05-03 18:06     ` Ingo Molnar
2008-05-03 18:15       ` Sam Ravnborg
2008-05-03 19:41         ` Ingo Molnar
2008-05-04  7:21           ` Sam Ravnborg
2008-05-01  9:39 ` arch/x86/kernel/acpi/realmode/Makefile Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox