diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-07-14 12:25:34 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 19:20:31 +0200 |
commit | 11bb2f7a45909f4f64afe471875672ae1b84a380 (patch) | |
tree | cef1bd07a1a9a88e3cf568ef9d676a458e30a765 /tools | |
parent | bpf: Fix build for disabled CONFIG_DEBUG_INFO_BTF option (diff) | |
download | linux-11bb2f7a45909f4f64afe471875672ae1b84a380.tar.xz linux-11bb2f7a45909f4f64afe471875672ae1b84a380.zip |
bpf: Fix cross build for CONFIG_DEBUG_INFO_BTF option
Stephen and 0-DAY CI Kernel Test Service reported broken cross build
for arm (arm-linux-gnueabi-gcc (GCC) 9.3.0), with following output:
/tmp/ccMS5uth.s: Assembler messages:
/tmp/ccMS5uth.s:69: Error: unrecognized symbol type ""
/tmp/ccMS5uth.s:82: Error: unrecognized symbol type ""
Having '@object' for .type diretive is wrong because '@' is comment
character for some architectures. Using STT_OBJECT instead that should
work everywhere.
Also using HOST* variables to build resolve_btfids so it's properly
build in crossbuilds (stolen from objtool's Makefile).
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/bpf/20200714102534.299280-2-jolsa@kernel.org
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/resolve_btfids/Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index 948378ca73d4..a88cd4426398 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -16,6 +16,20 @@ else MAKEFLAGS=--no-print-directory endif +# always use the host compiler +ifneq ($(LLVM),) +HOSTAR ?= llvm-ar +HOSTCC ?= clang +HOSTLD ?= ld.lld +else +HOSTAR ?= ar +HOSTCC ?= gcc +HOSTLD ?= ld +endif +AR = $(HOSTAR) +CC = $(HOSTCC) +LD = $(HOSTLD) + OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/ LIBBPF_SRC := $(srctree)/tools/lib/bpf/ |