From patchwork Tue Mar 14 21:33:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9624565 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 0BBC860244 for ; Tue, 14 Mar 2017 21:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F05D4284C2 for ; Tue, 14 Mar 2017 21:34:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4B162855D; Tue, 14 Mar 2017 21:34:32 +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 5ACDB284C2 for ; Tue, 14 Mar 2017 21:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbdCNVec (ORCPT ); Tue, 14 Mar 2017 17:34:32 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:53663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbdCNVeb (ORCPT ); Tue, 14 Mar 2017 17:34:31 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MG9cl-1d312q2I47-00FAvX; Tue, 14 Mar 2017 22:34:19 +0100 From: Arnd Bergmann To: Masahiro Yamada , Michal Marek Cc: Arnd Bergmann , Namhyung Kim , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Date: Tue, 14 Mar 2017 22:33:27 +0100 Message-Id: <20170314213410.3762842-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:v235cOAKE9H/G569I6yP1J0pRCZ7GV8y4AlevBQYpWuNzofUwcl DSyuW1MeljHDoiKT6mkiyCKea4r0m+kNvZv+Odynggv51IC+XFXSvOg/en8a4EEKamcs4Od kkFTUIj0yqUICRSL0oyHMtKuDQ6ycAKWsLio5KA4chwdI3qyp5vsXyr5nhIislFSYdnf7LA +EACMjDw7PlVRWT8E00HQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:gNBSRRMEkXc=:WtHKgLsLAJgM1SbkKlmWsz SIJ3lb0eS784UapdC19o4YDK+O+WnjY3jcK3rkVp5aqJMEjgtEPGDI4GODQCNNPsedqRNxoB8 +fbhiBFVgxlf283fCjRtRnPEzrrO47MmHKyZ3ciIlyZ2c3lhHEvtDvuoGJUDt/lTWjgGgJASJ Hs7zsVQuzxP4Bk7KaQ9Yx2k3gd7FoidlaztiKi8CrNDOHKErLCBTYD0gyTabN/+cWZvmcgnTL odfFnyXYQ0rE7yrKo+au9YDWnXUWYovaqCGjyvWG1aK906LJZ7VAwJChC/YEY2hPgoc3G38CE cWZ3IpEDox8TMHvZc/8HJLazY3I41e9mMJz/A3WAvsN44hFBmIPF2vCJ1q5zfd7BaBmoK+xit Sr89Q/SnYEjBSglwbHXrpXUuBXHmovi15zC9TZvVj//h25pjAYsK0KRSxlluDuQ8gH9yzYxgn UyRBYuvS88IHk2dq5tKps5Q8WNmJqofmM2W0mjIWJosUU4bCUXVmR64Xwuwjgqt9T+331WGWA tgt376zph9xtTDBvnmD7b4qenVZqpDSMX+twS/MHAFh4pTCrORLdc+XGoyimFS0TP/uADgN8p A+i0gDubkiD/iiU0Ya66K++kZhDih0vbL52ot57J453iWejtKqM3FlFlerGY9b1VX7sjX2FcF 8vsjMRmFaNKDaGp67+/Iq0iGM+47kifS5fyKi4BIsxMPDdp8xLRgyJH49z5zi2uez0Ys= 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 --- Fixed version number in check as pointed out by Namhyung Kim --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 6e7e644a0b84..608727d3e47f 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,0409,$(call cc-option,-ffunction-sections,)) +else KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) +endif KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) endif