arch/x86/kernel/acpi/realmode/Makefile
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:
arch/x86/kernel/acpi/realmode/Makefile +1 -1
@@ -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
PATCH 1/1 fix rebuild of wakeup.bin
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.
---
arch/x86/kernel/acpi/Makefile +1 -1
@@ -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
arch/x86/kernel/acpi/realmode/Makefile +3 -2
@@ -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
Re: [PATCH] fix rebuild of wakeup.bin
Quoted 11 lines · Sam Ravnborg
In
kernel/acpi/realmode/Makefileuse 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.ldsto list af targets to avoid rebuilding wakeup.bin - from Roland McGrath.
Thanks for fixing this!
Ingo, please merge.
Quoted 34 lines
Signed-off-by Sam Ravnborg <[email protected]>Cc Rafael J. Wysocki <[email protected]>Cc Pavel Machek <[email protected]>Cc Thomas Gleixner <[email protected]>Cc H. Peter Anvin <[email protected]>Cc Ingo Molnar <[email protected]>Cc Roland McGrath <[email protected]>---
arch/x86/kernel/acpi/Makefile +1
-1@@ -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)/realmodearch/x86/kernel/acpi/realmode/Makefile +2
-1@@ -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
arch/x86/kernel/acpi/realmode/Makefile LDFLAGS_wakeup.elf := -T · line 55
Quoted 8 lines
arch/x86/kernel/acpi/realmode/Makefile +1
-1@@ -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
Re: [PATCH] fix rebuild of wakeup.bin
Quoted 6 lines · Rafael J. Wysocki
Quoted 2 lines
Add
wakeup.ldsto list af targets to avoid rebuilding wakeup.bin - from Roland McGrath.Thanks for fixing this!
Ingo, please merge.
applied - thanks all!
Ingo
Re: [PATCH] fix rebuild of wakeup.bin
Quoted 11 lines · Ingo Molnar
Quoted 6 lines · Rafael J. Wysocki
Quoted 2 lines
Add
wakeup.ldsto 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
Re: [PATCH] fix rebuild of wakeup.bin
Quoted 9 lines · Sam Ravnborg
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Rafael J. Wysocki
Quoted 2 lines
Add
wakeup.ldsto list af targets to avoid rebuilding wakeup.bin - from Roland McGrath.Thanks for fixing this!
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
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
Re: [PATCH] fix rebuild of wakeup.bin
Quoted 16 lines · Ingo Molnar
Quoted 13 lines · Sam Ravnborg
Quoted 11 lines · Ingo Molnar
Quoted 6 lines · Rafael J. Wysocki
Quoted 2 lines
Add
wakeup.ldsto list af targets to avoid rebuilding wakeup.bin - from Roland McGrath.Thanks for fixing this!
Ingo, please merge.
applied - thanks all!
Quoted 7 lines
Quoted 3 lines
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
Quoted 2 lines · Roland McGrath
I noticed that
arch/x86/kernel/acpi/realmode/wakeup.ldswas being remade on every make.
We have an additional bug where we always do a link of vmlinux. Testing the following patch atm:
Makefile +4 -2
@@ -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,