Skip to content

Commit 8ea58f1

Browse files
nathanchanceIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Cc: <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/80822a9353926c38fd7a152991c6292491a9d0e8.1558028966.git.jpoimboe@redhat.com Link: ClangBuiltLinux#481 Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5a28fc9 commit 8ea58f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/objtool/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ ARCH := x86
77
endif
88

99
# always use the host compiler
10+
HOSTAR ?= ar
1011
HOSTCC ?= gcc
1112
HOSTLD ?= ld
13+
AR = $(HOSTAR)
1214
CC = $(HOSTCC)
1315
LD = $(HOSTLD)
14-
AR = ar
1516

1617
ifeq ($(srctree),)
1718
srctree := $(patsubst %/,%,$(dir $(CURDIR)))

0 commit comments

Comments
 (0)