public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars
@ 2023-01-10  1:45 James Hilliard
  2023-01-10 10:09 ` Quentin Monnet
  2023-01-10 22:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: James Hilliard @ 2023-01-10  1:45 UTC (permalink / raw)
  To: bpf
  Cc: James Hilliard, Quentin Monnet, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, linux-kernel

When passing compiler variables like CC=$(HOSTCC) to a submake
we must ensure the variable is quoted in order to handle cases
where $(HOSTCC) may be multiple binaries.

For example when using ccache $HOSTCC may be:
"/usr/bin/ccache /usr/bin/gcc"

If we pass CC without quotes like CC=$(HOSTCC) only the first
"/usr/bin/ccache" part will be assigned to the CC variable which
will cause an error due to dropping the "/usr/bin/gcc" part of
the variable in the submake invocation.

This fixes errors such as:
/usr/bin/ccache: invalid option -- 'd'

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 tools/bpf/bpftool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index ab20ecc5acce..d40e31bc4c9d 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -53,7 +53,7 @@ $(LIBBPF_INTERNAL_HDRS): $(LIBBPF_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_HDRS_
 $(LIBBPF_BOOTSTRAP): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_BOOTSTRAP_OUTPUT)
 	$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) \
 		DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) prefix= \
-		ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) AR=$(HOSTAR) $@ install_headers
+		ARCH= CROSS_COMPILE= CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" $@ install_headers
 
 $(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR)
 	$(call QUIET_INSTALL, $@)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars
  2023-01-10  1:45 [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars James Hilliard
@ 2023-01-10 10:09 ` Quentin Monnet
  2023-01-10 22:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Quentin Monnet @ 2023-01-10 10:09 UTC (permalink / raw)
  To: James Hilliard, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, linux-kernel

2023-01-09 18:45 UTC-0700 ~ James Hilliard <james.hilliard1@gmail.com>
> When passing compiler variables like CC=$(HOSTCC) to a submake
> we must ensure the variable is quoted in order to handle cases
> where $(HOSTCC) may be multiple binaries.
> 
> For example when using ccache $HOSTCC may be:
> "/usr/bin/ccache /usr/bin/gcc"
> 
> If we pass CC without quotes like CC=$(HOSTCC) only the first
> "/usr/bin/ccache" part will be assigned to the CC variable which
> will cause an error due to dropping the "/usr/bin/gcc" part of
> the variable in the submake invocation.
> 
> This fixes errors such as:
> /usr/bin/ccache: invalid option -- 'd'
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>


Acked-by: Quentin Monnet <quentin@isovalent.com>

Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars
  2023-01-10  1:45 [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars James Hilliard
  2023-01-10 10:09 ` Quentin Monnet
@ 2023-01-10 22:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-10 22:20 UTC (permalink / raw)
  To: James Hilliard
  Cc: bpf, quentin, ast, daniel, andrii, martin.lau, song, yhs,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Mon,  9 Jan 2023 18:45:04 -0700 you wrote:
> When passing compiler variables like CC=$(HOSTCC) to a submake
> we must ensure the variable is quoted in order to handle cases
> where $(HOSTCC) may be multiple binaries.
> 
> For example when using ccache $HOSTCC may be:
> "/usr/bin/ccache /usr/bin/gcc"
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars
    https://git.kernel.org/bpf/bpf-next/c/af0e26beaa69

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-10 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10  1:45 [PATCH bpf-next] bpftool: Add missing quotes to libbpf bootstrap submake vars James Hilliard
2023-01-10 10:09 ` Quentin Monnet
2023-01-10 22:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox