From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785F3C433FF for ; Mon, 12 Aug 2019 02:42:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AD8620651 for ; Mon, 12 Aug 2019 02:42:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dGYrhLjU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbfHLCmL (ORCPT ); Sun, 11 Aug 2019 22:42:11 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38849 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfHLCmK (ORCPT ); Sun, 11 Aug 2019 22:42:10 -0400 Received: by mail-wr1-f65.google.com with SMTP id g17so103257517wrr.5; Sun, 11 Aug 2019 19:42:09 -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:mime-version :content-transfer-encoding; bh=yf3qi63BI9X/BYxP9kfuXNqP3LoeT8xFrAy0fp782mo=; b=dGYrhLjUkDj2WJPilmQW4xy3C/uREHCHQArXSMNPDpqIEW9bXvBveorN4AIx/dBEBe 0IkYNrxa9lAnkMJQXZ8wtfmbkrk+mazm1sj+6pmuwC6RtgaCLHWHvMBXtwwj5i4Bwr6z XSdF0bZl23ZHz02JGh+C6o0Ogd7SV07ZxeFGWc5pLmEIv37r71wPOVREl39RsxL4WeQi LjrWDs8vWNaphnVGSXNBpuEOY3FEWcLexSOZjN3/XqToEJ4aIAhvO6DSvpf3equX5y+N A9BH5e2HrddMzVAAQqxQG5cw91i83TPYgUZrvmZWjx2Kl+fMd8XA4R1I8w25DqBfrbRi yLKw== 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:mime-version :content-transfer-encoding; bh=yf3qi63BI9X/BYxP9kfuXNqP3LoeT8xFrAy0fp782mo=; b=IX4ZrdCDZhYWmqZRr1riXnqtoJBxizo4pPHiF4E3NuQuayqtRZPtYtZVNAPaILr1CV SOKQi8Tc6BXITOYVG+TKeubTClqg0gItL/SfTr2EfmhObPGh55uKa8n7bam3kEcX8ivx wD0YqUhQ9sVvY4/RA+pDliRgEMLG2Ik6Yt0bffTMlknLREXd4tkqhuCDh6HisVll98Rs GS5nH4XnuUeU0VDkGGb0d3gBKIjYnG4qmIoFOkY6sj+uHXIDvL2/SZagEwZMNEJxVvAy b3NY3qglgrWPT1KChq8dKSrZkUNZgPUt89cOOuNXLFFAFfo0Fu6D7mfHIm7/Kq0BMYuC gDCQ== X-Gm-Message-State: APjAAAU8e6Y+k+cIxQVGRT0mZ4Ypbexn1fyEyd7xptMMwnqflEs1c720 7paxix5gYRX0S5QVLkrxrMc= X-Google-Smtp-Source: APXvYqznAqEJ+GJ49TKqcvfBU6PxEdk43wnddnbNxpFj/DrvwKZy6Mob6j4soONcsG3hwYBtyUIFZg== X-Received: by 2002:adf:dbcc:: with SMTP id e12mr28643909wrj.205.1565577728170; Sun, 11 Aug 2019 19:42:08 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id a26sm16705786wmg.45.2019.08.11.19.42.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 19:42:07 -0700 (PDT) From: Nathan Chancellor To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , 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: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp Date: Sun, 11 Aug 2019 19:32:15 -0700 Message-Id: <20190812023214.107817-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.23.0.rc2 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 However, this is the most conservative approach, as I have already had someone notice this error when building LLVM with PGO on tip of tree LLVM. arch/powerpc/kernel/Makefile | 5 +++-- arch/powerpc/xmon/Makefile | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index ea0c69236789..44e340ed4722 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -5,8 +5,9 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' -# Disable clang warning for using setjmp without setjmp.h header -CFLAGS_crash.o += $(call cc-disable-warning, builtin-requires-header) +# Avoid clang warnings about longjmp and setjmp built-ins (inclusion of setjmp.h and declaration of jmp_buf type) +CFLAGS_crash.o += $(call cc-disable-warning, builtin-requires-header) \ + $(call cc-disable-warning, incomplete-setjmp-declaration) ifdef CONFIG_PPC64 CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index f142570ad860..53f341391210 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile @@ -1,8 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for xmon -# Disable clang warning for using setjmp without setjmp.h header -subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header) +# Avoid clang warnings about longjmp and setjmp built-ins (inclusion of setjmp.h and declaration of jmp_buf type) +subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header) \ + $(call cc-disable-warning, incomplete-setjmp-declaration) GCOV_PROFILE := n KCOV_INSTRUMENT := n -- 2.23.0.rc2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E41FC0650F for ; Mon, 12 Aug 2019 02:43:50 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1EE920651 for ; Mon, 12 Aug 2019 02:43:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dGYrhLjU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1EE920651 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 466Kst0qW7zDqdL for ; Mon, 12 Aug 2019 12:43:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=natechancellor@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dGYrhLjU"; dkim-atps=neutral Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 466Kr65QGKzDqd1 for ; Mon, 12 Aug 2019 12:42:14 +1000 (AEST) Received: by mail-wr1-x444.google.com with SMTP id z11so1317954wrt.4 for ; Sun, 11 Aug 2019 19:42:14 -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:mime-version :content-transfer-encoding; bh=yf3qi63BI9X/BYxP9kfuXNqP3LoeT8xFrAy0fp782mo=; b=dGYrhLjUkDj2WJPilmQW4xy3C/uREHCHQArXSMNPDpqIEW9bXvBveorN4AIx/dBEBe 0IkYNrxa9lAnkMJQXZ8wtfmbkrk+mazm1sj+6pmuwC6RtgaCLHWHvMBXtwwj5i4Bwr6z XSdF0bZl23ZHz02JGh+C6o0Ogd7SV07ZxeFGWc5pLmEIv37r71wPOVREl39RsxL4WeQi LjrWDs8vWNaphnVGSXNBpuEOY3FEWcLexSOZjN3/XqToEJ4aIAhvO6DSvpf3equX5y+N A9BH5e2HrddMzVAAQqxQG5cw91i83TPYgUZrvmZWjx2Kl+fMd8XA4R1I8w25DqBfrbRi yLKw== 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:mime-version :content-transfer-encoding; bh=yf3qi63BI9X/BYxP9kfuXNqP3LoeT8xFrAy0fp782mo=; b=bN4Hcl/Oc1OUpaHC0JEwJ4SHf5ffT31m4G2fododqdw/EhstWMOzKv/yLGHLoIb6YC SWBXy3EVLUkh7Hb2C7+zf3XaQEsmS+6HKKZHwu12fiHuZQ+va6wtnjIJUcTWlZGF2aFM Y+IP1IUp5Bw6tByHoyJjT+SkRW6s59ldZD+2fyQ5+iPTqXkAI4wnja255HG0xjFRyScZ 1/mb5cPTy380UWzowtOfWk5eSAdK4OBJSLNzvgFYfKoxzT1L0eSPTPRXfTBUMtcNJKpV lXxA9ptiUcf0aQJdY103jK/E8Kuchg54V2wqp8PPZIczZb6+OoNwbRJ7ahjFQQhW+j+a 0loQ== X-Gm-Message-State: APjAAAW3TOWH/jgFcIIRqmRAkikf2/iwPcSGu7F4kBuszxvBveEVL8sR Ji8jdFJEfqEtLm3NGCxzVc4= X-Google-Smtp-Source: APXvYqznAqEJ+GJ49TKqcvfBU6PxEdk43wnddnbNxpFj/DrvwKZy6Mob6j4soONcsG3hwYBtyUIFZg== X-Received: by 2002:adf:dbcc:: with SMTP id e12mr28643909wrj.205.1565577728170; Sun, 11 Aug 2019 19:42:08 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id a26sm16705786wmg.45.2019.08.11.19.42.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 19:42:07 -0700 (PDT) From: Nathan Chancellor To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Nick Desaulniers Subject: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp Date: Sun, 11 Aug 2019 19:32:15 -0700 Message-Id: <20190812023214.107817-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.23.0.rc2 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: clang-built-linux@googlegroups.com, Nathan Chancellor , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 However, this is the most conservative approach, as I have already had someone notice this error when building LLVM with PGO on tip of tree LLVM. arch/powerpc/kernel/Makefile | 5 +++-- arch/powerpc/xmon/Makefile | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index ea0c69236789..44e340ed4722 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -5,8 +5,9 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' -# Disable clang warning for using setjmp without setjmp.h header -CFLAGS_crash.o += $(call cc-disable-warning, builtin-requires-header) +# Avoid clang warnings about longjmp and setjmp built-ins (inclusion of setjmp.h and declaration of jmp_buf type) +CFLAGS_crash.o += $(call cc-disable-warning, builtin-requires-header) \ + $(call cc-disable-warning, incomplete-setjmp-declaration) ifdef CONFIG_PPC64 CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index f142570ad860..53f341391210 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile @@ -1,8 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for xmon -# Disable clang warning for using setjmp without setjmp.h header -subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header) +# Avoid clang warnings about longjmp and setjmp built-ins (inclusion of setjmp.h and declaration of jmp_buf type) +subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header) \ + $(call cc-disable-warning, incomplete-setjmp-declaration) GCOV_PROFILE := n KCOV_INSTRUMENT := n -- 2.23.0.rc2