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)