Skip to content

Commit 3fb1a96

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
libbpf: Fix build on ppc64le architecture
On ppc64le we get the following warning: In file included from btf_dump.c:16:0: btf_dump.c: In function ‘btf_dump_emit_struct_def’: ../include/linux/kernel.h:20:17: error: comparison of distinct pointer types lacks a cast [-Werror] (void) (&_max1 == &_max2); \ ^ btf_dump.c:882:11: note: in expansion of macro ‘max’ m_sz = max(0LL, btf__resolve_size(d->btf, m->type)); ^~~ Fix by explicitly casting to __s64, which is a return type from btf__resolve_size(). Fixes: 702eddc ("libbpf: Handle GCC built-in types for Arm NEON") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent cf28f3b commit 3fb1a96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/btf_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static void btf_dump_emit_struct_def(struct btf_dump *d,
879879
btf_dump_printf(d, ": %d", m_sz);
880880
off = m_off + m_sz;
881881
} else {
882-
m_sz = max(0LL, btf__resolve_size(d->btf, m->type));
882+
m_sz = max((__s64)0, btf__resolve_size(d->btf, m->type));
883883
off = m_off + m_sz * 8;
884884
}
885885
btf_dump_printf(d, ";");

0 commit comments

Comments
 (0)