From: Sam Ravnborg <sam@ravnborg.org>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild <linux-kbuild@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Sam Ravnborg <sam@ravnborg.org>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 2/8] kbuild: refactor final link of sparc32
Date: Sat, 5 May 2012 10:18:40 +0200 [thread overview]
Message-ID: <1336205926-13946-2-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <20120505080640.GA13773@merkur.ravnborg.org>
sparc32 uses an additional final link to support btfix.
Introduce a new set of exported variables in the top-level Makefile
to make the extra linking step simpler.
sparc32 has hardcoded knowledge of kallsyms support. This fix
include support for EXTRA_KALLSYM_PASS=1.
The ugly part is that it is hardcoded in the arch/sparc/boot
Makefile.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
---
Makefile | 5 +++++
arch/sparc/Makefile | 11 -----------
arch/sparc/boot/Makefile | 14 +++++++++-----
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index 1af1b7a..20b0232 100644
--- a/Makefile
+++ b/Makefile
@@ -727,6 +727,11 @@ libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
libs-y := $(libs-y1) $(libs-y2)
+# externally visible symbols
+export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
+export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)
+export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
+
# Build vmlinux
# ---------------------------------------------------------------------------
# vmlinux is built from the objects selected by $(vmlinux-init) and
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index eddcfb3..3195f77 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -72,17 +72,6 @@ libs-y += arch/sparc/lib/
drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
-# Export what is needed by arch/sparc/boot/Makefile
-export VMLINUX_INIT VMLINUX_MAIN
-VMLINUX_INIT := $(head-y) $(init-y)
-VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
-VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
-VMLINUX_MAIN += $(drivers-y) $(net-y)
-
-ifdef CONFIG_KALLSYMS
-export kallsyms.o := .tmp_kallsyms2.o
-endif
-
boot := arch/sparc/boot
# Default target
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index d56d199..78f1994 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -39,11 +39,15 @@ define rule_image
echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
endef
-BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT))
-BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN))
-LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
- --start-group $(BTLIBS) --end-group \
- $(kallsyms.o) $(obj)/btfix.o
+# Support for kallsyms
+kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms2.o
+ifdef KALLSYMS_EXTRA_PASS
+ kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms3.o
+endif
+
+LDFLAGS_image := -T $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) \
+ --start-group $(KBUILD_VMLINUX_MAIN) --end-group \
+ $(kallsyms-y) $(obj)/btfix.o
# Link the final image including btfixup'ed symbols.
# This is a replacement for the link done in the top-level Makefile.
--
1.6.0.6
next prev parent reply other threads:[~2012-05-05 8:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-05 8:06 [PATCH 0/8] kbuild: use script for final link, move definitions out of top-level Makefile Sam Ravnborg
2012-05-05 8:18 ` [PATCH 1/8] kbuild: drop unused KBUILD_VMLINUX_OBJS from " Sam Ravnborg
2012-05-05 8:18 ` Sam Ravnborg [this message]
2012-05-05 8:18 ` [PATCH 3/8] kbuild: link of vmlinux moved to a script Sam Ravnborg
2012-05-05 8:18 ` [PATCH 4/8] kbuild: document KBUILD_LDS, KBUILD_VMLINUX_{INIT,MAIN} and LDFLAGS_vmlinux Sam Ravnborg
2012-05-05 8:18 ` [PATCH 5/8] kbuild: move definitions from top-level Makefile to scripts/Kbuild.config Sam Ravnborg
2012-06-26 9:37 ` Michal Marek
2012-06-26 10:18 ` Michal Marek
2012-05-05 8:18 ` [PATCH 6/8] kbuild: move arch definitions from top-level Makefile to scripts/Kbuild.arch Sam Ravnborg
2012-06-26 10:33 ` Michal Marek
2012-05-05 8:18 ` [PATCH 7/8] kbuild: move W=... stuff to Kbuild.arch Sam Ravnborg
2012-05-05 9:51 ` Artem Bityutskiy
2012-06-06 10:18 ` Artem Bityutskiy
2012-06-06 15:35 ` Sam Ravnborg
2012-06-06 15:46 ` Artem Bityutskiy
2012-08-15 9:41 ` Artem Bityutskiy
2012-08-15 10:17 ` Sam Ravnborg
2012-06-26 10:37 ` Michal Marek
2012-05-05 8:18 ` [PATCH 8/8] kbuild: remove useless warning Sam Ravnborg
2012-05-07 6:59 ` Artem Bityutskiy
2012-06-26 10:40 ` Michal Marek
2012-05-05 19:28 ` [PATCH 0/8] kbuild: use script for final link, move definitions out of top-level Makefile Michal Marek
2012-05-05 21:03 ` Sam Ravnborg
2012-05-16 4:52 ` 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=1336205926-13946-2-git-send-email-sam@ravnborg.org \
--to=sam@ravnborg.org \
--cc=davem@davemloft.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).