Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2517695pxj; Mon, 10 May 2021 05:03:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY4A6cMsRJUmZUBrIABRAc/R4TMgV3EuRYnl8FP/UcUX2WUlwV5lP8t4X3PrGMhlxGgzCw X-Received: by 2002:a17:907:9691:: with SMTP id hd17mr25429853ejc.67.1620648186595; Mon, 10 May 2021 05:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620648186; cv=none; d=google.com; s=arc-20160816; b=VLgcferbd+RY7rIDKKpqTTeLu/UvbHQOpiFuFxsorYNL7Z6ikrGYHzEzsYJ8IkLR6U fOh6ex4xylaPGulFVXC6A9wRDydSXnSvgxiVogHw5eY9qpXQnLtizbubeG9zQKfjlRfp bhVX/Vf151Vr5YyYlns0a+gfO5Gg/INxDX37UkowEQ/dNGS1qyXCm4Xl3LSMvUAe89in alqPJtvxlsh6bbeaImlmtQqFit3hj7472Hsf520PjjMluht1o9NeWYzuxn3emDfdk8+C qsIuogYX46xL+nRSUHxVsEEukyO9aTTu/DCiUAmuSGZW/cRGn4xVZojxpeDoUy0WoQOn GGOg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5FoJuEoe+W5m63qOiN1DCz38114TNIKQkP8TQs2E9ps=; b=u0I4RMm7coFIltFHlksB1tGr5xcJv5wwp9gwPAz9YJcJfhbAZeZx7DX9aw4GYN0yDw qfMwJi0pygnAHoVXpyoOdYkX9YRDTeOf5iFDizELwuk3C4kNAddEqx3GlFtmxNBFKID2 BkbxGdLqSlVUc/XhzZjTc8O20eSJHOykuoQnTFTxjAzX0uoqXkhaG4ZrtdR2feolwg4H 9d02OiUv/eUWvW3S4iwlvx4s3COPkNegI/jci1BFxI+ozVH0TlRjWa5DRQVeVY14VHps 0VCpH9JhT1TYdRIVVI/7iqQ/e3DXkUukgfaoXJmjetfcIz548ZjSWj88XdnLwzOrqcMT frNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tsXpAS+5; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si14748299ejb.158.2021.05.10.05.02.42; Mon, 10 May 2021 05:03:06 -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=@linuxfoundation.org header.s=korg header.b=tsXpAS+5; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237879AbhEJLyo (ORCPT + 99 others); Mon, 10 May 2021 07:54:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbhEJLDw (ORCPT ); Mon, 10 May 2021 07:03:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F30C461933; Mon, 10 May 2021 10:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644078; bh=nM82XFwB+Hv0Rbe30sfFpEmwyRJEFZjJt83JZ6zhF7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tsXpAS+5p17ZRQ3Q11nBCUE/K5kleWSW8H2e+krvMIrRflSij0vMByj8MMMKzrinK YBK7D1KqTrYhGaMuwImOEder3poKVkyqBmbLrky8WS67Ur2l9oMj0IQym1wO2+3voq VAqCe/Ks9cMduPoN/t4hhEXj4TFQgy0RmNYeuAyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rosen Penev , Tony Ambardar , Michael Ellerman Subject: [PATCH 5.11 277/342] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h Date: Mon, 10 May 2021 12:21:07 +0200 Message-Id: <20210510102019.256875629@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Ambardar commit 7de21e679e6a789f3729e8402bc440b623a28eae upstream. 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200917135437.1238787-1-Tony.Ambardar@gmail.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/uapi/asm/errno.h | 1 + 1 file changed, 1 insertion(+) --- 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