From patchwork Tue Mar 14 21:35:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9624569 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 08A6360244 for ; Tue, 14 Mar 2017 21:37:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4EDC28537 for ; Tue, 14 Mar 2017 21:37:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D856C2857D; Tue, 14 Mar 2017 21:37:22 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 6DD9728537 for ; Tue, 14 Mar 2017 21:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750787AbdCNVhW (ORCPT ); Tue, 14 Mar 2017 17:37:22 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:62491 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736AbdCNVhW (ORCPT ); Tue, 14 Mar 2017 17:37:22 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDHpc-1d000b2o6G-00GcFD; Tue, 14 Mar 2017 22:36:09 +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] [v333kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Date: Tue, 14 Mar 2017 22:35:51 +0100 Message-Id: <20170314213600.3812349-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:iKMKx6NiAcIsitsAC8ngwT+tAHyrsMHSk6KKuKDvegf5L8j0yjH G8w3fQjLCJ2786bDDsNcCK4rm2Yxs2ReKDOoDGKsO8IoVEKcsvoe2tQyt0GgCBSzBysGh8P aj9oi3U4N/Zd4CH6h1tv6Zk1DtHNfj1rb+IL4snB4P5d7FLk38zlDEC0kvzJrPYskigBni4 W41LFJfL51Ee6AQ0K6Mag== X-UI-Out-Filterresults: notjunk:1; V01:K0:+VjtLYtNI94=:VvaOckNy2uvn2FKzyl813r nXkO/RcS3/xAM+qYQLVv4XEPFW0tdh7D9/RRCvRSdoOah551uGgNu2YcJ11dhs7JKcDqHauVt q148SUyb0XWtn2lGzfhgFTDPsqX0hwZuipCYJ+sdF80+4jKV/MCXqKuYH1n8yV8UAQPPKnRGp qVZ1hWngsNKwX2OuMQiwTdTLpWB7F26mrar5pnG/hOSaS6SmOto3zfVolijnyt4XpsFTUt56w 8lMc6spV0GYRtjugZdp5l0uvLupp3bSkWNQAbPyq/PHZzSFf4TcmfLjk9tfEAeN45noBVKK7F eaw/mynqQrlgEI8iAYy/IRMmJXVVZBHZQcxz/7KD7GI4kaO2xpiBx1LRZXs3JcHDQegFzClMV +XQiRamYCO4P48kVxCq8dA5AJ1UxSpO6zKTnUDqkdmhCI2dxLxwSWh8pQLgxzAONG70/qMm2f DqWrzCwoeBVjFpabvCuzZccjRZDGQAMogxeANUJuif5ltp/5IVCCsCRk/G/DbQ7DcwhHig3BC ntmDrN0/LqScHEryt1PIueKDrw4IFtcnNDzV/vWHnoioKX7jwk7BRkl57WYHljV3CUqyVcKAG x9jCd10u0QzOThtT7zcPHA5CnS7obBZ2S0QBbWIC9menBt7UUEKqcReb5LPoKTiaG7oq3B1gV 3ky+VTPBA8eNWcNwemZsSwcDgiZKST1wJq+EsQhmk6o1qgEAmTCeSoFC2wBSv6LxKSOE= 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: actually 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