From: Rabin Vincent <rabin.vincent@axis.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: <jolsa@kernel.org>, <namhyung@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
<linux-kernel@vger.kernel.org>, Rabin Vincent <rabinv@axis.com>
Subject: [PATCHv2 2/3] tools: build: fix libiberty feature detection
Date: Thu, 29 Oct 2015 08:49:37 +0100 [thread overview]
Message-ID: <1446104978-26429-2-git-send-email-rabin.vincent@axis.com> (raw)
In-Reply-To: <1446104978-26429-1-git-send-email-rabin.vincent@axis.com>
Any CFLAGS or LDFLAGS set by the user need to be passed to the feature build
command. This many include for example -I or -L to point to libraries and
include files in custom paths.
In most of the test-*.bin rules in build/feature/Makefile, we use the BUILD
macro which always sends in CFLAGS and LDFLAGS. The libiberty build line
however doesn't use the BUILD macro and thus needs to send in CFLAGS and
LDFLAGS explicitly. Without this, when using custom CFLAGS/LDFLAGS, libiberty
fails to be detected and the perf link fails with something like:
LINK perf
libbfd.a(bfd.o): In function `bfd_errmsg':
bfd.c:(.text+0x168): undefined reference to `xstrerror'
bbfd.a(opncls.o): In function `_bfd_new_bfd':
opncls.c:(.text+0xe8): undefined reference to `objalloc_create'
...
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
---
v2: rewrite commit message
tools/build/feature/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index e43a297..cea04ce9 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -132,10 +132,10 @@ test-libbfd.bin:
$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
test-liberty.bin:
- $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
+ $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
test-liberty-z.bin:
- $(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
+ $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
test-cplus-demangle.bin:
$(BUILD) -liberty
--
1.7.10.4
next prev parent reply other threads:[~2015-10-29 7:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 7:49 [PATCHv2 1/3] perf: unwind: pass symbol source to libunwind Rabin Vincent
2015-10-29 7:49 ` Rabin Vincent [this message]
2015-10-29 20:45 ` [PATCHv2 2/3] tools: build: fix libiberty feature detection Jiri Olsa
2015-10-30 9:14 ` [tip:perf/core] tools build: Fix " tip-bot for Rabin Vincent
2015-10-29 7:49 ` [PATCHv2 3/3] perf: add helper makefile for cross compiling libs Rabin Vincent
2015-10-29 9:46 ` Ingo Molnar
2015-11-06 8:09 ` Rabin Vincent
2015-11-27 11:35 ` Ingo Molnar
2015-10-30 9:15 ` [tip:perf/core] perf unwind: Pass symbol source to libunwind tip-bot for Rabin Vincent
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=1446104978-26429-2-git-send-email-rabin.vincent@axis.com \
--to=rabin.vincent@axis.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=rabinv@axis.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
all inboxes | Powered by JetHome®