LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] objtool: Allow AR to be overridden with HOSTAR
@ 2019-05-16 17:49 Josh Poimboeuf
2019-05-17 9:13 ` [tip:core/urgent] " tip-bot for Nathan Chancellor
0 siblings, 1 reply; 6+ messages in thread
From: Josh Poimboeuf @ 2019-05-16 17:49 UTC (permalink / raw)
To: x86
Cc: linux-kernel, Peter Zijlstra, Nathan Chancellor,
Nick Desaulniers, Mukesh Ojha
From: Nathan Chancellor <natechancellor@gmail.com>
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).
Link: https://github.com/ClangBuiltLinux/linux/issues/481
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
tools/objtool/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
endif
# always use the host compiler
+HOSTAR ?= ar
HOSTCC ?= gcc
HOSTLD ?= ld
+AR = $(HOSTAR)
CC = $(HOSTCC)
LD = $(HOSTLD)
-AR = ar
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:core/urgent] objtool: Allow AR to be overridden with HOSTAR
2019-05-16 17:49 [PATCH] objtool: Allow AR to be overridden with HOSTAR Josh Poimboeuf
@ 2019-05-17 9:13 ` tip-bot for Nathan Chancellor
0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Nathan Chancellor @ 2019-05-17 9:13 UTC (permalink / raw)
To: linux-tip-commits
Cc: tglx, peterz, jpoimboe, ndesaulniers, mingo, linux-kernel,
torvalds, hpa, mojha, natechancellor, stable
Commit-ID: 8ea58f1e8b11cca3087b294779bf5959bf89cc10
Gitweb: https://git.kernel.org/tip/8ea58f1e8b11cca3087b294779bf5959bf89cc10
Author: Nathan Chancellor <natechancellor@gmail.com>
AuthorDate: Thu, 16 May 2019 12:49:42 -0500
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 17 May 2019 11:10:42 +0200
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>
---
tools/objtool/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
endif
# always use the host compiler
+HOSTAR ?= ar
HOSTCC ?= gcc
HOSTLD ?= ld
+AR = $(HOSTAR)
CC = $(HOSTCC)
LD = $(HOSTLD)
-AR = ar
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] objtool: Allow AR to be overridden with HOSTAR
2019-05-14 22:40 [PATCH] " Nathan Chancellor
2019-05-14 22:46 ` Nick Desaulniers
2019-05-15 12:35 ` Mukesh Ojha
@ 2019-05-15 15:18 ` Josh Poimboeuf
2 siblings, 0 replies; 6+ messages in thread
From: Josh Poimboeuf @ 2019-05-15 15:18 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Peter Zijlstra, Nick Desaulniers, clang-built-linux, linux-kernel
On Tue, May 14, 2019 at 03:40:47PM -0700, Nathan Chancellor wrote:
> 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).
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/481
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Thanks Nathan. I'll send it along to the tip tree.
--
Josh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] objtool: Allow AR to be overridden with HOSTAR
2019-05-14 22:40 [PATCH] " Nathan Chancellor
2019-05-14 22:46 ` Nick Desaulniers
@ 2019-05-15 12:35 ` Mukesh Ojha
2019-05-15 15:18 ` Josh Poimboeuf
2 siblings, 0 replies; 6+ messages in thread
From: Mukesh Ojha @ 2019-05-15 12:35 UTC (permalink / raw)
To: Nathan Chancellor, Josh Poimboeuf, Peter Zijlstra
Cc: Nick Desaulniers, clang-built-linux, linux-kernel
On 5/15/2019 4:10 AM, Nathan Chancellor wrote:
> 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).
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/481
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Nice catch.
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> tools/objtool/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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
> endif
>
> # always use the host compiler
> +HOSTAR ?= ar
> HOSTCC ?= gcc
> HOSTLD ?= ld
> +AR = $(HOSTAR)
> CC = $(HOSTCC)
> LD = $(HOSTLD)
> -AR = ar
>
> ifeq ($(srctree),)
> srctree := $(patsubst %/,%,$(dir $(CURDIR)))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] objtool: Allow AR to be overridden with HOSTAR
2019-05-14 22:40 [PATCH] " Nathan Chancellor
@ 2019-05-14 22:46 ` Nick Desaulniers
2019-05-15 12:35 ` Mukesh Ojha
2019-05-15 15:18 ` Josh Poimboeuf
2 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2019-05-14 22:46 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Josh Poimboeuf, Peter Zijlstra, clang-built-linux, LKML,
Masahiro Yamada, Linux Kbuild mailing list
.On Tue, May 14, 2019 at 3:41 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> 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).
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/481
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> tools/objtool/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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
> endif
>
> # always use the host compiler
> +HOSTAR ?= ar
> HOSTCC ?= gcc
> HOSTLD ?= ld
> +AR = $(HOSTAR)
> CC = $(HOSTCC)
> LD = $(HOSTLD)
> -AR = ar
+ Kbuild
Seems to match what's going on in tools/perf/Makefile.perf and
tools/build/Makefile. Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] objtool: Allow AR to be overridden with HOSTAR
@ 2019-05-14 22:40 Nathan Chancellor
2019-05-14 22:46 ` Nick Desaulniers
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Nathan Chancellor @ 2019-05-14 22:40 UTC (permalink / raw)
To: Josh Poimboeuf, Peter Zijlstra
Cc: Nick Desaulniers, clang-built-linux, linux-kernel, Nathan Chancellor
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).
Link: https://github.com/ClangBuiltLinux/linux/issues/481
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
tools/objtool/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
endif
# always use the host compiler
+HOSTAR ?= ar
HOSTCC ?= gcc
HOSTLD ?= ld
+AR = $(HOSTAR)
CC = $(HOSTCC)
LD = $(HOSTLD)
-AR = ar
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
--
2.22.0.rc0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-17 9:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 17:49 [PATCH] objtool: Allow AR to be overridden with HOSTAR Josh Poimboeuf
2019-05-17 9:13 ` [tip:core/urgent] " tip-bot for Nathan Chancellor
-- strict thread matches above, loose matches on Subject: below --
2019-05-14 22:40 [PATCH] " Nathan Chancellor
2019-05-14 22:46 ` Nick Desaulniers
2019-05-15 12:35 ` Mukesh Ojha
2019-05-15 15:18 ` Josh Poimboeuf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).