From: Sam Ravnborg <sam@ravnborg.org>
To: Roland McGrath <roland@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>,
Alan Modra <amodra@bigpond.net.au>,
David Miller <davem@davemloft.net>, Adrian Bunk <bunk@stusta.de>,
linux-kernel@vger.kernel.org
Subject: Re: "build-id" changes break sparc64
Date: Mon, 23 Jul 2007 10:14:35 +0200 [thread overview]
Message-ID: <20070723081435.GA4644@uranus.ravnborg.org> (raw)
In-Reply-To: <20070723072613.E3A504D0489@magilla.localdomain>
On Mon, Jul 23, 2007 at 12:26:13AM -0700, Roland McGrath wrote:
> > Should be doable without to much pain.
> > Alan can you please share with us exactly why this is better and what we may
> > run into of problems doing so.
> > A sample script would be nice too....
>
> This about does it. Polish left as an exercise to the reader.
> ld does "interesting" things if the linker scripts are inside --start-group.
Thanks - will take a look during the week.
I will most likely rename built-in.o to something else and reflect this
in Makefile.build. Just to make it clear this is now a linker script file.
But I would still like to hear from Alan what the benefits are.
I foresee that with this change it will take longer to build a kernel
after a single change but that a full kernel build is shorter.
And thats the wrong way to optimze...
Sam
>
> diff --git a/Makefile b/Makefile
> index cd47845..0000000 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -613,12 +613,15 @@ vmlinux-all := $(vmlinux-init) $(vmlinu
> vmlinux-lds := arch/$(ARCH)/kernel/vmlinux.lds
> export KBUILD_VMLINUX_OBJS := $(vmlinux-all)
>
> +vmlinux-link-main = $(filter-out %.a,$(vmlinux-main)) \
> + --start-group $(filter %.a,$(vmlinux-main)) --end-group
> +
> # Rule to link vmlinux - also used during CONFIG_KALLSYMS
> # May be overridden by arch/$(ARCH)/Makefile
> quiet_cmd_vmlinux__ ?= LD $@
> cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
> -T $(vmlinux-lds) $(vmlinux-init) \
> - --start-group $(vmlinux-main) --end-group \
> + $(vmlinux-link-main) \
> $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
>
> # Generate new vmlinux version
> @@ -747,7 +750,7 @@ endif # ifdef CONFIG_KALLSYMS
> # relevant sections renamed as per the linker script.
> quiet_cmd_vmlinux-modpost = LD $@
> cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \
> - $(vmlinux-init) --start-group $(vmlinux-main) --end-group \
> + $(vmlinux-init) $(vmlinux-link-main) \
> $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^)
> define rule_vmlinux-modpost
> :
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 3f7b451..0000000 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -274,11 +274,11 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ;
> # Rule to compile a set of .o files into one .o file
> #
> ifdef builtin-target
> -quiet_cmd_link_o_target = LD $@
> +quiet_cmd_link_o_target = LDS $@
> # If the list of objects to link is empty, just create an empty built-in.o
> -cmd_link_o_target = $(if $(strip $(obj-y)),\
> - $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
> - rm -f $@; $(AR) rcs $@)
> +cmd_link_o_target = echo > $@.new $(if $(strip $(obj-y)),\
> + 'INPUT($(filter $(obj-y), $^))') && \
> + mv -f $@.new $@
>
> $(builtin-target): $(obj-y) FORCE
> $(call if_changed,link_o_target)
> @@ -311,11 +311,11 @@ $(filter $(addprefix $(obj)/, \
> $($(subst $(obj)/,,$(@:.o=-objs))) \
> $($(subst $(obj)/,,$(@:.o=-y)))), $^)
>
> -quiet_cmd_link_multi-y = LD $@
> -cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
> +quiet_cmd_link_multi-y = LDS $@
> +cmd_link_multi-y = echo > $@.new 'INPUT($(link_multi_deps))' && mv -f $@.new $@
>
> quiet_cmd_link_multi-m = LD [M] $@
> -cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
> +cmd_link_multi-m = $(cmd_link_multi-y)
This signel change looks wrong. We do not want to generate a linker
script for modules.
Sam
next prev parent reply other threads:[~2007-07-23 8:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-22 8:23 David Miller
2007-07-22 8:59 ` Roland McGrath
2007-07-23 2:18 ` David Miller
2007-07-23 6:01 ` Roland McGrath
2007-07-23 6:13 ` Paul Mackerras
2007-07-23 6:27 ` Sam Ravnborg
2007-07-23 7:26 ` Roland McGrath
2007-07-23 8:14 ` Sam Ravnborg [this message]
2007-07-23 8:18 ` Roland McGrath
2007-07-23 8:24 ` Sam Ravnborg
2007-07-23 9:25 ` Alan Modra
2007-07-23 11:49 ` Al Viro
2007-07-23 18:00 ` Sam Ravnborg
2007-07-23 18:56 ` Al Viro
2007-07-23 19:13 ` Adrian Bunk
2007-07-23 19:12 ` Roland McGrath
2007-07-23 19:39 ` Al Viro
2007-07-23 20:05 ` Roland McGrath
2007-07-23 20:33 ` Sam Ravnborg
2007-07-23 6:14 ` [PATCH] Move --build-id option Roland McGrath
2007-07-23 6:42 ` Sam Ravnborg
2007-07-23 8:09 ` Roland McGrath
2007-07-23 8:12 ` [PATCH] Use LDFLAGS_MODULE only for .ko links Roland McGrath
2007-07-23 8:16 ` Sam Ravnborg
2007-07-23 6:22 ` "build-id" changes break sparc64 Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070723081435.GA4644@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=amodra@bigpond.net.au \
--cc=bunk@stusta.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome