Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp45453pxb; Tue, 12 Jan 2021 19:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIKJoMfJ+9AAegcWRxL7M1Ba1n923yEFixKtBfyk7CtH7yxl30MJkNiildb2zmJVhMIB85 X-Received: by 2002:a17:907:3f9e:: with SMTP id hr30mr57075ejc.445.1610508834586; Tue, 12 Jan 2021 19:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610508834; cv=none; d=google.com; s=arc-20160816; b=huKkpWLARNlTfTjq6cIjZETBPtQhLo4B3U1WrMY+qEHqJZiSpTyVFH9mTqAT37bgZv 5A9ZaD/9+vy7TKjdVY8GhM7pnRbg/DfflG92FnLWogJLVqn3bd887lt/p4OWFd+aENjs Y4rCbAlBynUyfH7q3oy6Uz5CYVUdUu8PR4dXy/J25zur/2phv4FZiffJK+qGRHRZ3JDD bDUOxoZfgF8mJe1zMU3oWu0vmtr82oetQJ7KPeyUHCDzohORVDdj6H8poKWBmQekzVlv J0FPWvuMmooF4edzAykfZTW63wziWPekuzHOcR8SvLIMUVAsdymJdLY0xkFR49B6rhRX u2eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=dP6j6wcQj1tq0vOLcWGfFHo7iRnRUUl3C2I4O7J7Ozg=; b=owsmHAPi3j0zhJtgVEOyYt/NgK6a9OueRkoZsBrNRiAODqsZ3IcemDDOdQ8wAOwypM M6LkLzVgnkfLSQdvDzmhfAKVtUp7TTvV/UoVptWTA7A1XQX9j3BRt0K13mwerr2qOPyS ngz6CW46s/315XEiHy1Pi4K/0sIvqIF3pa+PyDmsHIBUEKBo8g8Gnq8xcv5Un1uX0YsQ cqAZV0/mlh/upRIELfRmoTwdqQaDJpYR8s+/kBEYQhuvVzrms4oi+AnRakQsoyF17Mas CNifA87M8buj9Hn9w+/LdtRHL0pnM4qSVjpnULdvYd0/uGXCrDeTIGRBEDjFqfMZcUfG xUyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HZ1OdG3A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn19si330946ejc.106.2021.01.12.19.33.31; Tue, 12 Jan 2021 19:33:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HZ1OdG3A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393741AbhAMAnM (ORCPT + 99 others); Tue, 12 Jan 2021 19:43:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392402AbhAMAd3 (ORCPT ); Tue, 12 Jan 2021 19:33:29 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B413C061795 for ; Tue, 12 Jan 2021 16:32:49 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id 18so334298pgf.19 for ; Tue, 12 Jan 2021 16:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=dP6j6wcQj1tq0vOLcWGfFHo7iRnRUUl3C2I4O7J7Ozg=; b=HZ1OdG3AUYYjnfuIgSl2h48zf8Lc8TWv0B1ET6Q23GEo4BkJjbddMItpDsuFBvKrjp V9Lybk1v5NoyoXQzjgPuD0Ee1SNw1OxfZtUOc8wKcVYm4W1/MwBB6QvZHbqNoY/5YpPI Rs52mOOCneWpnNsEPyrAYvG5JiqK8UYr0BMxT4NCHNiMeH1Q/JCt2u64AbB/Hgo/+8gO 0zySVBzWlPqREI+U/ri2WS5YZBEC6gtegTnMcwfo1ee7cyJe3m5EMt1llZJ6L1XQMULn VXuv6CbDtvOq/NBp8KrxjW2cxl8BIqo5o+XRXSPs48u4akZ1PtV6XAaWUyupqa7rX0wb 3cMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dP6j6wcQj1tq0vOLcWGfFHo7iRnRUUl3C2I4O7J7Ozg=; b=X1M/qNnfnlRqwbfgwuxFbsjosLw0dZekb2m5+IjhyEZbh+Yf8jP5R7EerKTudM/svs DS8HyuTXkSxMI7HnyjkGCUuj5I9pCJkoSQgYU9BgTbpigX9T249Rvep0k9DOFmXfVx6n geWYio3lmB5W7qDn/RK47l+ekt0jJ7Vrghm2cx1C+SsKHvIgegmbwcwKM8LEA/ATHRd+ 4+GD/2lGfdRB5ROWjSJ+qlRXRg+5JvikoaAVVgw+WY/iSI1asak9isl+lHAYBdEtgY01 rApO9v6YUCZJza6KA9CqiZZm+Lpvae/0MH4cw+QYb9I3CQuyEpVYHG7K8eJ/mMlMGtXi laOg== X-Gm-Message-State: AOAM530Y6SLlml1mTN1jvST/hojL7IX7x/NbS+h3Hg1Z3G2qw55n5i49 KFEmsh4tbD08iiTHYEHVjKj1XbvvA4Bqkg3LUAo= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a17:90a:ce0c:: with SMTP id f12mr301315pju.89.1610497969060; Tue, 12 Jan 2021 16:32:49 -0800 (PST) Date: Tue, 12 Jan 2021 16:32:33 -0800 In-Reply-To: <20210113003235.716547-1-ndesaulniers@google.com> Message-Id: <20210113003235.716547-2-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210113003235.716547-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH v4 1/3] Remove $(cc-option,-gdwarf-4) dependency from CONFIG_DEBUG_INFO_DWARF4 From: Nick Desaulniers To: Masahiro Yamada Cc: Nathan Chancellor , Andrew Morton , Sedat Dilek , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, Jakub Jelinek , Fangrui Song , Caroline Tice , Nick Clifton , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada The -gdwarf-4 flag is supported by GCC 4.5+, and also by Clang. You can see it at https://godbolt.org/z/6ed1oW For gcc 4.5.3 pane, line 37: .value 0x4 For clang 10.0.1 pane, line 117: .short 4 Given Documentation/process/changes.rst stating GCC 4.9 is the minimal version, this cc-option is unneeded. Note ---- CONFIG_DEBUG_INFO_DWARF4 controls the DWARF version only for C files. As you can see in the top Makefile, -gdwarf-4 is only passed to CFLAGS. ifdef CONFIG_DEBUG_INFO_DWARF4 DEBUG_CFLAGS += -gdwarf-4 endif This flag is used when compiling *.c files. On the other hand, the assembler is always given -gdwarf-2. KBUILD_AFLAGS += -Wa,-gdwarf-2 Hence, the debug info that comes from *.S files is always DWARF v2. This is simply because GAS supported only -gdwarf-2 for a long time. Recently, GAS gained the support for --dwarf-[3|4|5] options. [1] And, also we have Clang integrated assembler. So, the debug info for *.S files might be improved if we want. In my understanding, the current code is intentional, not a bug. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=31bf18645d98b4d3d7357353be840e320649a67d Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- lib/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 78361f0abe3a..dd7d8d35b2a5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -258,7 +258,6 @@ config DEBUG_INFO_SPLIT config DEBUG_INFO_DWARF4 bool "Generate dwarf4 debuginfo" - 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. -- 2.30.0.284.gd98b1dd5eaa7-goog