diff mbox series

[bpf-next,v2,1/2] selftests/bpf: Add missing system defines for mips

Message ID f3cfceaf5299cdd2ac0e0a36072d6ca7be23e603.1721692479.git.tony.ambardar@gmail.com (mailing list archive)
State Accepted
Commit c7ad90736763b4e6bed10788ec07020a4f15dc32
Headers show
Series selftests/bpf: Add support for MIPS systems | expand

Commit Message

Tony Ambardar July 23, 2024, 12:13 a.m. UTC
From: Tony Ambardar <tony.ambardar@gmail.com>

Update get_sys_includes in Makefile with missing MIPS-related definitions
to fix many, many compilation errors building selftests/bpf. The following
added defines drive conditional logic in system headers for word-size and
endianness selection:

  MIPSEL, MIPSEB
  _MIPS_SZPTR
  _MIPS_SZLONG
  _MIPS_SIM, _ABIO32, _ABIN32, _ABI64

Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 23, 2024, 8:20 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon, 22 Jul 2024 17:13:28 -0700 you wrote:
> From: Tony Ambardar <tony.ambardar@gmail.com>
> 
> Update get_sys_includes in Makefile with missing MIPS-related definitions
> to fix many, many compilation errors building selftests/bpf. The following
> added defines drive conditional logic in system headers for word-size and
> endianness selection:
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/2] selftests/bpf: Add missing system defines for mips
    https://git.kernel.org/bpf/bpf-next/c/84b4e873b10a
  - [bpf-next,v2,2/2] selftests/bpf: Fix error linking uprobe_multi on mips
    https://git.kernel.org/bpf/bpf-next/c/64d50da31564

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 3b638069446d..11fdf126cb7c 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -396,7 +396,8 @@  define get_sys_includes
 $(shell $(1) $(2) -v -E - </dev/null 2>&1 \
 	| sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \
 $(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}') \
-$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}')
+$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}') \
+$(shell $(1) $(2) -dM -E - </dev/null | grep -E 'MIPS(EL|EB)|_MIPS_SZ(PTR|LONG) |_MIPS_SIM |_ABI(O32|N32|64) ' | awk '{printf("-D%s=%s ", $$2, $$3)}')
 endef
 
 # Determine target endianness.