Selaa lähdekoodia

btf: append -std=gnu11 to resolve_btfids CFLAGS to fix libsubcmd C89 error

KBUILD_HOSTCFLAGS carries -std=gnu89; threading it into libsubcmd via
EXTRA_CFLAGS overrides libsubcmd's own -std=gnu99. This broke parse-options.c
(uses C99 'for (int i=...)' decls) on sublevels <= 226 under -Werror.

Appending -std=gnu11 as the last std flag in resolve_btfids CFLAGS makes it
win in clang, fixing the build for all sublevels regardless of source drift.
TheWildJames 1 kuukausi sitten
vanhempi
sitoutus
b2dcb5a07e

+ 7 - 1
.github/actions/btf/patches/0002-resolve_btfids-inherit-host-linker-flags.patch

@@ -9,7 +9,7 @@
  
  OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
  
-@@ -45,9 +47,10 @@
+@@ -45,13 +47,15 @@
  	$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
  
  $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)/libbpf
@@ -22,3 +22,9 @@
            -I$(srctree)/tools/include \
            -I$(srctree)/tools/include/uapi \
            -I$(LIBBPF_SRC) \
+-          -I$(SUBCMD_SRC)
++          -I$(SUBCMD_SRC) \
++          -std=gnu11
+ 
+ LIBS = -lelf -lz
+