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: 158995 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1432514jaa; Thu, 21 Feb 2019 23:56:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IbQ+J2bbxrUOJpyC2zlM7M938hmEWU/xvGnBVAZf98eCU+QH1sCkC8cYql92gAYz82LaNE/ X-Received: by 2002:a63:3dc8:: with SMTP id k191mr2599674pga.368.1550822193093; Thu, 21 Feb 2019 23:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550822193; cv=none; d=google.com; s=arc-20160816; b=lz7OpMhpKd00Td5vMahs3qtEV+xEfy1+FGLgXXl8x1gcRG9smguEHiU+3K1h0UncfX C/lOpzVWIpItYIsq9c+TZnImQGaO2WY3zjocaOrxpGo5VwEJbJ9zPMhle451rdt0BE4w tfEvi5yG3vVwAhjnNSIMj6cJYJ77b5NmWhyYvqsJ8qGmcyFkRFVNAa9de7w1AGDIiiRP QnoJeijWH1EvESGMvVFE2/ShY4wwegUcgyQuGRKmk0//8DIvCNWMWH5U9NvDgZFjcVdG 13sUtsNMs6Z8Ej0ZaVbY2ptfQrpw1CUN/6GMTIn9ItWM0OtuOp3M3rLzWYr1yPs65Qnx +UIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=nM21wirB0PuY04024D776TjqtWJ2i0UQNqKT/+OVHEA=; b=cbqKQX/PsKxPf/4lGQ3Pain2ltlA9HYj33pGQx27Jy2O3e5z3lCdmQGA+3i5f2rR8p roVQn3u7QIiV+bRLSSZCCPiGuSEO8xrI6gNDOICnaDl3O1GMSd+8zUd8Et5xzPX2y6hv p/QF+q/JRttBRjAGubb+wUYSBYDhclLrlNLIclSRbumtfFzjuCMeb4QvYYpmx2ccNxB1 JmutyVdg3sUhVP5CEO5Lmo7AXFbUK20m/W8CJYammiDApZuNyrg7C1HOPYyNFdLMWZWe ruvDneX3jYbV2rumPpXPOi7ENJ9ujfRNeWEu50MF0/WVh/S9RnAUQG0HtFlXleBuyQmz aOwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ttIW8bSi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si771296pfb.215.2019.02.21.23.56.32; Thu, 21 Feb 2019 23:56:33 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ttIW8bSi; 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 S1726517AbfBVH4a (ORCPT + 32 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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.