From patchwork Thu Sep 10 13:51:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11767925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66B86112E for ; Thu, 10 Sep 2020 14:22:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E87620855 for ; Thu, 10 Sep 2020 14:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599747728; bh=l/M6LZZJZ7DHoVufKas+aer9LD3Hp6q5cd2+VsWkIII=; h=From:To:Cc:Subject:Date:List-ID:From; b=b6WKkUSjHfPdv2TrX8+KdZ+ahwhhgRCQ/liGAMHdFg8HNv6OjlpO1ab4msOJc2u6A +ZmXC8Ivn3TWaxP2QhqRUL2MdgsYAnigX9TnCeU1owNVSrKVWlJ6VDegcUlk+oPH0Q EUyc+eKq76TUL/C13zHpzOY3+SdMN0jkJmo8GS0o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731013AbgIJOSj (ORCPT ); Thu, 10 Sep 2020 10:18:39 -0400 Received: from condef-05.nifty.com ([202.248.20.70]:33543 "EHLO condef-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730890AbgIJOK2 (ORCPT ); Thu, 10 Sep 2020 10:10:28 -0400 Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-05.nifty.com with ESMTP id 08ADtFcv031606; Thu, 10 Sep 2020 22:55:15 +0900 Received: from oscar.flets-west.jp (softbank126090211135.bbtec.net [126.90.211.135]) (authenticated) by conuserg-10.nifty.com with ESMTP id 08ADpSIv001308; Thu, 10 Sep 2020 22:51:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 08ADpSIv001308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1599745889; bh=JHjawyNi+2UsmyXrYxyqMJXMi2+rCaAViXhyNLVuK8M=; h=From:To:Cc:Subject:Date:From; b=buyXflRaxjagpRHTL+9r/eT3QLgJLolWsUxnbjtXoDxjXWHVtUDCUi/5rTnV79Q5S nULaajOuWCSJI3UtGUxIj3U8dZLZDsrJ0+ze+ED/FJXW+xt3ppN745E2vIs/CBKEKE Oj61MLp+NUjjmvwkq5qHBzRP2F1gRnZv2qUgBIrAJkIUh+kg6d1p4fURxH9O4AC1nW 0+U0LHAF+8BgK8pkYpXrK5J0WWewIRwz55IN5QdNntD0Oh2JzqAq+wkIjWzaln1li0 2FvyHn/jDYwz47/UeJFtzUdUB25T0PvbTemNV53NpFvM23ty3AEwG37txOgD3awkDR 7cJBpo5TiyYUA== X-Nifty-SrcIP: [126.90.211.135] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ingo Molnar , Masahiro Yamada , Catalin Marinas , Michal Marek , Nathan Chancellor , Nick Desaulniers , Stephen Boyd , Vincenzo Frascino , Will Deacon , clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] kbuild: remove cc-option test of -fno-strict-overflow Date: Thu, 10 Sep 2020 22:51:17 +0900 Message-Id: <20200910135120.3527468-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/odq8h9 Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Acked-by: Will Deacon --- Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4b5a305e30d2..059b36f2ea53 100644 --- a/Makefile +++ b/Makefile @@ -922,7 +922,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict) KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) # disable invalid "can't wrap" optimizations for signed / pointers -KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) +KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index d6adb4677c25..dfffd55175a3 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -90,7 +90,7 @@ VDSO_CFLAGS += -O2 # Some useful compiler-dependent flags from top-level Makefile VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) -VDSO_CFLAGS += $(call cc32-option,-fno-strict-overflow) +VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types) From patchwork Thu Sep 10 13:51:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11769319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50318618 for ; Thu, 10 Sep 2020 21:10:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 303EF221E3 for ; Thu, 10 Sep 2020 21:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599772223; bh=mqp67qBEfIuJMcFbaE/f7w2VhxS4oPSI3AMk242sSCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OqlSzhGC64mDBhY2+cc9n8BZ0ax5j+FW5sdwDlEBW7AlJJnLXwVx2Qf7aWPPRUCOm 14jwKAbG2Av0BKWMSJJeJOYDONRtVU3ZFhNW10n44qGWlOYJIGDpBxRRzyjtwIGbgI lYiOHZjmvQG04WAqSHoVWY/fCCJT+pVQ1Vc5BD/Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgIJVKK (ORCPT ); Thu, 10 Sep 2020 17:10:10 -0400 Received: from condef-05.nifty.com ([202.248.20.70]:48209 "EHLO condef-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731166AbgIJOen (ORCPT ); Thu, 10 Sep 2020 10:34:43 -0400 Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-05.nifty.com with ESMTP id 08ADsiG3031431; Thu, 10 Sep 2020 22:54:45 +0900 Received: from oscar.flets-west.jp (softbank126090211135.bbtec.net [126.90.211.135]) (authenticated) by conuserg-10.nifty.com with ESMTP id 08ADpSIw001308; Thu, 10 Sep 2020 22:51:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 08ADpSIw001308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1599745891; bh=wXl8du5fQhGV7mBkLY962W3rgMjpZxKVsM/SEXRS3J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JyBBb5kLp2N76xsz+5D18ojWUBSRwP4DCXi86XTh0zqLNtsGHqeIIEmEVKl+H09p+ GUcZSK5FrUXi/dTaPwmIWCKA8e7OMFkG9Gf89WeJJngR+kuUgVBrKjRxX9fSQDD+J7 IZerFkkD+a4EEkhuMsDXOo4bqa7tJpaBcKxNrqD8v5b/N/5GPBIAClGAgGFKc79Qie Ypm9vcgmPWiu3FlJzM7z5WPL7HfYdtOGgzT4bL7On/7bufH0d3IF8nhpsvCZ3nMvMN jdjLpldSliX52wzsZYCQJpr/AxfmlrZsO2ovZWzJE9l1HX6RbPJg82DZX+FxZL7bXM a+Qr2TTs61ULg== X-Nifty-SrcIP: [126.90.211.135] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ingo Molnar , Masahiro Yamada , Michal Marek , Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] kbuild: remove cc-option test of -fno-merge-all-constants Date: Thu, 10 Sep 2020 22:51:18 +0900 Message-Id: <20200910135120.3527468-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910135120.3527468-1-masahiroy@kernel.org> References: <20200910135120.3527468-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/8T4177 Signed-off-by: Masahiro Yamada --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 059b36f2ea53..1b6abecc5cab 100644 --- a/Makefile +++ b/Makefile @@ -927,7 +927,7 @@ KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we # need to disable it here generally. -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) +KBUILD_CFLAGS += -fno-merge-all-constants # for gcc -fno-merge-all-constants disables everything, but it is fine # to have actual conforming behavior enabled. From patchwork Thu Sep 10 13:51:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11769371 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 188A6618 for ; Thu, 10 Sep 2020 21:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF4EC221E3 for ; Thu, 10 Sep 2020 21:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599773271; bh=wDBghXZe8kluN8YfN5whMmcG1buegyspf54V0ZHlhMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bmgrzKs1QpTkoWoOVQZaFF+d0y1oFiTf7Nh7D1OHk5yMe4rpJNtRludYykQe7L9YT t7xaKA+5X+DSgJAGWdhdWavIwLR6/dbVZ45FXAb4tnp395GunuKboTTnw4w5aWambJ 4Q14dBlUTbZEMHbmG34lbeDnx6RMj59GL1IPGKXE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbgIJV1R (ORCPT ); Thu, 10 Sep 2020 17:27:17 -0400 Received: from condef-04.nifty.com ([202.248.20.69]:29600 "EHLO condef-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731080AbgIJOJt (ORCPT ); Thu, 10 Sep 2020 10:09:49 -0400 Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-04.nifty.com with ESMTP id 08ADsjMN032624; Thu, 10 Sep 2020 22:54:45 +0900 Received: from oscar.flets-west.jp (softbank126090211135.bbtec.net [126.90.211.135]) (authenticated) by conuserg-10.nifty.com with ESMTP id 08ADpSIx001308; Thu, 10 Sep 2020 22:51:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 08ADpSIx001308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1599745892; bh=GfWXsevD+/JY+AqdR3iC3oPYU2Z7Pjb6F8wdpSkfPC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwK2cMh39J9rOU6iXiFeF+EX6KMfOKNDrFuPTU9GwJWA4caRNJr9dSGq/Ruh2vaLy Khd3KqlsFN0VJm26UgMrOrZvhmsLUey9YdRp2tI7/ZafSb3+Bw0CgFNhiB10ErJePx hoRpqJ8vM29aGVyIB9p68vzSk1WdVT1zxdYoOt51bw/cSa2Yd/Ube9u3Cig8SQDoVI t4EnwukTTHdxQko1FX1FhGJnK12xwC6Unpb0CHllIXHw7uUuIILPDXqBJlQpsvXHT1 wM8a+Om0gB0CVPljU8Z4UIntzifK8gaKCeIoNHtAEp8/Fv9bYjDZIV7JHsFuIKQ+dN N8Ptvnr02at/A== X-Nifty-SrcIP: [126.90.211.135] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ingo Molnar , Masahiro Yamada , Michal Marek , Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] kbuild: remove cc-option test of -fno-stack-check Date: Thu, 10 Sep 2020 22:51:19 +0900 Message-Id: <20200910135120.3527468-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910135120.3527468-1-masahiroy@kernel.org> References: <20200910135120.3527468-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/59cK6o Signed-off-by: Masahiro Yamada --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1b6abecc5cab..5102c89d3167 100644 --- a/Makefile +++ b/Makefile @@ -934,7 +934,7 @@ KBUILD_CFLAGS += -fno-merge-all-constants KBUILD_CFLAGS += $(call cc-option,-fmerge-constants) # Make sure -fstack-check isn't enabled (like gentoo apparently did) -KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) +KBUILD_CFLAGS += -fno-stack-check # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) From patchwork Thu Sep 10 13:51:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11769333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3995392C for ; Thu, 10 Sep 2020 21:20:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13D1A206E6 for ; Thu, 10 Sep 2020 21:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599772844; bh=5sjo0tXKJRGNz/5YzFh7BGtbbE7WXRIZGpqowisukko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rqtB9PDkWxlMFpGIl+FlFBcTL5qe59hmxx58cHTORH+Qi9TIFDEUwwxHi7vdrAIv7 KKfZ+Rlx0AbCkY2DiSfyv5V95qcMzDcCAO53AQfvWwzUetB+z5tSwoBEhiD9YC4sfg iTIoesr87ovbjojFCf0tpqAxLX2iww5t00zLtgEs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbgIJVUN (ORCPT ); Thu, 10 Sep 2020 17:20:13 -0400 Received: from condef-02.nifty.com ([202.248.20.67]:45876 "EHLO condef-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731136AbgIJO0J (ORCPT ); Thu, 10 Sep 2020 10:26:09 -0400 Received: from conuserg-10.nifty.com ([10.126.8.73])by condef-02.nifty.com with ESMTP id 08ADtFZO023217; Thu, 10 Sep 2020 22:55:15 +0900 Received: from oscar.flets-west.jp (softbank126090211135.bbtec.net [126.90.211.135]) (authenticated) by conuserg-10.nifty.com with ESMTP id 08ADpSJ0001308; Thu, 10 Sep 2020 22:51:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 08ADpSJ0001308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1599745893; bh=K01RYjZ9wy1tuci78KttomtfIouE9FTDhkSr4QzxpNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1OH9UBl3mJpDIo0SH3Q8bILjszIxHdnVNj6Za9phRQiubjlbRAFg0W4DpIhREkpfY IzcvFpjVKKtz83ChLHqV5HavmKP3HuDNxXrlFawgFJVBCsn1jUQdfbiY4fON3vFkRB n7JQj++2onXAhbaUjzwcrT9Z2g022EgyV76pJ12+JwE8YsDGuJqA7xC5eBJMvQfg0k u8Tbx7HcDmKf8KxpAWs1rEIU9S8UorSqDOOGdCFBZAeQTG5ZdJUcbiJVUMDcYDHKy6 ttp/K1VP/fUSA8NSW2NRyi5xldWaoRUxztJ+067BgCmzvWoDpskFgfy0y3McjFqte4 gbl5M7iRalKfA== X-Nifty-SrcIP: [126.90.211.135] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ingo Molnar , Masahiro Yamada , Catalin Marinas , Michal Marek , Nathan Chancellor , Nick Desaulniers , Stephen Boyd , Vincenzo Frascino , Will Deacon , clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] kbuild: remove cc-option test of -Werror=date-time Date: Thu, 10 Sep 2020 22:51:20 +0900 Message-Id: <20200910135120.3527468-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910135120.3527468-1-masahiroy@kernel.org> References: <20200910135120.3527468-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/xvjcMa Signed-off-by: Masahiro Yamada --- Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5102c89d3167..1d7c58684fda 100644 --- a/Makefile +++ b/Makefile @@ -940,7 +940,7 @@ KBUILD_CFLAGS += -fno-stack-check KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) # Prohibit date/time macros, which would make the build non-deterministic -KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) +KBUILD_CFLAGS += -Werror=date-time # enforce correct pointer usage KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index dfffd55175a3..1feb4f8e556e 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -92,7 +92,7 @@ VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) -VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) +VDSO_CFLAGS += -Werror=date-time VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types) # The 32-bit compiler does not provide 128-bit integers, which are used in