Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp884690ybl; Wed, 28 Aug 2019 06:45:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxseNeIx8v5Xv4I8OPNWoluu/aLpXbR3C+das2jVNyc9MrRbDTDSMyBILdIhjeRr1ZSema4 X-Received: by 2002:a17:902:12d:: with SMTP id 42mr4456943plb.125.1566999935432; Wed, 28 Aug 2019 06:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566999935; cv=none; d=google.com; s=arc-20160816; b=mgokFlol0TWnEMBA9i1Ej9NAg8fU9UvJ255qnt2pTkepp4nymPedpeeKJ58Y9DNLW4 dak00nZbBcpKO4SvlMNumkqurdFVSul1ZVFjzSR+6JwX5/EpIkYgSlHrVlJD1rLo15eN SsCDl62FaZhNKdQcet/Ef45cEnYceBhAvi6U5yO36t1XYfYdyg9v92eb9qhe9QfD+OqY 2xKuBs8InRfiT/AyvsAYVWcN+zkQXlrkHHoBY2b7KgkU8XjdVFw9/ZM/qsTLWzAQy1hA 1nSqTotoRpQATPklf/sK7ERH8qEXWyWDbCSlHJvYHhrB2SvfvOWwzunFf0HtnqHRAX/J Mdkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=4rhnAfCnJaTWtXABj73cM7DmFs7hoM7M+0X1zvpJMoE=; b=Kfjxtbm92fz9cPOHLUtFGi5MmF+mAvlIcddCfoVM0FLUq/KwbgGCv4wQj9tGOYNzpH eg92nl6dN3eHeyHVk8omh78DXzwQhg+EoSeGxxbv/SYKNOvJcqU7gV/87J8HC7g26NJd EGTHnUql598MHt0Ilibv1Ab8mBQOk2MDEpKm8kwDJxHHHaszwab7AVkOX8tvqh4Xuex7 POuyOxWRGL5y+grHsQZIoHKEizl/IF5dLgZxQ4UibTVuxhm9oSaz2qdHG8t4le4kCz6s nfNmikEF0Qysk3BTLxdd4V8G0YlhTzqK9SFPhQfJpmBZlH7tYjPhVVtyTqPzX38klQlG KFrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si1971987pjv.5.2019.08.28.06.45.19; Wed, 28 Aug 2019 06:45:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbfH1NoL (ORCPT + 99 others); Wed, 28 Aug 2019 09:44:11 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:42121 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbfH1NoL (ORCPT ); Wed, 28 Aug 2019 09:44:11 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46JRmQ3ct3z9sNm; Wed, 28 Aug 2019 23:44:04 +1000 (AEST) From: Michael Ellerman To: Nathan Chancellor , Benjamin Herrenschmidt , Paul Mackerras , Nick Desaulniers Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , stable@vger.kernel.org Subject: Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp In-Reply-To: <20190812023214.107817-1-natechancellor@gmail.com> References: <20190812023214.107817-1-natechancellor@gmail.com> Date: Wed, 28 Aug 2019 23:43:53 +1000 Message-ID: <878srdv206.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nathan Chancellor writes: > Commit aea447141c7e ("powerpc: Disable -Wbuiltin-requires-header when > setjmp is used") disabled -Wbuiltin-requires-header because of a warning > about the setjmp and longjmp declarations. > > r367387 in clang added another diagnostic around this, complaining that > there is no jmp_buf declaration. > > In file included from ../arch/powerpc/xmon/xmon.c:47: > ../arch/powerpc/include/asm/setjmp.h:10:13: error: declaration of > built-in function 'setjmp' requires the declaration of the 'jmp_buf' > type, commonly provided in the header . > [-Werror,-Wincomplete-setjmp-declaration] > extern long setjmp(long *); > ^ > ../arch/powerpc/include/asm/setjmp.h:11:13: error: declaration of > built-in function 'longjmp' requires the declaration of the 'jmp_buf' > type, commonly provided in the header . > [-Werror,-Wincomplete-setjmp-declaration] > extern void longjmp(long *, long); > ^ > 2 errors generated. > > Take the same approach as the above commit by disabling the warning for > the same reason, we provide our own longjmp/setjmp function. > > Cc: stable@vger.kernel.org # 4.19+ > Link: https://github.com/ClangBuiltLinux/linux/issues/625 > Link: https://github.com/llvm/llvm-project/commit/3be25e79477db2d31ac46493d97eca8c20592b07 > Signed-off-by: Nathan Chancellor > --- > > It may be worth using -fno-builtin-setjmp and -fno-builtin-longjmp > instead as it makes it clear to clang that we are not using the builtin > longjmp and setjmp functions, which I think is why these warnings are > appearing (at least according to the commit that introduced this waring). > > Sample patch: > https://github.com/ClangBuiltLinux/linux/issues/625#issuecomment-519251372 Couldn't we just add those flags to CFLAGS for the whole kernel? Rather than making them per-file. I mean there's no kernel code that wants to use clang's builtin setjmp/longjmp implementation at all right? cheers