From: tip-bot for Ian Munsie <imunsie@au1.ibm.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
hpa@zytor.com, mingo@redhat.com, a.p.zijlstra@chello.nl,
imunsie@au1.ibm.com, tglx@linutronix.de, tom.leiming@gmail.com,
mingo@elte.hu
Subject: [tip:perf/core] perf makefile: Allow strong and weak functions in LIB_OBJS
Date: Wed, 8 Dec 2010 07:39:53 GMT [thread overview]
Message-ID: <tip-b38aa89600be39b3e10c5b6529aed2e66518598e@git.kernel.org> (raw)
In-Reply-To: <1290991642-sup-5890@au1.ibm.com>
Commit-ID: b38aa89600be39b3e10c5b6529aed2e66518598e
Gitweb: http://git.kernel.org/tip/b38aa89600be39b3e10c5b6529aed2e66518598e
Author: Ian Munsie <imunsie@au1.ibm.com>
AuthorDate: Mon, 29 Nov 2010 11:53:07 +1100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 7 Dec 2010 11:58:50 -0200
perf makefile: Allow strong and weak functions in LIB_OBJS
When we build perf we place all of the .o files from the library files
(util, arch/x/util, etc) into libperf.a which is then linked into perf.
The problem is that the linker will by default only consider .o files
within the .a archive if they are necessary to satisfy an unresolved
symbol. As weak functions are not unresolved, it will not consider a .o
file from the archive containing the strong versions of weak functions
unless it requires it for another reason.
This patch adds the --whole-archive flags to the linker when passing in
the libperf.a file to ensure that it will consider every .o file in the
archive, not just what it believes that it needs. The end result is that
weak functions can now be overridden by strong variants of them in the
libperf.a file.
Cc: "tom.leiming" <tom.leiming@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1290991642-sup-5890@au1.ibm.com>
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index d88137a..ac6692c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -901,7 +901,7 @@ prefix_SQ = $(subst ','\'',$(prefix))
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
-LIBS = $(PERFLIBS) $(EXTLIBS)
+LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive $(EXTLIBS)
BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
$(COMPAT_CFLAGS)
next prev parent reply other threads:[~2010-12-08 7:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 4:12 [PATCH 1/3] perf: Correct final kernel map guesses Ian Munsie
2010-11-25 4:12 ` [PATCH 2/3] perf: Allow strong and weak functions in LIB_OBJS Ian Munsie
2010-11-26 21:18 ` Arnaldo Carvalho de Melo
2010-11-29 0:53 ` Ian Munsie
2010-12-07 6:42 ` Ian Munsie
2010-12-07 14:55 ` Arnaldo Carvalho de Melo
2010-12-08 7:39 ` tip-bot for Ian Munsie [this message]
2010-11-25 4:12 ` [PATCH 3/3] perf, powerpc: Allow perf test to handle PowerPC symbol naming Ian Munsie
2010-12-10 4:47 ` Ian Munsie
2010-12-12 14:39 ` Arnaldo Carvalho de Melo
2010-12-13 0:30 ` Ian Munsie
2010-11-28 8:34 ` [tip:perf/core] perf symbols: Correct final kernel map guesses tip-bot for Ian Munsie
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=tip-b38aa89600be39b3e10c5b6529aed2e66518598e@git.kernel.org \
--to=imunsie@au1.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
--cc=tom.leiming@gmail.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