Prechádzať zdrojové kódy

btf: add resolve_btfids host linker/compiler flag fix for android12-5.10

TheWildJames 1 mesiac pred
rodič
commit
6bbfece326

+ 9 - 1
.github/actions/btf/action.yml

@@ -20,7 +20,15 @@ runs:
       if: ${{ inputs.version == 'android12-5.10' }}
       run: |
         set -euo pipefail
-        patch -p1 < ${{ github.action_path }}/patches/0001-libbpf-remove-feature-detection-BTF.patch
+        patch -p1 -N < ${{ github.action_path }}/patches/0001-libbpf-remove-feature-detection-BTF.patch
+
+    - name: Apply resolve_btfids linker-flag fix (android12-5.10)
+      shell: bash
+      working-directory: ${{ github.workspace }}/kernel/common
+      if: ${{ inputs.version == 'android12-5.10' }}
+      run: |
+        set -euo pipefail
+        patch -p1 -N < ${{ github.action_path }}/patches/0002-resolve_btfids-inherit-host-linker-flags.patch
 
     - name: Enable BTF Config
       uses: ./.github/actions/set-kernel-config

+ 20 - 0
.github/actions/btf/patches/0002-resolve_btfids-inherit-host-linker-flags.patch

@@ -0,0 +1,20 @@
+--- a/tools/bpf/resolve_btfids/Makefile
++++ b/tools/bpf/resolve_btfids/Makefile
+@@ -23,6 +23,8 @@
+ LD       = $(HOSTLD)
+ ARCH     = $(HOSTARCH)
+ RM      ?= rm
++CFLAGS  := $(KBUILD_HOSTCFLAGS)
++LDFLAGS := $(KBUILD_HOSTLDFLAGS)
+ 
+ OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
+ 
+@@ -47,7 +49,7 @@
+ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)/libbpf
+ 	$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC)  OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
+ 
+-CFLAGS := -g \
++CFLAGS += -g \
+           -I$(srctree)/tools/include \
+           -I$(srctree)/tools/include/uapi \
+           -I$(LIBBPF_SRC) \