diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-05-16 13:49:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-05-17 05:10:42 -0400 |
commit | 8ea58f1e8b11cca3087b294779bf5959bf89cc10 (patch) | |
tree | f592ebbbc54de60d57a4fe780dbe4746c5acfda8 | |
parent | 5a28fc94c9143db766d1ba5480cae82d856ad080 (diff) |
objtool: Allow AR to be overridden with HOSTAR
Currently, this Makefile hardcodes GNU ar, meaning that if it is not
available, there is no way to supply a different one and the build will
fail.
$ make AR=llvm-ar CC=clang LD=ld.lld HOSTAR=llvm-ar HOSTCC=clang \
HOSTLD=ld.lld HOSTLDFLAGS=-fuse-ld=lld defconfig modules_prepare
...
AR /out/tools/objtool/libsubcmd.a
/bin/sh: 1: ar: not found
...
Follow the logic of HOST{CC,LD} and allow the user to specify a
different ar tool via HOSTAR (which is used elsewhere in other
tools/ Makefiles).
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cc: <stable@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/80822a9353926c38fd7a152991c6292491a9d0e8.1558028966.git.jpoimboe@redhat.com
Link: https://github.com/ClangBuiltLinux/linux/issues/481
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | tools/objtool/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 53f8be0f4a1f..88158239622b 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile | |||
@@ -7,11 +7,12 @@ ARCH := x86 | |||
7 | endif | 7 | endif |
8 | 8 | ||
9 | # always use the host compiler | 9 | # always use the host compiler |
10 | HOSTAR ?= ar | ||
10 | HOSTCC ?= gcc | 11 | HOSTCC ?= gcc |
11 | HOSTLD ?= ld | 12 | HOSTLD ?= ld |
13 | AR = $(HOSTAR) | ||
12 | CC = $(HOSTCC) | 14 | CC = $(HOSTCC) |
13 | LD = $(HOSTLD) | 15 | LD = $(HOSTLD) |
14 | AR = ar | ||
15 | 16 | ||
16 | ifeq ($(srctree),) | 17 | ifeq ($(srctree),) |
17 | srctree := $(patsubst %/,%,$(dir $(CURDIR))) | 18 | srctree := $(patsubst %/,%,$(dir $(CURDIR))) |