Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp10120pxk; Wed, 16 Sep 2020 17:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSquZM3lvFl7ZYDqsU6xKHYT+btCQcsL/bSz6xawAVXl/vjGyWjaCVXq2oy+9fyTyS3z3n X-Received: by 2002:a17:906:3759:: with SMTP id e25mr27838731ejc.281.1600302116603; Wed, 16 Sep 2020 17:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600302116; cv=none; d=google.com; s=arc-20160816; b=pQyzZ1rWYMeMubpeA/TDX6TSNSH0Za34lr6QYhO+LVr7KJT/e10NiWWDeUZk8ASMb7 z2qTM11/AJkb10SU9VzRXB2ksNJm9wlyP/itm+dmMCJ6O1rx2i7MI5c0PS1elOaBuyGY XStCNR8bR2nDSIkxdApk8H5r8e+MtpHvvmcncgvWtb9Kg3RVbCx7HrFYqaEfGUgzfxbZ IjIF8KQ1OgLjasIioUagNv3lk0zpQhkUltU8VvlDts2KaIfLRKSUt7IfB5GgU12Gv7wE UTfMRGkmh6rYkP57mQHJ4Wr6PMZNsA2HNGG7sFd+rLEs5ltJKFmO6mvHgjycnrTIYVn8 lcIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Na9A930XnJjifMT8ZHNAvuKYoJPnmdw7X5EjcY4GoqM=; b=CGo1wh6LSWgU/axxqEM1DkJieAOgageGQaUahvvdTgx1oOeIKxyTF9oORPQatQuiKF EIlzC1J/9yveO89ZCtP39WHpNPuQu9pB9Cyq9TdY016sgpZDEUt2Ars8wpF/PfZOr9Q+ 5CXuYEH8QhxwgCMYOqhUJgl6x3Oib6XMyzlAfHFhojE2bfk49/OSXWA3vB77Xmh9LLYm CaUNjGQUS2J2bJ5vazTorx4TvSt+q6MnYctRKxiedf+ixL5SNuF40B/E0F/mn1FZfHo3 xQyIayF74hIBwjaUues0Nsxx8sCzPXSzeQN7bFE326S9OVgYHOvAZf/1WNzue5j9m7r/ 9txw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RmJlwLrT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si15622310edi.341.2020.09.16.17.21.10; Wed, 16 Sep 2020 17:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RmJlwLrT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726040AbgIQASG (ORCPT + 99 others); Wed, 16 Sep 2020 20:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbgIQASA (ORCPT ); Wed, 16 Sep 2020 20:18:00 -0400 X-Greylist: delayed 579 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Sep 2020 20:18:00 EDT Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8836EC061788; Wed, 16 Sep 2020 17:08:19 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id t14so278752pgl.10; Wed, 16 Sep 2020 17:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Na9A930XnJjifMT8ZHNAvuKYoJPnmdw7X5EjcY4GoqM=; b=RmJlwLrTYhvd51TSGpjqRixx9s+/rFs3rOKnJtMPoG5DNNUh6Z++hIYiRWVMqrHsU0 ZlYBR/I4v8f6JQsGCMyLg/tZ98oiVf3aMVGYNIO/XqlrVmbUvPGyeO5YHCnpY7BDZkiJ SBhG7dB+7Ogp5Bf7JyvOK6gRPB78H28J35zqfJYVHsbT4NrJ9Jq4syr+Pw28i2bonZkj nDEKRKolvVvPOjTkZFstsLB4uNumBC+Hjy0jRnnZPMDDxWrSBFtH02UvlNeb2sgNo42Y my+AKtRpfgMx52z5VfePbVNCQga2wAy2jq/TLJarcmwTh66Mx4EvF5I7f67yG2QKnqHa JIHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Na9A930XnJjifMT8ZHNAvuKYoJPnmdw7X5EjcY4GoqM=; b=Xohd0ZHQ/LcK+HmYCP3RiiTsPCJo9dOIs14+/RGPSEbroFlPUzstlBET3+oocT8yk9 HIqZX1oKbM4HGc0dPcn5lQBV+9ciqm3RYwEuieM64bEk8Lfz/qbf9pcsa+BeDOuDZU/U 1A2luA+lB/kTum60vc2FAIsDNwhkXpp6xu8fB6zlVx/OZqJlODtzG3O0TtX5FWWw7tJW REyEUug1D2OyN7sESmm68095kTlUcjVGxpBUyh8ilNFL//h6KN2lvk6Dbs3Co6Jfco6I rFnEPF/qRv93Ywqm15Xby1TrcNgZ2DUdAp99Cz6c0dU4nxmI/xbFi+Y5xv35YvAvXzzx Irpg== X-Gm-Message-State: AOAM533hpYtzkZTx6FXUpbzs9RDEFcZe9IuhkWlBJcbHcFGpTYzee80T wXv+8uLgqC02+1C0aRXXiO4= X-Received: by 2002:a65:6888:: with SMTP id e8mr3241834pgt.375.1600301298990; Wed, 16 Sep 2020 17:08:18 -0700 (PDT) Received: from localhost.localdomain ([2001:470:e92d:10:68d8:fab6:907:5cf6]) by smtp.gmail.com with ESMTPSA id a13sm14300343pfl.184.2020.09.16.17.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 17:08:18 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: Michael Ellerman Cc: Tony Ambardar , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Rosen Penev Subject: [PATCH v2] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h Date: Wed, 16 Sep 2020 17:07:57 -0700 Message-Id: <20200917000757.1232850-1-Tony.Ambardar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200916074214.995128-1-Tony.Ambardar@gmail.com> References: <20200916074214.995128-1-Tony.Ambardar@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 (if using "-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 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 Signed-off-by: Tony Ambardar --- v1 -> v2: * clean up commit description formatting --- arch/powerpc/include/uapi/asm/errno.h | 1 + tools/arch/powerpc/include/uapi/asm/errno.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/powerpc/include/uapi/asm/errno.h b/arch/powerpc/include/uapi/asm/errno.h index cc79856896a1..4ba87de32be0 100644 --- a/arch/powerpc/include/uapi/asm/errno.h +++ b/arch/powerpc/include/uapi/asm/errno.h @@ -2,6 +2,7 @@ #ifndef _ASM_POWERPC_ERRNO_H #define _ASM_POWERPC_ERRNO_H +#undef EDEADLOCK #include #undef EDEADLOCK diff --git a/tools/arch/powerpc/include/uapi/asm/errno.h b/tools/arch/powerpc/include/uapi/asm/errno.h index cc79856896a1..4ba87de32be0 100644 --- 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 #undef EDEADLOCK -- 2.25.1