Skip to content

Commit d7c5b9e

Browse files
viktormalikfmaurer-rh
authored andcommitted
tools/resolve_btfids: Pass HOSTCFLAGS as EXTRA_CFLAGS to prepare targets
Bugzilla: https://bugzilla.redhat.com/2178930 commit 2531ba0 Author: Jiri Olsa <jolsa@kernel.org> Date: Thu Feb 9 15:37:35 2023 +0100 tools/resolve_btfids: Pass HOSTCFLAGS as EXTRA_CFLAGS to prepare targets Thorsten reported build issue with command line that defined extra HOSTCFLAGS that were not passed into 'prepare' targets, but were used to build resolve_btfids objects. This results in build fail when these objects are linked together: /usr/bin/ld: /build.../tools/bpf/resolve_btfids//libbpf/libbpf.a(libbpf-in.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE \ object; recompile with -fPIE Fixing this by passing HOSTCFLAGS in EXTRA_CFLAGS as part of HOST_OVERRIDES variable for prepare targets. [1] https://lore.kernel.org/bpf/f7922132-6645-6316-5675-0ece4197bfff@leemhuis.info/ Fixes: 56a2df7 ("tools/resolve_btfids: Compile resolve_btfids as host program") Reported-by: Thorsten Leemhuis <linux@leemhuis.info> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Tested-by: Thorsten Leemhuis <linux@leemhuis.info> Acked-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/bpf/20230209143735.4112845-1-jolsa@kernel.org Signed-off-by: Viktor Malik <vmalik@redhat.com>
1 parent f5103f5 commit d7c5b9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/resolve_btfids/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endif
1919

2020
# Overrides for the prepare step libraries.
2121
HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(HOSTCC)" LD="$(HOSTLD)" ARCH="$(HOSTARCH)" \
22-
CROSS_COMPILE=""
22+
CROSS_COMPILE="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
2323

2424
RM ?= rm
2525
HOSTCC ?= gcc

0 commit comments

Comments
 (0)