From patchwork Sun Oct 5 15:32:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 5033951 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D7E4C11AB for ; Sun, 5 Oct 2014 15:32:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6648A201F5 for ; Sun, 5 Oct 2014 15:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44BA7201F2 for ; Sun, 5 Oct 2014 15:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbaJEPcl (ORCPT ); Sun, 5 Oct 2014 11:32:41 -0400 Received: from mail.skyhub.de ([78.46.96.112]:60826 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbaJEPck (ORCPT ); Sun, 5 Oct 2014 11:32:40 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1412523159; bh=bL+f4ywoy4sS4Xg7896OuOFh+5vGGkOGmjfflQqNepw=; h=From:To:Cc:Subject:Date:Message-Id; b=WkKRe+cUJjd0NIA/zyxsmtJc6GP a8scWLTiq7ne3K2/VSoVUzdxIvZ+k8+ZUeRvZlbZX67ZHR1YHBsmNG2rLQntboFHR5u n7bS7wNKqE3ErlERDhqE9VfVqfWsSNgsb0QNOkUHFTwRhX5mYo+nGGjjfVTffJyPfxe va8AjEgaVo= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eMRnQayKtHfD; Sun, 5 Oct 2014 17:32:38 +0200 (CEST) Received: from liondog.tnic (p5DDC4E49.dip0.t-ipconnect.de [93.220.78.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 584651D9895; Sun, 5 Oct 2014 17:32:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1412523158; bh=bL+f4ywoy4sS4Xg7896OuOFh+5vGGkOGmjfflQqNepw=; h=From:To:Cc:Subject:Date:Message-Id; b=bKrcN93ArL5lUNg4Xnf4rRF7ZOU qp0jhwPHhem+MPlwqhB4kq4zoOPIepcxDDwx07QE5DgPzBCPMb7wrFaJ0sFUkHiBqVF MproQTMZwu0C2mFfBvzmSBZpyNi+gKMXKanYlwnPRbdeIIezcXi5kTDLL+da/8sbZ28 NESrcwaKt8= Received: by liondog.tnic (Postfix, from userid 1000) id C50441002DA; Sun, 5 Oct 2014 17:32:34 +0200 (CEST) From: Borislav Petkov To: linux-kbuild@vger.kernel.org Cc: Michal Marek , LKML , X86 ML Subject: [PATCH] Kbuild: Check for CONFIG_READABLE_ASM when building .s targets Date: Sun, 5 Oct 2014 17:32:34 +0200 Message-Id: <1412523154-25602-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.0.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Borislav Petkov We do need to look at the asm output of c files for various reasons. In order to do so, we do make .s. However, it can happen that the Kconfig option which enables the creation of readable asm CONFIG_READABLE_ASM is disabled. What is more, we want this option enabled because it indirectly enables the issue of line numbers in the asm done by gcc's switch -g. So issue a warning that the asm output might not be optimally readable if that option is disabled. Signed-off-by: Borislav Petkov --- Makefile | 2 +- scripts/Makefile.build | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e43244263306..d9b505360c2a 100644 --- a/Makefile +++ b/Makefile @@ -1513,7 +1513,7 @@ else endif %.s: %.c prepare scripts FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) + $(Q)$(MAKE) $(build)=$(build-dir) asm_target=$@ $(target-dir)$(notdir $@) %.i: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.o: %.c prepare scripts FORCE diff --git a/scripts/Makefile.build b/scripts/Makefile.build index bf3e6778cd71..8aaf1c04fe18 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -147,7 +147,12 @@ $(multi-objs-y:.o=.s) : modname = $(modname-multi) $(multi-objs-y:.o=.lst) : modname = $(modname-multi) quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ -cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< +cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< \ + $(if $(findstring $(asm_target),$@),\ + $(if $(__cmd_cc_s_c_once),,\ + $(if $(CONFIG_READABLE_ASM),,\ + $(warning Enable CONFIG_READABLE_ASM for more helpful asm); \ + $(eval __cmd_cc_s_c_once=1)))) \ $(obj)/%.s: $(src)/%.c FORCE $(call if_changed_dep,cc_s_c)