From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/23] tools lib lk: Fix for cross build
Date: Wed, 10 Jul 2013 16:19:06 -0300 [thread overview]
Message-ID: <1373483963-19277-7-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1373483963-19277-1-git-send-email-acme@infradead.org>
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Currently, lib lk doesn't use CROSS_COMPILE environment variable, so
cross build always fails.
This is a quick fix for this problem.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1371603750-15053-2-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/lk/Makefile | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile
index 2c5a197..f0ecc0a 100644
--- a/tools/lib/lk/Makefile
+++ b/tools/lib/lk/Makefile
@@ -3,6 +3,21 @@ include ../../scripts/Makefile.include
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
+# Makefiles suck: This macro sets a default value of $(2) for the
+# variable named by $(1), unless the variable has been set by
+# environment or command line. This is necessary for CC and AR
+# because make sets default values, so the simpler ?= approach
+# won't work as expected.
+define allow-override
+ $(if $(or $(findstring environment,$(origin $(1))),\
+ $(findstring command line,$(origin $(1)))),,\
+ $(eval $(1) = $(2)))
+endef
+
+# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
+$(call allow-override,AR,$(CROSS_COMPILE)ar)
+
# guard against environment variables
LIB_H=
LIB_OBJS=
--
1.8.1.4
next prev parent reply other threads:[~2013-07-10 19:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1373483963-19277-1-git-send-email-acme@infradead.org>
2013-07-10 19:19 ` [PATCH 01/23] tools: Get only verbose output with V=1 Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 02/23] perf tools: Fix output directory of Documentation/ Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 03/23] perf tools: Fix build errors with O and DESTDIR make vars set Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 04/23] perf bench: Fix memory allocation fail check in mem{set,cpy} workloads Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 05/23] perf tools: Include termios.h explicitly Arnaldo Carvalho de Melo
2013-07-10 19:19 ` Arnaldo Carvalho de Melo [this message]
2013-07-11 0:34 ` [PATCH 06/23] tools lib lk: Fix for cross build Joonsoo Kim
2013-07-10 19:19 ` [PATCH 07/23] perf stat: Avoid sending SIGTERM to random processes Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 08/23] perf record: Remove -A/--append option Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 09/23] perf record: Remove -f/--force option Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 10/23] perf evlist: Enhance perf_evlist__start_workload() Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 11/23] perf tools: Fix -x/--exclude-other option for report command Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 12/23] perf tools: fix a typo of a Power7 event name Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 13/23] perf evsel: Fix count parameter to read call in event_format__new Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 14/23] perf tools: Fix parse_events_terms() segfault on error path Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 15/23] perf tools: Fix new_term() missing free " Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 16/23] perf tools: Update symbol_conf.nr_events when processing attribute events Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 17/23] perf evsel: Fix missing increment in sample parsing Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 18/23] perf symbols: Fix vdso list searching Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 19/23] perf stat: Fix per-socket output bug for uncore events Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 20/23] perf tools: Fix perf version generation Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 21/23] perf tools: Revert regression in configuration of Python support Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 22/23] perf tools: Fix -ldw/-lelf link test when static linking Arnaldo Carvalho de Melo
2013-07-10 19:19 ` [PATCH 23/23] perf script: Fix broken include in Context.xs Arnaldo Carvalho de Melo
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=1373483963-19277-7-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/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®