From nobody Tue Apr 7 14:54:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE7CCECAAA6 for ; Fri, 26 Aug 2022 18:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344990AbiHZSLE (ORCPT ); Fri, 26 Aug 2022 14:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344970AbiHZSKw (ORCPT ); Fri, 26 Aug 2022 14:10:52 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2429CBD0A0 for ; Fri, 26 Aug 2022 11:10:51 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-3360c0f0583so37142217b3.2 for ; Fri, 26 Aug 2022 11:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc; bh=+rojwMFSR1ktivBcLatbShichab85h559FFhXLBJsbQ=; b=d4+SAZcB49L1Pz5691krlFA1DIyOTvq2Luh257EaP1K/PH0dmddhrS56CK7oNvjTCq JYW3is9kyarysYwRgAyND3s3bxVw/jubRHzTepqU8ADf1ANplMvsHHy3sUZbgip1TrYi VQMolp4u+aOxwOmOth5Tljke2JmC0du+AIf40liTCnqtb1TQYByhptbt3UfS9P2/7Pn7 V5D0Be+0FdKEK5I/9qKIW+ZDCqEWhahEwZ+F4wuKJ1GglG/LNWUg3D3IskGzoZvboVlp hoMcfu+1N82G+jY1PxSMeTMZaBdq+6+I+UxN62ZsTG3R3DeZx5dd48VB8uYWHkru790q LStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc; bh=+rojwMFSR1ktivBcLatbShichab85h559FFhXLBJsbQ=; b=BdZnM/P7qWTb3nm9xf5YGAKiVZOYUqonsoF6tRbspM5H6OXIdNN6gCVvmBFaUoT7dV 3MQPWwnZMarOtaSPX0uNukMSoiQeWt3uwv+1SQplSexivNinAGhoXNrZ1oHyEePeefpX s5e56hrnmC9BTlG12Spw28urp3yBN3eFSf/Qp2yKPeVOCnguG6QZngtjD0K3okqmmFlk 4ZFEyVBA08vHyVYUlGkXk/QUboBsZRlyIsLoOji2LtMUdn6UXSz9dGk1aVYTQhKKuyII AHtIROHIXHDKpyPabh2q+I72CxVe0VOHVD5dFvOjZ1Oz3TLdVdGd9RFtfYYrX19FSJz7 wuBA== X-Gm-Message-State: ACgBeo10zVa9ceg+S1+Myjuf7AEtesd0eiwY6p4CI1CiQDnZjVTp/oMS buPaUiW/mJwgfF8NzQBSSSDAO1l0HyPXGTDaFBw= X-Google-Smtp-Source: AA6agR4ULUmbr1GFgEraiIaT8AxK9RcdvEUmCKesyk2DxFW/lUdbvm5cGag9CLzJsNLFrG4g/doYTURXjga8oVLFUHU= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:8d7b:b933:5438:2a88]) (user=ndesaulniers job=sendgmr) by 2002:a25:e90e:0:b0:695:64cf:5d2 with SMTP id n14-20020a25e90e000000b0069564cf05d2mr832499ybd.541.1661537450473; Fri, 26 Aug 2022 11:10:50 -0700 (PDT) Date: Fri, 26 Aug 2022 11:10:33 -0700 In-Reply-To: <20220826181035.859042-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220826181035.859042-1-ndesaulniers@google.com> X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=lvO/pmg+aaCb6dPhyGC1GyOCvPueDrrc8Zeso5CaGKE= X-Developer-Signature: v=1; a=ed25519-sha256; t=1661537434; l=2534; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=+Ce697Gvc792vtSqpkgUmOwOXeS8MsAAIdR8EYSt4bI=; b=D9av99GhEUVuJgb7imYpdihlXqaXba/P8TNNQf7iB27ysvI+vgrjTW1hi6ko1PmKeztnZYwKFkzD +kwn7lP+BBx5GbbPxnX3QOnvS+vc5/jOX7d4q9Aev4g8z14GlfxF X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826181035.859042-2-ndesaulniers@google.com> Subject: [PATCH 1/3] Makefile.compiler: s/KBUILD_CFLAGS/KBUILD_AFLAGS/ for as-option From: Nick Desaulniers To: Masahiro Yamada 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 , Nick Desaulniers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" as-instr uses KBUILD_AFLAGS, but as-option uses KBUILD_CFLAGS. This can cause as-option to fail unexpectedly because clang will emit -Werror,-Wunused-command-line-argument for various -m and -f flags for assembler sources. Callers of as-option (and as-instr) likely want to be adding flags to KBUILD_AFLAGS/aflags-y, not KBUILD_CFLAGS/cflags-y. Link: https://github.com/ClangBuiltLinux/linux/issues/1699 Signed-off-by: Nick Desaulniers --- arch/x86/boot/compressed/Makefile | 5 +++-- scripts/Makefile.compiler | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/M= akefile index 35ce1a64068b..fb3db714a028 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -48,8 +48,6 @@ KBUILD_CFLAGS +=3D -Wno-pointer-sign KBUILD_CFLAGS +=3D $(call cc-option,-fmacro-prefix-map=3D$(srctree)/=3D) KBUILD_CFLAGS +=3D -fno-asynchronous-unwind-tables KBUILD_CFLAGS +=3D -D__DISABLE_EXPORTS -# Disable relocation relaxation in case the link is not PIE. -KBUILD_CFLAGS +=3D $(call as-option,-Wa$(comma)-mrelax-relocations=3Dno) KBUILD_CFLAGS +=3D -include $(srctree)/include/linux/hidden.h =20 # sev.c indirectly inludes inat-table.h which is generated during @@ -58,6 +56,9 @@ KBUILD_CFLAGS +=3D -include $(srctree)/include/linux/hidd= en.h CFLAGS_sev.o +=3D -I$(objtree)/arch/x86/lib/ =20 KBUILD_AFLAGS :=3D $(KBUILD_CFLAGS) -D__ASSEMBLY__ +# Disable relocation relaxation in case the link is not PIE. +KBUILD_AFLAGS +=3D $(call as-option,-Wa$(comma)-mrelax-relocations=3Dno) + GCOV_PROFILE :=3D n UBSAN_SANITIZE :=3Dn =20 diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 94d0d40cddb3..d1739f0d3ce3 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -29,13 +29,13 @@ try-run =3D $(shell set -e; \ fi) =20 # as-option -# Usage: cflags-y +=3D $(call as-option,-Wa$(comma)-isa=3Dfoo,) +# Usage: aflags-y +=3D $(call as-option,-Wa$(comma)-isa=3Dfoo,) =20 as-option =3D $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2= )) + $(CC) $(KBUILD_AFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2= )) =20 # as-instr -# Usage: cflags-y +=3D $(call as-instr,instr,option1,option2) +# Usage: aflags-y +=3D $(call as-instr,instr,option1,option2) =20 as-instr =3D $(call try-run,\ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" = -,$(2),$(3)) --=20 2.37.2.672.g94769d06f0-goog From nobody Tue Apr 7 14:54:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0431EECAAA6 for ; Fri, 26 Aug 2022 18:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344994AbiHZSLI (ORCPT ); Fri, 26 Aug 2022 14:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344981AbiHZSKy (ORCPT ); Fri, 26 Aug 2022 14:10:54 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E02CC9933 for ; Fri, 26 Aug 2022 11:10:53 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-33dbfb6d2a3so36977507b3.11 for ; Fri, 26 Aug 2022 11:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc; bh=y85OHCHx+Vi/sO7g73ubX7Iq+I1fFfBENt1UsLJJtEY=; b=Wj6HCEjnqrM+ctPXZ7KiGzIXUgQPn1aBBzqlXzJXgi4UZbJJxcgs2UwkHjll+zpoDb QeMdKfqcbQOVp17Y0+gesDEiIBE2NtsbSzBeish3QzVjv+ccDr8N9iBPhNlnJ+YXJgXc TvKwx7H5srQaXdmnL0HXDThn+fsOePUCjTuCn0aigqKEnJMlv7h1Xp+qfv8qoTynWxqI 4txto8tzY+q23E3IEn+vhGNU4fNuv5wFW3EC0z2YsZ+kLvCz3/6YommEVb33Y4oEwDD3 0L4yDniY0aGOCZ6n2IM+1XskuCSVe+ByexHFTTMple1/llBbEl7kTK+daJJISfnFHL6d TeaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc; bh=y85OHCHx+Vi/sO7g73ubX7Iq+I1fFfBENt1UsLJJtEY=; b=zU4rAPtMOzpO2nLA//3PLdHYnmEJOU6OE2oitSXa1cBJmJwBPTU6Qs1vEJ5Hw03Ia4 pSSQ2TcHyWvUSvjpmOw/GJioucBJwM33pzNsOfACaLBB5zMbOvNjBvfdW2fQYqdqwga+ /tNK9zsxBltKN9Z+uEjHZacmFFpnm2lYkkiSi2AVAFm3J7HacNotxZhvq8+qHQ/6j/rA OF4qKTikzY0035SWo6C1HaQssOQzElXp6haNAssDSyS7AnsNKT7cJGcb+VTYxX8Jn9Fl HozoJrGfmul1O2Eq7VI/Vf1sT/Ug0i60mdBHJ2mSpK8LHsM2L/BL+B2Ph41+0yJsWCrp YH8Q== X-Gm-Message-State: ACgBeo02AhEnVGdPvt9JQe9cDGYd1pJj3VfkuqtYqa2SBm/ZNavTgM3a zvY4RwPgLfxdT3SIIp8VjVF+Rzd/GaRqjdk3GRU= X-Google-Smtp-Source: AA6agR5OzcKIoYCg9NU/S1Bt4QZM/GluQ1lilTqv2NoDx2SVtJGQ0ZZoyYauXUteYnrMqBae+wpkPcsEDZ5Oc9etZfQ= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:8d7b:b933:5438:2a88]) (user=ndesaulniers job=sendgmr) by 2002:a05:6902:124f:b0:66e:e3da:487e with SMTP id t15-20020a056902124f00b0066ee3da487emr973177ybu.310.1661537452858; Fri, 26 Aug 2022 11:10:52 -0700 (PDT) Date: Fri, 26 Aug 2022 11:10:34 -0700 In-Reply-To: <20220826181035.859042-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220826181035.859042-1-ndesaulniers@google.com> X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=lvO/pmg+aaCb6dPhyGC1GyOCvPueDrrc8Zeso5CaGKE= X-Developer-Signature: v=1; a=ed25519-sha256; t=1661537435; l=3096; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=WJicEEw1ygkDh8L4szHogyorYbivCBDQ7W9ZrvdhNOc=; b=ZWuPxn7dhLiVcgTrvuHdUAPAmyqC6WoqmU5iSPWfVYPAWJqjwzpjYxl1614lFrA0/+q4/P3onXk1 O00OgL5BCi40Z6C06mizSDk06M74HD6otU8B3ZzdiYDlMTNMCJLe X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826181035.859042-3-ndesaulniers@google.com> Subject: [PATCH 2/3] Makefile.debug: re-enable debug info for .S files From: Nick Desaulniers To: Masahiro Yamada 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 , Nick Desaulniers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Alexey reported that the fraction of unknown filename instances in kallsyms grew from ~0.3% to ~10% recently; Bill and Greg tracked it down to assembler defined symbols, which regressed as a result of: commit b8a9092330da ("Kbuild: do not emit debug info for assembly with LLVM= _IAS=3D1") In that commit, I allude to restoring debug info for assembler defined symbols in a follow up patch, but it seems I forgot to do so in commit a66049e2cf0e ("Kbuild: make DWARF version a choice") This patch does a few things: 1. Add -g to KBUILD_AFLAGS. This will instruct the compiler to instruct the assembler to emit debug info. But this can cause an issue for folks using a newer compiler but older assembler, because the implicit default DWARF version changed from v4 to v5 in gcc-11 and clang-14. 2. If the user is using CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT, use a version check to explicitly set -Wa,-gdwarf- for the assembler. There's another problem with this; GAS only gained support for explicit DWARF versions 3-5 in the 2.36 GNU binutils release. 3. Wrap -Wa,-gdwarf- in as-option call to test whether the assembler supports that explicit DWARF version. Link: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D31bf18= 645d98b4d3d7357353be840e320649a67d Fixes: b8a9092330da ("Kbuild: do not emit debug info for assembly with LLVM= _IAS=3D1") Reported-by: Alexey Alexandrov Reported-by: Bill Wendling Reported-by: Greg Thelen Signed-off-by: Nick Desaulniers --- scripts/Makefile.debug | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug index 9f39b0130551..a7a6da7f6e7d 100644 --- a/scripts/Makefile.debug +++ b/scripts/Makefile.debug @@ -4,18 +4,32 @@ ifdef CONFIG_DEBUG_INFO_SPLIT DEBUG_CFLAGS +=3D -gsplit-dwarf else DEBUG_CFLAGS +=3D -g +KBUILD_AFLAGS +=3D -g endif =20 -ifndef CONFIG_AS_IS_LLVM -KBUILD_AFLAGS +=3D -Wa,-gdwarf-2 +ifdef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT +# gcc-11+, clang-14+ +ifeq ($(shell [ $(CONFIG_GCC_VERSION) -ge 110000 -o $(CONFIG_CLANG_VERSION= ) -ge 140000 ] && echo y),y) +dwarf-version-y :=3D 5 +else +dwarf-version-y :=3D 4 endif - -ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT +else # !CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) :=3D 4 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) :=3D 5 DEBUG_CFLAGS +=3D -gdwarf-$(dwarf-version-y) endif =20 +# Binutils 2.35+ (or clang) required for -gdwarf-{4|5}. +# https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D31bf18645= d98b4d3d7357353be840e320649a67d +ifneq ($(call as-option,-Wa$(comma)-gdwarf-$(dwarf-version-y)),) +KBUILD_AFLAGS +=3D -Wa,-gdwarf-$(dwarf-version-y) +else +ifndef CONFIG_AS_IS_LLVM +KBUILD_AFLAGS +=3D -Wa,-gdwarf-2 +endif +endif + ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS +=3D -fno-var-tracking ifdef CONFIG_CC_IS_GCC --=20 2.37.2.672.g94769d06f0-goog From nobody Tue Apr 7 14:54:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC34CECAAA6 for ; Fri, 26 Aug 2022 18:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345015AbiHZSLM (ORCPT ); Fri, 26 Aug 2022 14:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344986AbiHZSK5 (ORCPT ); Fri, 26 Aug 2022 14:10:57 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7B8BD0BE for ; Fri, 26 Aug 2022 11:10:56 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-33dc888dc62so37115857b3.4 for ; Fri, 26 Aug 2022 11:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc; bh=CWU/c+Z/T3afmWH8jUSRUPrlGa0DK6zNkVSVmthE7JY=; b=J+AQGYjSJRFoIHL2qT5xdAZvDrv7rB5xy/XhHbqmf4gaE97fgjZ/gsV7Bj3BJxJ6C+ FPRauz+dGA3SM+kwveIWXCZxJ7Lo09AWQQ48FIY0hXIPvqLTUVr2mNyYvf0+hQLa5dRB p8jEAl2BGy5VXM7O9Hc7ChpszUItzykwB158shIdBODNy334KmOa7Wmpm6E3iQQ83TJt 32XwyG0fmLqJ039OynjBFyJqv8N2DKehM8g7IugjxRi7bq5yo9SZ8Eas2ju1LuPB7ou7 0OJ42v4NsHKPhivZjHIYd0OnMbrCqPgaGPj8gsCuamCPEeSNl4fyigNCj8s3DLHyhH42 ztVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc; bh=CWU/c+Z/T3afmWH8jUSRUPrlGa0DK6zNkVSVmthE7JY=; b=kefJ2Hi2I9IMF/ssgGz/wbwpN7aClm/7T1S9JwHUsrRc2iZwyAHvhRjhggu3LJE3ly khwE/tcKEUfdIngc3A3cGU5CzCmCjD9X/EAjTiufcnk3gyUtUNRTncxk+mNPe82LPAHX 3t9hss0Phi8CvuIORbM/sXLiY13lR94T7dDPUNePy2rF3ryK24PXzhNMXpXS6oWya7xm h69skwUH1lbv0OvGhd5h81LjnjmH/WLwuDrtTrKJkxe+jRKk+xW1M5t5Ecyu+X2gsqfb RfnpvHwKd2xyFQeH2xxe2NWeaSUvGVN6590BCmR/sl+q0i2SzD6wz7eDMXU5NVHR7B44 eG4A== X-Gm-Message-State: ACgBeo3aTozI4o6ryYTSiEH/w0BIIAgDp6i6O07Jst3A4DQfphpvvDAV 0hlKfP5Y1vfFs0/POOnXwp12NGq3l/gHf9Zd/yc= X-Google-Smtp-Source: AA6agR5zI4BE0SfjNUKDcGZ6Xb4IGuI7GBSJB6t0ufhMUW2iZNyRbbuavTdHsFVco3HP2hlWhORE8Awb5dEsiQIyeEs= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:8d7b:b933:5438:2a88]) (user=ndesaulniers job=sendgmr) by 2002:a25:8e84:0:b0:696:466c:baa with SMTP id q4-20020a258e84000000b00696466c0baamr798614ybl.604.1661537455239; Fri, 26 Aug 2022 11:10:55 -0700 (PDT) Date: Fri, 26 Aug 2022 11:10:35 -0700 In-Reply-To: <20220826181035.859042-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220826181035.859042-1-ndesaulniers@google.com> X-Developer-Key: i=ndesaulniers@google.com; a=ed25519; pk=lvO/pmg+aaCb6dPhyGC1GyOCvPueDrrc8Zeso5CaGKE= X-Developer-Signature: v=1; a=ed25519-sha256; t=1661537435; l=1289; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=KFmDrL6BvTknKQovEEq6T3GFbpZs3ibjX3HcMW2RbEw=; b=HAVmPHDoSpY2S9bAFO1KTHzp0jMYkmspk0Y0zWNA/klCy1NkTBTvFdbFEPvTjqH5HFwy7nCPzrDJ 2mGy2RsICFikIgnIL9rPA36Q4SDd51mgrcFdoNpQ/CPxtlHcT01h X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826181035.859042-4-ndesaulniers@google.com> Subject: [PATCH 3/3] Makefile.debug: set -g unconditional on CONFIG_DEBUG_INFO_SPLIT From: Nick Desaulniers To: Masahiro Yamada 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 , Nick Desaulniers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. 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 :=3D +DEBUG_CFLAGS :=3D -g +KBUILD_AFLAGS +=3D -g =20 ifdef CONFIG_DEBUG_INFO_SPLIT DEBUG_CFLAGS +=3D -gsplit-dwarf -else -DEBUG_CFLAGS +=3D -g -KBUILD_AFLAGS +=3D -g endif =20 ifdef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT --=20 2.37.2.672.g94769d06f0-goog