Blob Blame History Raw
From: Andrii Nakryiko <andrii@kernel.org>
Date: Fri, 22 Oct 2021 12:25:02 -0700
Subject: libbpf: Fix the use of aligned attribute
Patch-mainline: v5.16-rc1
Git-commit: fae1b05e6f0acf116f6450535b0e1c13051102d3
References: jsc#PED-1377

Building libbpf sources out of kernel tree (in Github repo) we run into
compilation error due to unknown __aligned attribute. It must be coming
from some kernel header, which is not available to Github sources. Use
explicit __attribute__((aligned(16))) instead.

Fixes: 961632d54163 ("libbpf: Fix dumping non-aligned __int128")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211022192502.2975553-1-andrii@kernel.org
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 tools/lib/bpf/btf_dump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/lib/bpf/btf_dump.c
+++ b/tools/lib/bpf/btf_dump.c
@@ -1676,7 +1676,7 @@ static int btf_dump_int_data(struct btf_
 {
 	__u8 encoding = btf_int_encoding(t);
 	bool sign = encoding & BTF_INT_SIGNED;
-	char buf[16] __aligned(16);
+	char buf[16] __attribute__((aligned(16)));
 	int sz = t->size;
 
 	if (sz == 0 || sz > sizeof(buf)) {