From patchwork Tue Oct 7 12:13:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 5045511 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81D2D9F295 for ; Tue, 7 Oct 2014 12:14:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB93A20211 for ; Tue, 7 Oct 2014 12:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCCBD201FE for ; Tue, 7 Oct 2014 12:14:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753712AbaJGMOA (ORCPT ); Tue, 7 Oct 2014 08:14:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47392 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbaJGMN7 (ORCPT ); Tue, 7 Oct 2014 08:13:59 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6D54EADB5; Tue, 7 Oct 2014 12:13:57 +0000 (UTC) Received: by sepie.suse.cz (Postfix, from userid 10020) id E6CB74087B; Tue, 7 Oct 2014 14:13:56 +0200 (CEST) Date: Tue, 7 Oct 2014 14:13:56 +0200 From: Michal Marek To: Borislav Petkov , linux-kbuild@vger.kernel.org Cc: LKML , X86 ML Subject: Re: [PATCH] Kbuild: Check for CONFIG_READABLE_ASM when building .s targets Message-ID: <20141007121356.GA18003@sepie.suse.cz> References: <1412523154-25602-1-git-send-email-bp@alien8.de> <20141005155816.GB9377@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141005155816.GB9377@pd.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 On 2014-10-05 17:58, Borislav Petkov wrote: > On Sun, Oct 05, 2014 at 05:32:34PM +0200, Borislav Petkov wrote: >> 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. > > Not really: so this is enabled by CONFIG_DEBUG_INFO and there are two > options: we make CONFIG_READABLE_ASM depend on it which makes people > answer a couple more questions or we simply add it to the command > building the .s file. > > I say we do the second thing: > > -- > From: Borislav Petkov > Subject: [PATCH -v1.1] Kbuild: Check for CONFIG_READABLE_ASM when building .s targets > > 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. > > So issue a warning that the asm output might not be optimally readable > if that option is disabled. > > Additionally, add the -g switch to the .s build command so that gcc > issues line numbers too. This violates the principle of least surprise: make $file.s as -o $file.o $file.s should be equivalent to make $file.o Why not simply check both READABLE_ASM and DEBUG_INFO? Also, it's more straightforward to print the warning in the top-level Makefile rule than to add a conditional to the generic rule, like this: I wonder if the whole check shouldn't be wrapped in an ifdef CONFIG_DEBUG_KERNEL. Michal --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Makefile b/Makefile index 106f300..2b4f62f 100644 --- a/Makefile +++ b/Makefile @@ -1505,6 +1505,9 @@ else endif %.s: %.c prepare scripts FORCE +ifeq ($(CONFIG_READABLE_ASM)$(CONFIG_DEBUG_INFO),) + $(warning Enable CONFIG_READABLE_ASM and CONFIG_DEBUG_INFO more helpful asm) +endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.i: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)