Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp445529pxk; Thu, 17 Sep 2020 07:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxItBNpew1AKlaSkdceNPpgBUh4fIVLtSM6HqnGrO/kVVwiGktiRdxwqxFADRIM1O6qrIHd X-Received: by 2002:a17:906:5fc5:: with SMTP id k5mr29863621ejv.63.1600352234799; Thu, 17 Sep 2020 07:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600352234; cv=none; d=google.com; s=arc-20160816; b=pJ3HDZmfWRDI6Y9J18U5eOhDR7t7fc0OEG655EVDmTt4oUsDgZ8LI7DO1fK5XTzC/M n6cb86SnttbJZAfFSoDEgzRqI3peVF479ZvlvPfe/jXstbGT6CKdA+ygolRzpikWm85d O/NLDM7pY4oreHXNb+0++gDm0eP6k9EfMxSeOPT6Nx4mmZZ4knT7KNLodphCR8icmmAt jKoC3sBi9goLqgl1jH68IU1aqk3rbeqE+P4nIhL85VE1LsKCM5rKlgTCiWvKLa3q7E8t n3UAA5oZD3ILeH+G1Z8sMWfhiy/SxArOnH8hDmrel6Ue2eT07qpmly7axfI18U/fxi+N nJoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=V0+M84s9C06PEmeGvOBjt2ovx/RNvUnpw/5uEgMQg9k=; b=foQjRAr0h8jrhHvcJwcQSiSVpNRf2ZJxDCueUrtkp2kkzI+gcIeH6+hN07wYn0ck6t DGBUprWxYwufCLU6y1D7x5IfwV7ehxMYibyVCKYYCwpBz9A0n2eDsaen6Gw+EUtTOHIN UwcJSBCPqUSMXFaE/P9v3txzUflPlr0QDU98I84li0zKscLqteLEzb/Aw9KFisk6RlFi XRhiSEjmvvLyAJ/pBcKF6w4NpUZ5jnYkz2UlZvdg4ZXNDhwPVJg8WKtbN/yUXMk0aARr v5pay+RMaYQ2fT3xZo1F/CCVmcUsMz3Hg2QZRCGh+zIctcUOBJ05jFGEt7KgqwyDRqGj NS9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si13649964edw.66.2020.09.17.07.16.48; Thu, 17 Sep 2020 07:17:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727424AbgIQOPl (ORCPT + 99 others); Thu, 17 Sep 2020 10:15:41 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:53259 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727338AbgIQOLY (ORCPT ); Thu, 17 Sep 2020 10:11:24 -0400 X-Greylist: delayed 396 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Sep 2020 10:11:22 EDT Received: from mail-qk1-f172.google.com ([209.85.222.172]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MzQbw-1kezk02V1c-00vT3E; Thu, 17 Sep 2020 16:01:44 +0200 Received: by mail-qk1-f172.google.com with SMTP id w12so2272381qki.6; Thu, 17 Sep 2020 07:01:44 -0700 (PDT) X-Gm-Message-State: AOAM5304ot5kHZJGBuPfXXyEVYJz8pFJs/lOsn8EqzaW5hHUtHPcAlhv G51303jxTG3cAMoantkRutHn42/6JqqP4xjlvjk= X-Received: by 2002:a37:a495:: with SMTP id n143mr28117696qke.394.1600351303235; Thu, 17 Sep 2020 07:01:43 -0700 (PDT) MIME-Version: 1.0 References: <20200916074214.995128-1-Tony.Ambardar@gmail.com> <20200917000757.1232850-1-Tony.Ambardar@gmail.com> <87363gpqhz.fsf@mpe.ellerman.id.au> In-Reply-To: <87363gpqhz.fsf@mpe.ellerman.id.au> From: Arnd Bergmann Date: Thu, 17 Sep 2020 16:01:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h To: Michael Ellerman Cc: Tony Ambardar , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , "linux-kernel@vger.kernel.org" , bpf , Rosen Penev , linux-arch Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:BiDI7RSugMs1bexsxNS7YdcLk/DPBsz4XJ9rjWVFJysPhzJ6DqT 2XQbp5EiiavA/xv3Yb1leIcOlkzG1yJV/ShPE6IGfIIqfGHbgZ8UDvALmjcNVvJvBza0wtC YNGjeYLC+LX8QDbxbTuk3g6R1N55bR8nMJZp997Qjl7gckYG0HrUKYD8Mau5dvuL6z4zm7e 8fzVYGR6nqAnUv4z4Ac+Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OiyOedjSjEE=:kPQxdXO/jYk+i7pGOq+NOs 8iBpb46yH7KUPvnmxE48dZZ6h9ntMxYgASzNzDIS78c95nZkGrhBcfqrZFKAlnanMeB/6T5sb 1K838KThHOXS9Tkz7NGxHANEUrHUnuXuQxVG8oYWY3Q6RRhr6bO2vHaAUvKaTtc7vLZsJ/gcG DH7Hg0rSy4YUZx+u3esU/BuNzP8w3MTRIVcX84c4Oz1awHe5kheWcw+ZEwXjoj7Bl/whbMnTr tHynzRcu3zUs5qSEbhwHSsRR6xEuQ+pR2vVKr2gTaUuX1qhZiEp51YmM9QonAb6F9kRdivWae rv4TFkHhICzJzafoRfdcomlctOy010EsRtECtBMCyLEILkPwtTAz9LrTeXj5KKLwSQSNlWVvE 4qMHT0rEwYJovG1Cbs934v+BlZIiH/z19D5FnZl1Njspon87n+oIjlBOJKuoMJgJoiiN1zi6+ s9SWURInct36SwarZ9xOylGKZxprzwO2/DTxUOk0vswFJwpOze6qknmwAu6CGXh0m0uYV5SOl lejU7G778zSvllGPGASW/6L8UUyV31kZncqlYGzV60YKMQhumjz0lEfV88L/jybqfQll+TfKa zbkwgOMDN+OiT011b+VI9Z9Hku8J3TVS792YmWkG/fB2daVHx8G9X0eFegK+ESmiIsMTyZwsT I/oHZjKsEvAuo2w/fYQQbaWQFTsqYWshuF9QOcikoIhtfz6d2K7/NlrwmO6mV6VHX92rPEu8W +4sWHHAZp24Cof3U8w2G0y98vNhOF5kymYr3ko4M0PLr6H9rAEiLpCkXMarurBiAuxkiOhqeC KD6k1NBw9RvYkEbfUofAVgwsXdg5CSyA3mw7kANq0lRqrjEvz1DPZXwLEY5Ygl9lX8mCQ02 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 1:55 PM Michael Ellerman wrote: > > [ Cc += linux-arch & Arnd ] > > Hi Tony, > > This looks OK to me, but I'm always a bit nervous about changes in uapi. > I've Cc'ed linux-arch and Arnd who look after the asm-generic headers, > which this is slightly related to, just in case. > > One minor comment below. > > Tony Ambardar writes: > > 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") > > I suspect that's not the right commit to tag. It just moved errno.h from > arch/powerpc/include/asm to arch/powerpc/include/uapi/asm. It's content > was almost identical, and entirely identical as far as EDEADLOCK was > concerned. > > Prior to that the file lived in asm-powerpc/errno.h, eg: > > $ git cat-file -p b8b572e1015f^:include/asm-powerpc/errno.h > > Before that it was include/asm-ppc64/errno.h, content still the same. > > To go back further we'd have to look at the historical git trees, which > is probably overkill. I'm pretty sure it's always had this problem. > > So we should probably drop the Fixes tags and just Cc: stable, that > means please backport it as far back as possible. I can see that the two numbers (35 and 58) were consistent across multiple architectures (i386, m68k, ppc32) up to linux-2.0.1, while other architectures had two unique numbers (alpha, mips, sparc) at the time, and sparc had BSD and Solaris compatible numbers in addition. In linux-2.0.2, alpha and i386 got changed to use 35 for both, but the other architectures remained unchanged. All later architectures followed x86 in using the same number for both. I foudn a message about tcl breaking at compile time when it changed: http://lkml.iu.edu/hypermail/linux/kernel/9607.3/0500.html The errno man page says they are supposed to be synonyms, and glibc defines it that way, while musl uses the numbers from the kernel. Arnd