From patchwork Tue Mar 14 21:37:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9624573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57F7160244 for ; Tue, 14 Mar 2017 21:37:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 483AC28537 for ; Tue, 14 Mar 2017 21:37:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39DFF2857D; Tue, 14 Mar 2017 21:37:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFFA828537 for ; Tue, 14 Mar 2017 21:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751448AbdCNVhn (ORCPT ); Tue, 14 Mar 2017 17:37:43 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:49600 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbdCNVhn (ORCPT ); Tue, 14 Mar 2017 17:37:43 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MHYCK-1cmoje3Whw-003MYM; Tue, 14 Mar 2017 22:37:31 +0100 From: Arnd Bergmann To: Masahiro Yamada , Michal Marek Cc: Nicholas Piggin , Arnd Bergmann , Namhyung Kim , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [SUBMITTED 20170314] [v333kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Date: Tue, 14 Mar 2017 22:37:15 +0100 Message-Id: <20170314213724.3836900-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170314213410.3762842-1-arnd@arndb.de> References: <20170314213410.3762842-1-arnd@arndb.de> X-Provags-ID: V03:K0:tTdHCbLN0ydmk1vJfCxSQEQ9FCt2bBpBKh6Ngc6PyRCyGy39Yml A9QKOQARJrgavIMF1xxTGvohGVSQ0IMQOlO7tjB704XBcQ5e82h9u+mBeJNEwkNdoU61D9z c+Z+zmfHPj18S9ltPtvYB0lLphWBQOFu4fyr2+F2W7bktUjJWPBzuNXT9S6+A4PFKoPpm0M l7jwpOrScrTxEbjhYJgKA== X-UI-Out-Filterresults: notjunk:1; V01:K0:s8FU4DRglME=:LwsmNeghs9UXgLiLw+k1CM WGXFs9GogCnKXjddKxM+Assra2oAzd0/YuakeN+8ceRnnbsTPbQrWQDqRBOwSnWy2bw4kIXYD mYPoo0mnLYn+doCx/dxuRn7mDbvnS4GTn7VQ/yNyv9xwM+v0iuSzKk9WHpp7T1Ss409dAnPrt rnuAM/FabBmdrJCEa2VpTW1FS6PteGATomRajPBwA4mYkMKhSVopnXMxEKpbY3BEFA23XbBWj mexEuFe9Lh7CATZAkBUFRPog1GZJRvViRYMRbZwO9hpS7jLjBAWZw827ijJzwiYDhpCYDjbgu PSV/vUjECkeUzyW2UHthuevCA1GTneaRfZbNHMDsnZN1Yw6qBRe4Syi08KLAijLd7e2jYz8LO TocUuCI+k7VhS8GYuzd9YCqKGZeg9Bxx+p96OSTs9u57Eqagh6yw8RcWnHLAhgdBaeE70XYsd uQkcJDkLzgPvPsel4y+qBCm7Nm23OQAszSC2sfg6n329TmPsWEhW8ReA9Xs8V7kgHI/WY3m5e E27egZvKgFdoY9uY79Jl+BMHaxMKL0tYTQpKmR9UCg9c7xEEOAI+T5RYDiRXfeD6kVkkuy3+n iLxEQejLOOjr+IaK/TXyk346lWbiBFyLybd6KyYtnzlzsWjGB+qDK5pkSpBC/viwX8I9+XolJ XLchbxgSOofWjnjCLn3qX/NUdCtGMvUr2SpHtf1oDjPT+882NcTIxRAn7OkeyIK/ilME= Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When ftrace is enabled and we build with gcc-4.7 or older, we get a warning for each file on architectures that select CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: warning: -ffunction-sections disabled; it makes profiling impossible [enabled by default] This turns off function sections in that specific case, leaving it enabled for all other configurations. Fixes: b67067f1176d ("kbuild: allow archs to select link dead code/data elimination") Signed-off-by: Arnd Bergmann Cc: Namhyung Kim --- v2: accidentally resend the same patch as before v3: send the exact same patch once more, without doing the change I wanted v4: actually fixed version number in check as pointed out by Namhyung Kim (I hope) --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 6e7e644a0b84..3a964fa3a787 100644 --- a/Makefile +++ b/Makefile @@ -662,7 +662,11 @@ KBUILD_CFLAGS += -Wextra KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +ifdef CONFIG_FUNCTION_TRACER +KBUILD_CFLAGS += $(call cc-ifversion, -ge,0408,$(call cc-option,-ffunction-sections,)) +else KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) +endif KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) endif