From patchwork Fri Feb 22 07:56:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10825385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7235922 for ; Fri, 22 Feb 2019 07:56:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95CBE31378 for ; Fri, 22 Feb 2019 07:56:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 851F531387; Fri, 22 Feb 2019 07:56:31 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 D647731378 for ; Fri, 22 Feb 2019 07:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726278AbfBVH4a (ORCPT ); Fri, 22 Feb 2019 02:56:30 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:44700 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbfBVH4a (ORCPT ); Fri, 22 Feb 2019 02:56:30 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x1M7uAvx019643; Fri, 22 Feb 2019 16:56:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x1M7uAvx019643 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550822171; bh=nM21wirB0PuY04024D776TjqtWJ2i0UQNqKT/+OVHEA=; h=From:To:Cc:Subject:Date:From; b=ttIW8bSiFufmjh+SxEYgR6dIwb+p94kHp+cg7eFoaFS0qJCCJ8Hy74yFjiHpO6abd lQ+YqBlYIx9Y3dzsvZWZzTjj0+HPcawfD66/W3qOCy4d3jcB6ieGqxeS8q+Ag10n+c 547SFA+uWqnuIrJ4oMncgilin8atG77bqw0mqvjQzgYvw3oRRI4sB+FSczqhZ+sGOj S0k7soTQv/46RkHUD50ieI5SjZ+/1pGsfgtJvYTcCTOVRFjkvSowJAcOWCbQakmpjt IgKWJ/rx/DYNiVSNJZly/Wp+lAh5MdQ14mRhI0qh+dly3hbbPYA8utRVF2nfPvKx0E fSGSVYLYdiSLg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig Date: Fri, 22 Feb 2019 16:56:09 +0900 Message-Id: <1550822169-2561-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 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 CONFIG_DEBUG_INFO_SPLIT and CONFIG_DEBUG_INFO_DWARF4 enable extra dwarf options if supported. You never know if they are really enabled since Makefile may silently turn them off. The actual behavior will match to the kernel configuration by testing those compiler flags in the Kconfig stage. Signed-off-by: Masahiro Yamada --- Makefile | 4 ++-- lib/Kconfig.debug | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bf4e77b..0f86257 100644 --- a/Makefile +++ b/Makefile @@ -735,14 +735,14 @@ DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments) ifdef CONFIG_DEBUG_INFO ifdef CONFIG_DEBUG_INFO_SPLIT -DEBUG_CFLAGS += $(call cc-option, -gsplit-dwarf, -g) +DEBUG_CFLAGS += -gsplit-dwarf else DEBUG_CFLAGS += -g endif KBUILD_AFLAGS += -Wa,-gdwarf-2 endif ifdef CONFIG_DEBUG_INFO_DWARF4 -DEBUG_CFLAGS += $(call cc-option, -gdwarf-4,) +DEBUG_CFLAGS += -gdwarf-4 endif ifdef CONFIG_DEBUG_INFO_REDUCED diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index d4df5b2..dfc9949 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -179,6 +179,7 @@ config DEBUG_INFO_REDUCED config DEBUG_INFO_SPLIT bool "Produce split debuginfo in .dwo files" depends on DEBUG_INFO + depends on $(cc-option,-gsplit-dwarf) help Generate debug info into separate .dwo files. This significantly reduces the build directory size for builds with DEBUG_INFO, @@ -194,6 +195,7 @@ config DEBUG_INFO_SPLIT config DEBUG_INFO_DWARF4 bool "Generate dwarf4 debuginfo" depends on DEBUG_INFO + depends on $(cc-option,-gdwarf-4) help Generate dwarf4 debug info. This requires recent versions of gcc and gdb. It makes the debug information larger.