From patchwork Fri Dec 16 09:24:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101403 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1296751qgi; Fri, 16 Dec 2016 01:26:51 -0800 (PST) X-Received: by 10.98.152.3 with SMTP id q3mr2083300pfd.144.1481880411514; Fri, 16 Dec 2016 01:26:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si6956163plp.46.2016.12.16.01.26.50; Fri, 16 Dec 2016 01:26:51 -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 S1760428AbcLPJ0q (ORCPT + 25 others); Fri, 16 Dec 2016 04:26:46 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:58250 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760330AbcLPJ0U (ORCPT ); Fri, 16 Dec 2016 04:26:20 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Le4aK-1cyXQT1zqu-00psUX; Fri, 16 Dec 2016 10:25:05 +0100 From: Arnd Bergmann To: Michal Marek Cc: Arnd Bergmann , Nicolas Pitre , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Date: Fri, 16 Dec 2016 10:24:53 +0100 Message-Id: <20161216092503.2654754-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Gz2VOy6nID6kP/WU7G21+bWmU+d4pNiEXVRaqWaoZ17FZ+tq+uH J6MAI5U183xH7I2rfFwwnt0EfG2CKda7UNN4q6GrRMGU0ES52OyEjyyMtFT/AobrTaYsmjY UDL9Vk5IokMw0wLmq5drl55Baq9iQaP8SpLDovIyh8YBN0fHRMOw0vS9/Mv1F4GHR1fso6i CLCPRFnv0u6Qj+0kZvr6g== X-UI-Out-Filterresults: notjunk:1; V01:K0:NkD6ogSyluQ=:QV7kxTeBhwFlCyyIPkaf81 NEGmAne0xriHW4bGqfrZHz2dzwok6eVIcpOsKO5OMm9hR0TvNeLElvr5WoshKtN84hIfV9arV XYeKlcU9jcaKxoJTdrB+E8uvUSxJ2NH5Tmfdau98vUP2V1a3H0yclKEa4X+VryEryZhujWxcL EA4s91KXO88rZ0YKv7aYux0YOLtCJ8KxTeRibkF8qLaSVV6X5G0bFFo8W5MzqL/nv0GBKwatj yin86qezT9oDgfK/ZeRe5bhptPn3s3vkhsHmv+Ubaxs+Cj9YCom6QMQTIzaqX/OkPZCZQ3Ely C0WnpHti2/6gkzLrzJrAiw7ia23KAdCz09UZiqfS4xc6Q0/Gm1wbZvVqAmYJQ4AOXxjkl6cv2 eFJ0GSfzFPrzbSqbN01P7x4a16A9JfeSQ9nj42lAGL30O685hK+iWC5HTDMmlD7avbMLTz7Bg +qNQqsoSpNL4bLhXlOl60pmBvJZwwVb8fB76Z0xKcNR0pYAWnmK6ePTwH60H8tn/gU0LAzGIA Yql2AHCw9IiqqFDj1Wcv9sy6iGUxpm6tMXfQGXnbJC5xtIifzTZxgOOfiVqDW60er/joKePQF WOyhDzQrzlq60GF0bh3yQyrET+8IK7mvaE8rAbJx3Kr5HtuKFnoIh5bnnCx500W9T5HOo7nID xYVfADRiIl31OL2Pd1nFTKobAGCBzd/mQKlez26Fkwrcu08W7TxLRNnv3cH6IjQ6Dgu0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) -- 2.9.0 diff --git a/Makefile b/Makefile index 4fb4b889c862..7dfd0aa4f3f7 100644 --- a/Makefile +++ b/Makefile @@ -638,7 +638,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) 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