From patchwork Tue Apr 26 08:24:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 614830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qvGNT2y6sz9t3b for ; Tue, 26 Apr 2016 18:24:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=0KU5CQxD; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3E7ABB916F7; Tue, 26 Apr 2016 10:24:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Tue, 26 Apr 2016 10:24:35 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9C2F1B916EF for ; Tue, 26 Apr 2016 10:24:33 +0200 (CEST) X-policyd-weight: using cached result; rate: -7 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 26 Apr 2016 10:24:33 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id r12so2295387wme.0 for ; Tue, 26 Apr 2016 01:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=A9FTrJE5kH8fUGTLayDZL2sVjY1L0qqidYPu4u5sjl4=; b=0KU5CQxD/x5py/JbmEiQ9sLHUvI4VdIU7RQmoRfwr0uehtosURes34KyZA9Y99QWO8 TTKxfmWiazz+Cq6zlSbch+8qJOC/POSTUGY/TwCd/aELZkQO57KJ2opqNoUKJjdkTQLw C4RuqT8t9tnbetWQRRUWgVPMgN27Lyi+ZdNfazehTtYPX3ftYpoZHiHK4djwXVdMWo0q Z++MYBgNfJmudPQHr3bAu8GloZtbm1FbKtrI0EAfkftSl7NVpLndXDM56FJja4A3b5pT pwuolvN2M160QCNj57/WbPQrGos8YI65g4OGukvoM5HHn571PEdDz86RVRzt8YROAVON +eMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A9FTrJE5kH8fUGTLayDZL2sVjY1L0qqidYPu4u5sjl4=; b=KD1ItW6Und+TmNGP0anWM7+I2xv2UrYkp01DeDB/hHFAfnF1PvNLSzKbq0Lqzwfb7D lQzstvKYciqxhDI9KOHPc9+asTJ35M078oX4qGaQauzp94SI8xwv8aMrOBp7lG65yCDK 2E9FcDtx4pvzPdPtQAN/f61eJmCcC7fqQBdGBZtwuLY57FrxCQbR9j34f4+RYTxv9UHH jV6AY4XKd9+LCk4y9AONqzHaSafj/BxhEAXqsYXZ6xgMw0eWRbHh2mMZZ6KaagCcD2Wk /wjLCSUdvVBNKpba5ER/we/qGa89dv9T0WdvA+VSpIZenS1WL3HhdOLSJkQobLVz9aca Rt6Q== X-Gm-Message-State: AOPr4FWC8O1PTEk3Ehrk9qAzx8eh0CJ7AOSbXfsklepyjU8feKUh9SVnMtl5Hw4hu4PyjA== X-Received: by 10.194.227.1 with SMTP id rw1mr1529006wjc.62.1461659072627; Tue, 26 Apr 2016 01:24:32 -0700 (PDT) Received: from localhost.localdomain ([5.2.198.78]) by smtp.gmail.com with ESMTPSA id w77sm22667165wmw.10.2016.04.26.01.24.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Apr 2016 01:24:31 -0700 (PDT) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Tue, 26 Apr 2016 11:24:29 +0300 Message-Id: <1461659069-31664-1-git-send-email-ardeleanalex@gmail.com> X-Mailer: git-send-email 2.8.1 Subject: [OpenWrt-Devel] [PATCH] target/linux/mpc85xx: fix EDEADLOCK define collisions with musl X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" libbpf fails to build. perf just emits a warning and carries on. This is a collision between linux's and musl's when building for powerpc. For powerpc, EDEADLOCK has value 58. The initial definition in the kernel include/uapi/asm-generic/errno.h : #define EDEADLOCK EDEADLK Then this gets overriden: arch/powerpc/include/uapi/asm/errno.h : #define EDEADLOCK 58 And in musl: arch/powerpc/bits/errno.h : #define EDEADLOCK 58 There would be 2 ways to solve this: 1. Patch perf, libbpf and other tools to change the inclusion order of 2. Patch the kernel just for the powerpc arch to not re-define EDEADLOCK if defined I chose 2. ======================================================================= Build failure is: CC libbpf.o In file included from /home/sandu/work/Wrt1/openwrt/build_dir/target-powerpc_8540_musl-1.1.14_ewok/linux-mpc85xx_ewok/linux-4.4.6/arch/powerpc/include/uapi/asm/errno.h:4:0, from /home/sandu/work/Wrt1/openwrt/build_dir/target-powerpc_8540_musl-1.1.14_ewok/linux-mpc85xx_ewok/linux-4.4.6/tools/include/linux/err.h:7, from libbpf.h:13, from libbpf.c:24: /home/sandu/work/Wrt1/openwrt/build_dir/target-powerpc_8540_musl-1.1.14_ewok/linux-mpc85xx_ewok/linux-4.4.6/include/uapi/asm-generic/errno.h:39:0: error: "EDEADLOCK" redefined [-Werror] #define EDEADLOCK EDEADLK ^ In file included from /home/sandu/work/Wrt1/openwrt/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/errno.h:10:0, from libbpf.c:16: /home/sandu/work/Wrt1/openwrt/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/bits/errno.h:58:0: note: this is the location of the previous definition #define EDEADLOCK 58 ^ cc1: all warnings being treated as errors CC bpf.o LD libbpf-in.o powerpc-openwrt-linux-musl-ld: cannot find libbpf.o: No such file or directory Signed-off-by: Alexandru Ardelean --- .../301-fix-edeadlock-define-collisions-with-musl.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 target/linux/mpc85xx/patches-4.4/301-fix-edeadlock-define-collisions-with-musl.patch diff --git a/target/linux/mpc85xx/patches-4.4/301-fix-edeadlock-define-collisions-with-musl.patch b/target/linux/mpc85xx/patches-4.4/301-fix-edeadlock-define-collisions-with-musl.patch new file mode 100644 index 0000000..57a35f6 --- /dev/null +++ b/target/linux/mpc85xx/patches-4.4/301-fix-edeadlock-define-collisions-with-musl.patch @@ -0,0 +1,15 @@ +diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h +index 88e0914..7549bec 100644 +--- a/include/uapi/asm-generic/errno.h ++++ b/include/uapi/asm-generic/errno.h +@@ -36,7 +36,9 @@ + #define EBADRQC 56 /* Invalid request code */ + #define EBADSLT 57 /* Invalid slot */ + +-#define EDEADLOCK EDEADLK ++#ifndef EDEADLOCK ++#define EDEADLOCK 58 ++#endif + + #define EBFONT 59 /* Bad font file format */ + #define ENOSTR 60 /* Device not a stream */