Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp824769pxb; Wed, 13 Jan 2021 17:33:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzElmvuIyZGueCxqc08zY9XgJIpADvnaC4HjAVaaZoBWxhsiikkcNKKW0MsRmvHE9+HvZ7e X-Received: by 2002:a17:906:30d3:: with SMTP id b19mr3495464ejb.538.1610587982719; Wed, 13 Jan 2021 17:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610587982; cv=none; d=google.com; s=arc-20160816; b=xJV+7HAgCgPwWodtUV48nqNsAgLTu8uPyvAvjiUYcZp0ecafnXmy9nVgBDFSckWbX+ 1aqCSKc6hm9zMp5fykRx/J78PV11lf4652C83/RrVHI5/26dfNqcPtfu/yJ7RBEn9d2g eQJBRLHu/pXypSh9OmDQnOwJtgyDK37vDf13zA2+XjHiL1fWY6Z8vE1f3D7ebax6FEf3 P4XhAz7mctjODuAwGRhPDrM+VNZJZY4j/3jPN6hbOy4jfROprvcHZvjQHgFdwMtJcBet 8lDAAPAVPOVrD3B6KX3M9JGY1A60VFqh3nyHk/3rXDyDQMca9r6No3S76tL1Zsjpun/G xJ7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Rhh6w6PnAshqzzDi7tIorGSnjSwjXHOfLfkdJH6Oxgk=; b=jOEBQKfgXS/5832+sJot0xrNja4ZmXqJa7leSzkpqj57adXabwtlhLIzHMS6WFRzRE P3iCEx0VrDogZUxO1EC4ByApJBVXnJB6fLzLzEKT7rHp6dY8GmkMrSZ5US/WSkqbTVrw 5kCCqS/WqAV+c8JKSPbzPlzqH+y3VQn8Puax82bCiOi8BCPb8RiszRpTCgPDmWTtaFfC SmmE9PQ7bBW2xcLVRiCTZ0RaZhJT6RciXB04Y32rAnRwPzYlgCPviHagqWy03wSBGmoH IAVaR1Zf3B7MHAvedchHoo99VFKKTFiRbdk4btgWANO/MFDwLQOi/TTCbkCElunuKVDf Y7ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UsAe64kO; 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 a89si1872766edf.215.2021.01.13.17.32.15; Wed, 13 Jan 2021 17:33:02 -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=UsAe64kO; 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 S1727496AbhANB2K (ORCPT + 99 others); Wed, 13 Jan 2021 20:28:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726429AbhANBT6 (ORCPT ); Wed, 13 Jan 2021 20:19:58 -0500 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DEA1C0617AB for ; Wed, 13 Jan 2021 15:27:22 -0800 (PST) Received: by mail-pf1-x42c.google.com with SMTP id c12so2214376pfo.10 for ; Wed, 13 Jan 2021 15:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rhh6w6PnAshqzzDi7tIorGSnjSwjXHOfLfkdJH6Oxgk=; b=UsAe64kOAc8ogK7jOBzOesd7Gj13f2B4Po8m+3R3dmVXJk6pEq3gYcmuaRd7El09bO Pp9zCxf2v08t8ZWzssQTx0k0WdOnBcT3jgcHctNfwEtJoZYm3e3My7kUgzf5amFidX7U 3RAcgUTqJ/nW4n7VBXamre7h42HseZwdwLdsy8OXsvbzJcBMowDxF2ZoCDZz1+kzzXJv j704xO1uL9COVu3l3LUelEPeCyK9q/+k0NcEh72F2vqTVL5V6wFlhm4hKS66EXiGDsqT OIP8nNh5erhaKpw9pbAOhJIe0W3K8OMJi6dJhV32YQQE5oiccvLsW6hzifztteos5F4h cXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rhh6w6PnAshqzzDi7tIorGSnjSwjXHOfLfkdJH6Oxgk=; b=e/PZAv/ADC/vjBgESQ4PjOY0mqrDRgJQ5xZG0rTaUhRxOSMLXne9y8RpLg8tumnWYR 9G8353FudHFhL6s/oMSrS9Wj5mncQ8N22Ohs1pBuaK0C2DA6hltLllxaq+iUEocaP3WO u5EIOkRqIUQS/XCBibx4rDFCirkc3dekh7tKiwvvyBZ1XTNwOpQvb3gv4QqEOcy5Ap/m DFpbwnEGYHo2rZLiPl8FYsCE1ofdtBPRCAN1lTf0tl4vB0fgCdjEazO8otB74RMHz96w NuArKn8lJaZf1/5ADxMrkuCrZJ93LSxaOD9kaVKIlfnCYqYo/6DlxzLZV/yCTM60kcon 5Dxg== X-Gm-Message-State: AOAM532dRay9azmLD/fy9KYQq99Gg0ZUoYQPQseVdBHu2/uk45chR2em balqCFq/IKKcNd8M5UOszEZVQ5ylR+0FEuWatDImQ5vSEJmiYg== X-Received: by 2002:a63:1142:: with SMTP id 2mr4397001pgr.263.1610580441323; Wed, 13 Jan 2021 15:27:21 -0800 (PST) MIME-Version: 1.0 References: <20210113003235.716547-1-ndesaulniers@google.com> <20210113003235.716547-3-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Wed, 13 Jan 2021 15:27:09 -0800 Message-ID: Subject: Re: [PATCH v4 2/3] Kbuild: make DWARF version a choice To: Sedat Dilek Cc: Masahiro Yamada , Nathan Chancellor , Andrew Morton , LKML , Clang-Built-Linux ML , Linux Kbuild mailing list , linux-arch , Jakub Jelinek , Fangrui Song , Caroline Tice , Nick Clifton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sedat, Thanks for testing, and congrats on https://lwn.net/Articles/839772/. I always appreciate you taking the time to help test my work, and other Clang+Linux kernel patches! On Wed, Jan 13, 2021 at 1:24 PM Sedat Dilek wrote: > > On Wed, Jan 13, 2021 at 1:32 AM Nick Desaulniers > wrote: > > > > --- a/Makefile > > +++ b/Makefile > > @@ -826,12 +826,16 @@ else > > DEBUG_CFLAGS += -g > > endif > > > > -ifneq ($(LLVM_IAS),1) > > -KBUILD_AFLAGS += -Wa,-gdwarf-2 > > +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF2) := 2 > > +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 > > +DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) ^ DEBUG_CFLAGS are set for everyone (all toolchains) if CONFIG_DEBUG_INFO is defined. > > +ifneq ($(dwarf-version-y)$(LLVM_IAS),21) ^ "If not using dwarf 2 and LLVM_IAS=1", ie. CONFIG_DEBUG_INFO_DWARF5 && CONFIG_CC_IS_GCC > > +# Binutils 2.35+ required for -gdwarf-4+ support. > > +dwarf-aflag := $(call as-option,-Wa$(comma)-gdwarf-$(dwarf-version-y)) > > +ifdef CONFIG_CC_IS_CLANG ^ "if clang" > > +DEBUG_CFLAGS += $(dwarf-aflag) > > endif > > Why is that "ifdef CONFIG_CC_IS_CLANG"? That's what Arvind requested on v2, IIUC: https://lore.kernel.org/lkml/X8psgMuL4jMjP%2FOy@rani.riverdale.lan/ > When I use GCC v10.2.1 DEBUG_CFLAGS are not set. You should have -gdwarf-4 (and not -Wa,-gwarf-4) set for DEBUG_CFLAGS when compiling with GCC and enabling CONFIG_DEBUG_INFO_DWARF4. Can you please confirm? (Perhaps you may have accidentally disabled CONFIG_DEBUG_INFO by rerunning `make defconfig`?) -- Thanks, ~Nick Desaulniers