Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp437469pxk; Thu, 17 Sep 2020 07:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKA5LIyMKVw8PNjZPtultoWkNdQhxji29P3dlAFz5cEcUzt/KZDDGFB8EkZ0aqoOLgyM/V X-Received: by 2002:aa7:c7c1:: with SMTP id o1mr34370887eds.368.1600351653275; Thu, 17 Sep 2020 07:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600351653; cv=none; d=google.com; s=arc-20160816; b=Hu2XkDYATLGZNXavJak8bm1e2DLyacS18lFHId1dKOEC+0xyJ+fqjWDj2dqywfOFCE oQP/E3t2xT6aSfckXisWLMbvfCY5h26dJgRhkpCJhEWr+KAxI5y9GjHwwLoido9P0IQ0 4CBEUDeXEHB00vfHUete6Q1vHljCJBq6NawtlCNHlSvemlmgP8/jmnhpbByIaUg/r72u mYbfiZkB5qEl2v9gbMxYmHuKfTUYgTmQ9FTF9yrhnJf44E2Wu4kjZb0HU7J+5/wMk+rO H6RajRBEq6Lx1+uOEgxVXGXEcIYrt44gTMBmZ/DmRmQypGKkNVJF0yFp4GXzL08fOZcb OFig== 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=z/K2/i+JXYfZZ5+5bldYLcF42Djb0mZAX58S+kRtJsc=; b=Si1A70GW5H+hcN8YMvjFteNyj9Be3Jv0uZZGGu7PYlGO8tnp4oVniThQ23Qrdr8dcN 1f5uOKcAhie/e2kK82XR1V17gV7ph0IBW/KCzURe1YxVn1v9lCc5yXbhwdu6D7OYQenk j8JUi3fYnx0MPL0JDbf8VsqijKmwp45fO/ETuTdcByc4C9pKSUqPgGRQRtONiFj8XQpq O63K+w6omOH0cGVsYrT2vJJKbVpmGuiKk6a9+3d0TrfbygdH4ZSsOzoHHFR8E/ANjZhe wDZEDmR1JJzhIgwZVNGIdwq2TSGKTgS+VhUWTFV+m96SBQgqP4PV+I8ekxGXVzjQtPyJ kLdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="bogrH/Lc"; 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 o9si13973506ejx.707.2020.09.17.07.06.58; Thu, 17 Sep 2020 07:07:33 -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="bogrH/Lc"; 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 S1727278AbgIQOAu (ORCPT + 99 others); Thu, 17 Sep 2020 10:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgIQNzn (ORCPT ); Thu, 17 Sep 2020 09:55:43 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0836BC061355; Thu, 17 Sep 2020 06:54:52 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id bg9so1176299plb.2; Thu, 17 Sep 2020 06:54:52 -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=z/K2/i+JXYfZZ5+5bldYLcF42Djb0mZAX58S+kRtJsc=; b=bogrH/LctRcjD61IXqaLFLgVpKP+15hGGQXFU1QPJO7NgISDGzRw5nzT8CIMhDNiTP ms0m5q0u9jD64WUXmiHzpxULDThbLR7ZBw7SiwFrFDib+wI8IQMLWXgD8Miyh8FicD2r Y/Ks2Fla9mIdyxJ2UPyzLc0SzOf26vVpk9FTZO8gAyrgEidVwpvl2G3H0LZOftwTdvx9 doeY7DZD+4RaTROc4prYRIdRQ3eJx9ONJ9gf5GUo9W+LdGyEABBo/bwUYKg8R2cPGOuw Qzm9GIbZXexGEbmCGixOj79XM6bYXy4uCCPwqG1pJrnRJk/AWPCav3NWRVKLBm7RxNuP +SXA== 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=z/K2/i+JXYfZZ5+5bldYLcF42Djb0mZAX58S+kRtJsc=; b=QtzQTtRQ+hmTGHCMWqek4xPfG/ILevmp6C7uHb6mRva3urFs/dTgboN9/JWBgSIH0y FNfKsdgmI3hooziQdR/NdEujOPIL+N81leEYiBoNkqsd9PU3JKCl0oKhbpUzOIpZ9gwb YKaMM+hvUkPf1WE3lWTg2vE7IHixdHffNYnDqVXKOqY6/OmOHHW48ylRe17T37727t7R c4PNmlIjDOtG2r1G/F0C3xnqRPtlcEmyiosrH97ce6NCFRBWVTc4c4TV3gT5UPpE6uBH XhT4kBf3syIr6k3iPCwMvYW/1oH1wbh7vdYllEtn1dIZbLtghXAmZfGyG2QtvMMvnvLU FFiw== X-Gm-Message-State: AOAM530HopFXU/vXFoicRYy7uHR/NdpnSXJy+WiJfb7cZVJg3PwzSsOL zWLDxknHNyYpVhoiXj38qi8= X-Received: by 2002:a17:90a:8c88:: with SMTP id b8mr8528564pjo.118.1600350891625; Thu, 17 Sep 2020 06:54:51 -0700 (PDT) Received: from localhost.localdomain ([2001:470:e92d:10:6ca9:b613:f248:49fa]) by smtp.gmail.com with ESMTPSA id a12sm17896994pgm.79.2020.09.17.06.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 06:54:51 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: Michael Ellerman Cc: Tony Ambardar , Benjamin Herrenschmidt , Paul Mackerras , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Stable , Rosen Penev Subject: [PATCH v3] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h Date: Thu, 17 Sep 2020 06:54:37 -0700 Message-Id: <20200917135437.1238787-1-Tony.Ambardar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200917000757.1232850-1-Tony.Ambardar@gmail.com> References: <20200917000757.1232850-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 CC: Stable Reported-by: Rosen Penev Signed-off-by: Tony Ambardar --- v1 -> v2: * clean up commit description formatting v2 -> v3: (per Michael Ellerman) * drop indeterminate 'Fixes' tags, request stable backports instead --- 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