Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp787102rwe; Wed, 31 Aug 2022 10:59:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR4V1YJFc15e28aYfb5nzcNlKjhyNPRmlx+vNRDvGVPesIBO8CyYPdHC63/g4cUEJL8GN1m+ X-Received: by 2002:a63:ee55:0:b0:429:88cf:78df with SMTP id n21-20020a63ee55000000b0042988cf78dfmr22794920pgk.301.1661968740784; Wed, 31 Aug 2022 10:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661968740; cv=none; d=google.com; s=arc-20160816; b=sAAKlC+2NKbl8ApwYAX32WyWrv1rUqM/Uggj3mf7zSqJUg6W08VvGJINPlZmCXIPn/ 48YP28j/4v+5q7bXW0qO34byFSDh6odCBa69fJqNoJ98JOW7EE2WMt/zFkJOPsH8smru HPyp859HoUdUHePfH8gRuRaXZKnXUkyt+XFZO9ZgdXCgGydu2JSZ+SHVlqsMV0Y7jzpC eBUr6hI/kQCiZw1fccsqEIst2BMyotsbScu6tCpdgsIB4l9cbWbPQN0nh8Pb8TmbXGGD my47la1e6IrTc8KrD3h0X0VSVSfHReeGHVsWzt8d59qvVVUQTld2VDGw3ra1dhhGSUy1 nt9w== 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=n/oAIIbQC6X9/4TYjpXgoCLnqch074NpwWXcWhpGZUU=; b=RDm7ZoZYrhlvpV5qQMeNRRaIqfws29X4MrvN9MywyWFUF5NhDneX0mRiBRH+bRDEc7 uQjL7vb5LEFvl7DPCyv1Y9lo6w9esCKml4ISpve5uioQVmb4Q9FB7UCoh6ZFHxKlc+Lq AUNLBRexvd1wnVa4hQzq+jQIS7zekHga06qTnKpsbNK6C9tv+mt3Ij39g27rv/N/AKjs JSCbbAXrx2RRSXsHGuEnaN55SZ3NihbHsfZMksJ0rQJqnCPhlkO3kOsOBAn/mnaupLyy op36c/IjkWEugXnWQEEtDXEoof5tUQ3BmGxwkyCQDmSxXH6JRJ884JZOaAlpx6Hlfd0C Kx2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kzWNO0R5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a635705000000b0042c3fd6d02bsi5290254pgb.561.2022.08.31.10.58.48; Wed, 31 Aug 2022 10:59:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kzWNO0R5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232032AbiHaRly (ORCPT + 99 others); Wed, 31 Aug 2022 13:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232003AbiHaRlS (ORCPT ); Wed, 31 Aug 2022 13:41:18 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAAC7E0BB for ; Wed, 31 Aug 2022 10:40:37 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id c7so12563836wrp.11 for ; Wed, 31 Aug 2022 10:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=n/oAIIbQC6X9/4TYjpXgoCLnqch074NpwWXcWhpGZUU=; b=kzWNO0R5mowae1zsB33fojPTZwHoiimNytdIdEM9pAl9vTa3Km02k8esak+mL45vSJ XHlpH5qoILPtWK/pDKEvlh4xe4S3bsXvLbxG8xZ34ERouN2lElUkWXkQQ0wZD1QdCEvE pYp2eFyBg0AModntqsO5EUP3Aoyc4RsDQngD4NVmVROQAEN4+Q6/feAv1WDh+z6PTH8Q W0I9equd8n5PcsPy2cdsjGxjBafA0r5/CGliM6dOBkSkSXJAiBytlaR1eTNhV1RGBJ9v bW7CANGbl7HCnIGKz483Z92xH1mfXxhkdEB4HHWLc59xZI2abJ4UQW+xDEnzDwlZ32jp ZW7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=n/oAIIbQC6X9/4TYjpXgoCLnqch074NpwWXcWhpGZUU=; b=ZY8OxkV8lwXJQ77MPCALGO6400U+XTdyw2vxw/YayrSKI/wtpVYudT+CKXD4aRKwXL dCctNX75xQnms+aYRGeBtXrK0/ptWG2GmhpZl8c0S3ekaYnnBbblv9XxifdK2frnxaCC V0X0fHUz6YEaYaVCQ07zFMiVSXOHcPrtOHJHkfQJeGm4Gr9+sLgapnuUIh2djs0Fe+5h YT4rczNlQFPnSBpepkN+10QcujFLngB6SDTXkFnaXLF7Q4uniOCUkTRi7a3lebwZCfMK IVpK+Ul1bCd87bs6LvK7XgLcfd/F3IEAbiRi0VkwZqkG+QSf8wfB2a2ioU6cBo193goh /5ww== X-Gm-Message-State: ACgBeo0+gNbukVub40MQ6j5lAuMjwQfL6/Hcb69OmHOYrkuetUQLVr4c GlHH7MK7/XF+FIhy9BAarK3uDyU37LugxS93xZNuVQ== X-Received: by 2002:a05:6000:813:b0:226:da5a:84a9 with SMTP id bt19-20020a056000081300b00226da5a84a9mr9049383wrb.309.1661967636251; Wed, 31 Aug 2022 10:40:36 -0700 (PDT) MIME-Version: 1.0 References: <20220826181035.859042-1-ndesaulniers@google.com> <20220826181035.859042-4-ndesaulniers@google.com> In-Reply-To: <20220826181035.859042-4-ndesaulniers@google.com> From: Nick Desaulniers Date: Wed, 31 Aug 2022 10:40:24 -0700 Message-ID: Subject: Re: [PATCH 3/3] Makefile.debug: set -g unconditional on CONFIG_DEBUG_INFO_SPLIT To: Andi Kleen , Arnd Bergmann Cc: Michal Marek , Nathan Chancellor , Tom Rix , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, x86@kernel.org, Dmitrii Bundin , Fangrui Song , Alexey Alexandrov , Bill Wendling , Greg Thelen , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 26, 2022 at 11:10 AM Nick Desaulniers wrote: > > Dmitrii, Fangrui, and Mashahiro note: > > Before GCC 11 and Clang 12 -gsplit-dwarf implicitly uses -g2. > > Fix CONFIG_DEBUG_INFO_SPLIT for gcc-11+ & clang-12+ which now need -g > specified in order for -gsplit-dwarf to work at all. Looking at commit 866ced950bcd ("kbuild: Support split debug info v4") I'm curious whether -gsplit-dwarf needed to be mutually exclusive with -g, possibly for older compilers? Andi, do you recall? I have gcc-9 handy; that doesn't seem to be the case. I get the same size binary with `-gsplit-dwarf` as I do with `-g -gsplit-dwarf`. So it does seem like mutual exclusion between the two is not necessary. x86_64-gcc-5.5.0-nolibc-x86_64-linux.tar.gz from https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/5.5.0/ seems to really need libisl.so.15... $ cd /tmp $ wget https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/5.5.0/x86_64-gcc-5.5.0-nolibc-x86_64-linux.tar.gz $ echo "void foo(void) {}" > x.c $ ./gcc-5.5.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc-5.5.0 -gsplit-dwarf x.c -c /tmp/gcc-5.5.0-nolibc/x86_64-linux/bin/../libexec/gcc/x86_64-linux/5.5.0/cc1: error while loading shared libraries: libisl.so.15: cannot open shared object file: No such file or directory $ find /usr/lib -name libisl\* /usr/lib/x86_64-linux-gnu/libisl.so.23.2.0 /usr/lib/x86_64-linux-gnu/libisl.so.23 /usr/lib/x86_64-linux-gnu/libisl.a /usr/lib/x86_64-linux-gnu/libisl.so > > Link: https://lore.kernel.org/lkml/20220815013317.26121-1-dmitrii.bundin.a@gmail.com/ > Link: https://lore.kernel.org/lkml/CAK7LNARPAmsJD5XKAw7m_X2g7Fi-CAAsWDQiP7+ANBjkg7R7ng@mail.gmail.com/ > Link: https://reviews.llvm.org/D80391 > Reported-by: Dmitrii Bundin > Reported-by: Fangrui Song > Reported-by: Masahiro Yamada > Suggested-by: Dmitrii Bundin > Signed-off-by: Nick Desaulniers > --- > scripts/Makefile.debug | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug > index a7a6da7f6e7d..0f9912f7bd4c 100644 > --- a/scripts/Makefile.debug > +++ b/scripts/Makefile.debug > @@ -1,10 +1,8 @@ > -DEBUG_CFLAGS := > +DEBUG_CFLAGS := -g > +KBUILD_AFLAGS += -g > > ifdef CONFIG_DEBUG_INFO_SPLIT > DEBUG_CFLAGS += -gsplit-dwarf > -else > -DEBUG_CFLAGS += -g > -KBUILD_AFLAGS += -g > endif > > ifdef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT > -- > 2.37.2.672.g94769d06f0-goog > -- Thanks, ~Nick Desaulniers