From patchwork Fri Feb 12 16:06:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102792 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp912515lbl; Fri, 12 Feb 2016 08:07:32 -0800 (PST) X-Received: by 10.66.193.202 with SMTP id hq10mr3241175pac.6.1455293252747; Fri, 12 Feb 2016 08:07:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si20778605pfi.191.2016.02.12.08.07.32; Fri, 12 Feb 2016 08:07:32 -0800 (PST) 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 S1751514AbcBLQH2 (ORCPT + 30 others); Fri, 12 Feb 2016 11:07:28 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:55132 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbcBLQHZ (ORCPT ); Fri, 12 Feb 2016 11:07:25 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0Lf3PM-1ZfrX727B2-00omP6; Fri, 12 Feb 2016 17:06:49 +0100 From: Arnd Bergmann To: Michal Marek Cc: linux-arm-kernel@lists.infradead.org, Peter Oberparleiter , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 1/5] Kbuild: change CC_OPTIMIZE_FOR_SIZE definition Date: Fri, 12 Feb 2016 17:06:18 +0100 Message-Id: <1455293187-179811-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455293187-179811-1-git-send-email-arnd@arndb.de> References: <1455293187-179811-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:QPOq1zIKBti0+Re3G3WnM5xeGWtG5X7YilwQDwzpKKo3Rgq4ipt wCdHRwgGNetDTkU8ZXh7QMx19BZSt4qUuHNPIq+hLLBjT7i4eEcGeFISBfMlOtx7HspyFrD 51cFRZAwkRVx74kyO2rrUw4LVnM9bIiHLnpCFsg0xRBHWLfCctflkNAtg+LrWoKkuPldpsV mj8GmErMoalkLt/PAEZ/w== X-UI-Out-Filterresults: notjunk:1; V01:K0:4WnsDgrZsRQ=:+P5X5XuxiFtGcHO0ngnHQH B9gqrfVICbClaHnptrTgmPjctBo0fmX5k8Uyw8IIl5N+CSddS0RfBLvnh5k706ao5oVuxaLQG zjcAd3j+aLnG4fzOYa917pHrKpEokFDGkn/vVfkgrZUrItckJmA6JaIX+gwElQqqhWCTMPnE7 a13XK0o1dQCouD32vcu39o9KnXD0ksuFU3c8yq+t8qx+Xz3lYhOrcdF++hSimWx1BSPD81M8C T6pQVyIqS9Xq2zPwRXKIMmsV8QVNQzwBCw7j2ebx03vidtqlCSCY6ESZrHOp/2/i+7z+T03iO CDHpb8nI/h26O8p4OSKqGLIVcHlIZytiyU4jnp+UE2RewJxehFZRUfiz/cVQvONPYYByDFTI0 3xo8340zMAqtZGURUu7KpgS/mgcNMLratzvTIc0/Imkq2yzjupDwBDahaMbDIPH3o31GLJ+dT 6GeO2KcC3kldDur5bZygvypWOtUYtpH9ikX7u8921jAdCSigiAOUlV8XcAm1vO/G7CZarD4n2 UR+ipYVtlItYzVt54PLrrP03wvCyLubMQNYwJwvNINygq/p0gf0F8XL6vMqC/IjgZA2KZqZYG nobYuU/KO8HpfmZLogH90QnrYqwZmi+EEQrHxMw4ZJH3da7CQISeGEZmuFtLPK9TUKqyzJ+ot /hgU9Eq8O0XH1w02xX6y7FYDtPQa6N1cUw72mYhn6B948B9mHIo+9ZQkFAIaa8i0ENGk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CC_OPTIMIZE_FOR_SIZE disables the often useful -Wmaybe-unused warning, because that causes a ridiculous amount of false positives when combined with -Os. This means a lot of warnings don't show up in testing by the developers that should see them with an 'allmodconfig' kernel that has CC_OPTIMIZE_FOR_SIZE enabled, but only later in randconfig builds that don't. This changes the Kconfig logic around CC_OPTIMIZE_FOR_SIZE to make it a 'choice' statement defaulting to CC_OPTIMIZE_FOR_PERFORMANCE that gets added for this purpose. The allmodconfig and allyesconfig kernels now default to -O2 with the maybe-unused warning enabled. Signed-off-by: Arnd Bergmann --- init/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.7.0 diff --git a/init/Kconfig b/init/Kconfig index 651ec15ecddb..159a542ef3fc 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1305,6 +1305,17 @@ source "usr/Kconfig" endif +choice + prompt "Compiler optimization level" + default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE + +config CC_OPTIMIZE_FOR_PERFORMANCE + bool "Optimize for performance" + help + This is the default optimization level for the kernel, building + with the "-O2" compiler flag for best performance and most + helpful compile-time warnings. + config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size" help @@ -1313,6 +1324,8 @@ config CC_OPTIMIZE_FOR_SIZE If unsure, say N. +endchoice + config SYSCTL bool