Initial commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From afe3f4c765b17ced23811fe652c7f7adf7a0c0cf Mon Sep 17 00:00:00 2001
|
||||
From: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
Date: Mon, 14 Sep 2020 23:05:26 -0700
|
||||
Subject: [PATCH] tools/arch/powerpc: fix EDEADLOCK redefinition errors in
|
||||
errno.h
|
||||
|
||||
A few archs like powerpc have different errno.h values for macros
|
||||
EDEADLOCK and EDEADLK. In code including both libc and linux versions of
|
||||
errno.h, this can result in multiple definitions of EDEADLOCK in the
|
||||
include chain. Definitions to the same value (e.g. seen with mips) do
|
||||
not raise warnings, but on powerpc there are redefinitions changing the
|
||||
value, which raise warnings and errors (with "-Werror").
|
||||
|
||||
Guard against these redefinitions to avoid build errors like the following,
|
||||
first seen cross-compiling libbpf v5.8.9 for powerpc using GCC 8.4.0 with
|
||||
musl 1.1.24:
|
||||
|
||||
In file included from ../../arch/powerpc/include/uapi/asm/errno.h:5,
|
||||
from ../../include/linux/err.h:8,
|
||||
from libbpf.c:29:
|
||||
../../include/uapi/asm-generic/errno.h:40: error: "EDEADLOCK" redefined [-Werror]
|
||||
#define EDEADLOCK EDEADLK
|
||||
|
||||
In file included from toolchain-powerpc_8540_gcc-8.4.0_musl/include/errno.h:10,
|
||||
from libbpf.c:26:
|
||||
toolchain-powerpc_8540_gcc-8.4.0_musl/include/bits/errno.h:58: note: this is the location of the previous definition
|
||||
#define EDEADLOCK 58
|
||||
|
||||
cc1: all warnings being treated as errors
|
||||
make[5]: *** [target-powerpc_8540_musl/bpftools-5.8.9/tools/build/Makefile.build:97: /home/kodidev/openwrt-project/build_dir/target-powerpc_8540_musl/bpftools-minimal/bpftools-5.8.9//libbpf/staticobjs/libbpf.o] Error 1
|
||||
|
||||
Fixes: 95f28190aa01 ("tools include arch: Grab a copy of errno.h for arch's
|
||||
supported by perf")
|
||||
Fixes: c3617f72036c ("UAPI: (Scripted) Disintegrate arch/powerpc/include/asm")
|
||||
|
||||
Reported-by: Rosen Penev <rosenp@gmail.com>
|
||||
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
---
|
||||
tools/arch/powerpc/include/uapi/asm/errno.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/tools/arch/powerpc/include/uapi/asm/errno.h
|
||||
+++ b/tools/arch/powerpc/include/uapi/asm/errno.h
|
||||
@@ -2,6 +2,7 @@
|
||||
#ifndef _ASM_POWERPC_ERRNO_H
|
||||
#define _ASM_POWERPC_ERRNO_H
|
||||
|
||||
+#undef EDEADLOCK
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#undef EDEADLOCK
|
||||
20
package/network/utils/bpftools/patches/006-musl-120.patch
Normal file
20
package/network/utils/bpftools/patches/006-musl-120.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/tools/bpf/bpftool/btf_dumper.c
|
||||
+++ b/tools/bpf/bpftool/btf_dumper.c
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdio.h> /* for (FILE *) used by json_writer */
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <linux/compiler.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/btf.h>
|
||||
--- a/tools/bpf/bpftool/map_perf_ring.c
|
||||
+++ b/tools/bpf/bpftool/map_perf_ring.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/bpf.h>
|
||||
+#include <linux/compiler.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
Reference in New Issue
Block a user