From nobody Tue Apr 7 00:38:13 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 3E553C38145 for ; Wed, 7 Sep 2022 04:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbiIGE7c (ORCPT ); Wed, 7 Sep 2022 00:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiIGE73 (ORCPT ); Wed, 7 Sep 2022 00:59:29 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF31E10C4 for ; Tue, 6 Sep 2022 21:59:26 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 62-20020a250341000000b006a93b57e2daso4848120ybd.2 for ; Tue, 06 Sep 2022 21:59:26 -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:subject:date; bh=HyKr9I8MzG9kBN69CE/ANl9iOdCK/yJrqP2VJJKmtbA=; b=mJJdHlkWP0qiECsFlrlh4TKS0YhzeMCgS4kv9vWslSXb4Vob+X30ichTiTL9WTKgI5 gol9O3sKAlXKI1d1of7Cx5Dpy6M7xy066hXl72LhnNeDvOPqt4fAeMBFk9P/xDlbHDD2 UA/pc6CA6BCCHdAtX4qtkpOdFmk8fiZ2OArMTR+ncA3Yby8+sBmM+xa3oX1KJ2YzgJKa L3WqzmAD6s/p69GW8Di63kcHhq5ThiT5UKYWfMmqynAphjEWW/B63Rm2Ocy3RFqD/324 TnivXmR6PypnprSSrfFTKQ6rz9V+TOXSc4HJQE//4PY20nwqS/FUvdbNY4f1mLnkixFm MvPQ== 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:subject:date; bh=HyKr9I8MzG9kBN69CE/ANl9iOdCK/yJrqP2VJJKmtbA=; b=uHfGUkQVMgdXt7S3AxnZyhot59Q0MYQ9SlADZnPQDqRN8xP/vzrApI3mzOTzAOxz00 g7gwkm98SgHu/znDuEsNM/gnRDmbQXNRc3AIWU37rxZlBfVxd6CRIfWCmiR8IkUEnH5A hDOMUxTVe1GgE/bkvs9nUrhDVBQ2vO3FlnRuN0jv518mKgSbP+168yrWNEPGIT1AuAmi UB6pEuAokPaxlZ0fJJlHS8vz1nEVulmuZPYEU+WVwq1xXQvTKSecj0f4q9lNSGa5qMLn NNyC0Lde7DDPNcmCiIhhMFBbcJ690XigIOy2Kmz2VQw2TiDO1uAqyIBNiDlXws1Z6ti3 fsaQ== X-Gm-Message-State: ACgBeo0hIUnbB5/w4qFy7zoryEtSLSmGwvxHvSrVJmZuX1kBdUKURnPe Nd0PTUcT/oCkWmLCqeuww4Cd5cgaKiC+XFPwiag= X-Google-Smtp-Source: AA6agR6A3nOFVgzH/LIlkj47r/IKh6L2ey7C7N3pfYOn5TOUy3NjV0xTHyAbU1giaqkuT92t6UljPsTDaUWLkFIxjWY= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:9755:c523:9dcb:2228]) (user=ndesaulniers job=sendgmr) by 2002:a0d:f2c4:0:b0:333:560c:ee46 with SMTP id b187-20020a0df2c4000000b00333560cee46mr1649366ywf.109.1662526766087; Tue, 06 Sep 2022 21:59:26 -0700 (PDT) Date: Tue, 6 Sep 2022 21:59:03 -0700 In-Reply-To: <20220907045907.484043-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220907045907.484043-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=1662526746; l=1808; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=kYGYc5XWvUdto/5QJT//gD0cOAVBQRf+GCe08dKvohM=; b=QJ3sqizOMx1/LC5t2cVcxIGdd+h2qlDiVbAXaw+l/z2ysUwiRHXCM6y0Rhd2/XAI2e9D/+A9TzOz sLMzCcW9BimZSDyDaerFZtig2p3NctS62ufemI2LaTKtXaET2zUe X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220907045907.484043-2-ndesaulniers@google.com> Subject: [PATCH v3 1/5] x86/boot/compressed: prefer cc-option for CFLAGS additions 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 , Arvind Sankar 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-option tests new options using KBUILD_CFLAGS, which causes problems when using as-option to update KBUILD_AFLAGS because many compiler options are not valid assembler options. This is being fixed in a follow up patch. Before doing so, move the assembler test for -Wa,-mrelax-relocations=3Dno from using as-option to cc-option. Cc: Arvind Sankar Cc: x86@kernel.org Link: https://lore.kernel.org/llvm/CAK7LNATcHt7GcXZ=3DjMszyH=3D+M_LC9Qr6yeA= GRCBbE6xriLxtUQ@mail.gmail.com/ Suggested-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes v2 -> v3: * Reword commit message as per Nathan. * Pick up Nathan's RB/TB tags. Changes v1 -> v2: * Split off of v1 [1/3]. * Use cc-option to update CFLAGS, as per Masahiro. * Add Masahiro's Suggested-by, Cc Arvind. arch/x86/boot/compressed/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/M= akefile index 35ce1a64068b..85934204d905 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -49,7 +49,7 @@ 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 $(call cc-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 --=20 2.37.2.789.g6183377224-goog From nobody Tue Apr 7 00:38:13 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 67340ECAAD3 for ; Wed, 7 Sep 2022 04:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbiIGE7n (ORCPT ); Wed, 7 Sep 2022 00:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiIGE73 (ORCPT ); Wed, 7 Sep 2022 00:59:29 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F10C526E5 for ; Tue, 6 Sep 2022 21:59:28 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-32a115757b6so108072567b3.13 for ; Tue, 06 Sep 2022 21:59:28 -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:subject:date; bh=OAxiGU2+Zm5TGJDmYfJLZJYOpFooL4QHZIWYZiKDaNI=; b=UzsWkCGsn6TQFhqSZYOpR99wDWCEXyZ5MMKliAg92jQS0AYBHwEF9zjvATBGutup0p NO4wYpNhStcU1J2cjuQ9GbbOxS0zgurgoKVwHDsFvcRp3qp+1FwJWk9aGuyQbd+ASbse iV3thzcFMTbZumH8eFJ/+YP8y1KiQsIPJKUs8IhaiUZOb43fNEAzNxjiZYFDNQPUG37S YBaAhRCr92G4fwx7c3G1Ptk9p0+T0o/DqhaN7oWXfr5m8Ga95DnhZNA9Q15IBNaTbnp2 gNSGwfBi+FAib0O60VIP4ATtHiqMscBaDINfd3MnenIeo3QSkPkQcshNYHMvheD3+gFv eKoQ== 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:subject:date; bh=OAxiGU2+Zm5TGJDmYfJLZJYOpFooL4QHZIWYZiKDaNI=; b=t62u+U8wbnTcu3UTvwPvl+DJGCzqIvhpz/UsdKHOlkhI/eZpdQxhXZVYjAyOQzYcI1 jBLyqX9/zLYx5g04PNrdrhlpWMBTJQgbW9lnAmCcg3CX013knxAvSKNfj3pJxwnqN+9o uf/xGs/XfsDQ1tptPWMUL0uadXhoqGWne3VbdeEAv2YmnpjnEKMNfqq32utHqxd9v3oe V+/LIT8LBBOLSDKltbVCwpDdzZ79V5Lcs9I/l7BEtsImCYocppf0krSN7wGjGfdyOKbk 8wXtd8RffEZ6JWQPFs5hhs47otoUAqMndy3+ReQQYsCbDda4IT35lhm6K2G7hRYI6ha4 Gymg== X-Gm-Message-State: ACgBeo39lWWdvWJ0Ahz6mSRDhHHvnYzEOhnHbPdMcml3UGn53JutcGDe ZkceXkyfWSCEunNFupyTZKjdvfHU4JxxrfqBP/8= X-Google-Smtp-Source: AA6agR7THdtxfPlLHDj0ifMy7DcCylYYagRl6nsfCC9Vw9Lgt7j1YooO+zDIu58BxyQMjhmKLfZwaRD9tKprzZQX4dk= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:9755:c523:9dcb:2228]) (user=ndesaulniers job=sendgmr) by 2002:a05:6902:192:b0:695:7e89:ed5b with SMTP id t18-20020a056902019200b006957e89ed5bmr1546228ybh.226.1662526768328; Tue, 06 Sep 2022 21:59:28 -0700 (PDT) Date: Tue, 6 Sep 2022 21:59:04 -0700 In-Reply-To: <20220907045907.484043-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220907045907.484043-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=1662526746; l=2233; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=M5avwGZxXNJVxI+Cw3zYKb1tkFDlYgC1vraaiWNDNLE=; b=PMS5H0clISr6OeQLTZXXnl/Hs9ioLuh2rFA+ahRsD1VUjLrQCJQtmQXeyAUyMdzSLZZtrtXNSCWV 8GhYxzD9DiNFAxz0fymoGHRZtV2fWVqD5vlKD/7fvZ87O2xKqe1o X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220907045907.484043-3-ndesaulniers@google.com> Subject: [PATCH v3 2/5] Makefile.compiler: Use 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 when CONFIG_WERROR is set, 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. Also, change as-option and as-instr to use -x assembler-with-cpp since kernel sources are .S files that use the compiler as the driver. And then add -Werror as well. Link: https://github.com/ClangBuiltLinux/linux/issues/1699 Suggested-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes v2 -> v1: * Add -x assembler-with-cpp -Werror to both as-option and (new) as-instr, as per Masahiro. * Add Masahiro's SB tag. Changes v1 -> v2: * Split off changes to arch/x86/boot/compressed/Makefile into parent patch, as per Masahiro. scripts/Makefile.compiler | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 94d0d40cddb3..a66638b5f4a5 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -29,16 +29,16 @@ 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) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /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)) + printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-wit= h-cpp -o "$$TMP" -,$(2),$(3)) =20 # __cc-option # Usage: MY_CFLAGS +=3D $(call __cc-option,$(CC),$(MY_CFLAGS),-march=3Dwin= chip-c6,-march=3Di586) --=20 2.37.2.789.g6183377224-goog From nobody Tue Apr 7 00:38:13 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 C7A19C38145 for ; Wed, 7 Sep 2022 04:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229486AbiIGE75 (ORCPT ); Wed, 7 Sep 2022 00:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiIGE7i (ORCPT ); Wed, 7 Sep 2022 00:59:38 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 512985FC1 for ; Tue, 6 Sep 2022 21:59:31 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-3454647ff7dso54113937b3.12 for ; Tue, 06 Sep 2022 21:59:31 -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:subject:date; bh=bcgi8Ou8th2qqJa7CD88vTQQmiUlNdn6G38aIXpHI6Y=; b=ntpiMlsUZbBzGuoDfGrsuzC9Fu9Dngcb4gIzs9vYGwNNGJsAHWhrinnINN7afNa+aa Ju69QRlfFJKW9Y10Cp/2v4E6l4L3HUCFUsswVqibz/opy/3jfd5IGljZ+yDbnBHTGone gLjkZkXmzODkCXP09P6it2IQmKO6vQiVkQCWObUeDZWSQQsyH2CrqhdhCEkLAIvxJ++3 Cn1vaDzB3STqCw6p0UOO+5q+vBLH7eUoI8EnXYuDLIxqAjPA0pQIlsetbgBApQo/8knJ 9xuXq0izZx+52Ei7v7eLE+alDASuxx+P4GL55l25kj1eL6HIUPJ9xOXLI0sbvJ+5PZko Niqg== 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:subject:date; bh=bcgi8Ou8th2qqJa7CD88vTQQmiUlNdn6G38aIXpHI6Y=; b=wprMATEr9iX8hZxA1lRRtB+zIjZfkSupdy2ONVe9TSf+s2fjU/g27GwDxJ3E9p/EEm LIBgIe1nmYPbT8Y7fhnAJC5H6qXNylC5nWDEvCv6SEyRTpx4q5rPm7obFeFpIS5ZamMs WazepJUu8SeoBA8KevVqaTk/EstLBUOpc6cj9yBQIAcmH2RkD8i0jWe4TLoocQDOScw9 G5bLOA/MqNYVUfqPKZLSwoX6xCu3wOv08SpBPtycTwuYqURNWDVoeEbSWXGzSgwvnSD7 BRtRO1+hLY4qQME4ytom0t0FDtU4Z2+86QZNzhCVSCFNRLkaGTYHMPzCzbnAyqfWgHH/ /1mA== X-Gm-Message-State: ACgBeo2duZH664eqmCSUZcTOGsm5wsiQevkwHga9I6OTugkZKB7AM8LR 9aAYUqt1kmvz5RpWy8Xv75WwRNbHLNPcaiETpTg= X-Google-Smtp-Source: AA6agR51gs/uUHreq+msqsiaEhkiRFCgMis3Jrd7egz+g3Jty9ES9OQyft1PDZ/MLkfp6N0Nb4aIesch0EUTQLjAZFA= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:9755:c523:9dcb:2228]) (user=ndesaulniers job=sendgmr) by 2002:a25:2501:0:b0:6a9:2c63:41df with SMTP id l1-20020a252501000000b006a92c6341dfmr1513377ybl.570.1662526770665; Tue, 06 Sep 2022 21:59:30 -0700 (PDT) Date: Tue, 6 Sep 2022 21:59:05 -0700 In-Reply-To: <20220907045907.484043-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220907045907.484043-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=1662526746; l=5523; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=vU2YBqs04SKJi0GQSDvA4poA04ESc702LTI4xVOdImw=; b=ACvgjV4W2Fn0d0OoSsDUnfzLwgzbvkoSX5pWoxmj3OhBeI7wqr6l/Ze+J8eLCVskjea6kj/Y/Vom ccwPJxl5DeIznlJUZRGwr4WOP/rnBszo5UuLLP878hh5x1U5qH57 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220907045907.484043-4-ndesaulniers@google.com> Subject: [PATCH v3 3/5] Makefile.compiler: replace cc-ifversion with compiler-specific macros 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" cc-ifversion is GCC specific. Replace it with compiler specific variants. Update the users of cc-ifversion to use these new macros. Link: https://github.com/ClangBuiltLinux/linux/issues/350 Link: https://lore.kernel.org/llvm/CAGG=3D3QWSAUakO42kubrCap8fp-gm1ERJJAYXT= nP1iHk_wrH=3DBQ@mail.gmail.com/ Suggested-by: Bill Wendling Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes v2 -> v3: * Fix AMDGPU -msse flag, as per Nathan. * Pick up Nathan's RB tag. * Drop cc-min-version, as per Masahiro. Changes v1 -> v2: * New patch. Documentation/kbuild/makefiles.rst | 29 ++++++++++++--------- Makefile | 6 ++--- drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 +- scripts/Makefile.compiler | 10 ++++--- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/make= files.rst index 11a296e52d68..ee7e3ea1fbe1 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -682,22 +682,27 @@ more details, with real examples. In the above example, -Wno-unused-but-set-variable will be added to KBUILD_CFLAGS only if gcc really accepts it. =20 - cc-ifversion - cc-ifversion tests the version of $(CC) and equals the fourth parameter - if version expression is true, or the fifth (if given) if the version - expression is false. + gcc-min-version + gcc-min-version tests if the value of $(CONFIG_GCC_VERSION) is greater th= an + or equal to the provided value and evaluates to y if so. =20 Example:: =20 - #fs/reiserfs/Makefile - ccflags-y :=3D $(call cc-ifversion, -lt, 0402, -O1) + cflags-$(call gcc-min-version, 70100) :=3D -foo =20 - In this example, ccflags-y will be assigned the value -O1 if the - $(CC) version is less than 4.2. - cc-ifversion takes all the shell operators: - -eq, -ne, -lt, -le, -gt, and -ge - The third parameter may be a text as in this example, but it may also - be an expanded variable or a macro. + In this example, cflags-y will be assigned the value -foo if $(CC) is gcc= and + $(CONFIG_GCC_VERSION) is >=3D 7.1. + + clang-min-version + clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is greater + than or equal to the provided value and evaluates to y if so. + + Example:: + + cflags-$(call clang-min-version, 110000) :=3D -foo + + In this example, cflags-y will be assigned the value -foo if $(CC) is cla= ng + and $(CONFIG_CLANG_VERSION) is >=3D 11.0.0. =20 cc-cross-prefix cc-cross-prefix is used to check if there exists a $(CC) in path with diff --git a/Makefile b/Makefile index a4f71076cacb..cd9919c66b96 100644 --- a/Makefile +++ b/Makefile @@ -790,7 +790,6 @@ KBUILD_CFLAGS +=3D $(stackp-flags-y) =20 KBUILD_CFLAGS-$(CONFIG_WERROR) +=3D -Werror KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) +=3D -Wno-array-bounds -KBUILD_CFLAGS +=3D $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) =20 ifdef CONFIG_CC_IS_CLANG KBUILD_CPPFLAGS +=3D -Qunused-arguments @@ -972,7 +971,6 @@ ifdef CONFIG_CC_IS_GCC KBUILD_CFLAGS +=3D -Wno-maybe-uninitialized endif =20 -ifdef CONFIG_CC_IS_GCC # The allocators already balk at large sizes, so silence the compiler # warnings for bounds checks involving those possible values. While # -Wno-alloc-size-larger-than would normally be used here, earlier versions @@ -984,8 +982,8 @@ ifdef CONFIG_CC_IS_GCC # ignored, continuing to default to PTRDIFF_MAX. So, left with no other # choice, we must perform a versioned check to disable this warning. # https://lore.kernel.org/lkml/20210824115859.187f272f@canb.auug.org.au -KBUILD_CFLAGS +=3D $(call cc-ifversion, -ge, 0901, -Wno-alloc-size-larger-= than) -endif +KBUILD_CFLAGS-$(call gcc-min-version, 90100) +=3D -Wno-alloc-size-larger-t= han +KBUILD_CFLAGS +=3D $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) =20 # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS +=3D -fno-strict-overflow diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/= amd/display/dc/dml/Makefile index 86a3b5bfd699..3c64ae0b212c 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -34,7 +34,7 @@ dml_ccflags :=3D -mhard-float -maltivec endif =20 ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) +ifneq ($(call gcc-min-version, 70100),y) IS_OLD_GCC =3D 1 endif endif diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index a66638b5f4a5..4b998dadd79d 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -61,9 +61,13 @@ cc-option-yn =3D $(call try-run,\ cc-disable-warning =3D $(call try-run,\ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c= /dev/null -o "$$TMP",-Wno-$(strip $(1))) =20 -# cc-ifversion -# Usage: EXTRA_CFLAGS +=3D $(call cc-ifversion, -lt, 0402, -O1) -cc-ifversion =3D $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $= (3) || echo $(4)) +# gcc-min-version +# Usage: cflags-$(call gcc-min-version, 70100) +=3D -foo +gcc-min-version =3D $(shell [ $(CONFIG_GCC_VERSION) -ge $(1) ] && echo y) + +# clang-min-version +# Usage: cflags-$(call clang-min-version, 110000) +=3D -foo +clang-min-version =3D $(shell [ $(CONFIG_CLANG_VERSION) -ge $(1) ] && echo= y) =20 # ld-option # Usage: KBUILD_LDFLAGS +=3D $(call ld-option, -X, -Y) --=20 2.37.2.789.g6183377224-goog From nobody Tue Apr 7 00:38:13 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 CA71AC38145 for ; Wed, 7 Sep 2022 04:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbiIGE7y (ORCPT ); Wed, 7 Sep 2022 00:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbiIGE7i (ORCPT ); Wed, 7 Sep 2022 00:59:38 -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 787D9BF45 for ; Tue, 6 Sep 2022 21:59:33 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-3454647ff7dso54114687b3.12 for ; Tue, 06 Sep 2022 21:59:33 -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:subject:date; bh=1COoEIPBVX2RpaBUk98TcXRSJaNnm6A+DPC71dE8tyA=; b=s3zbhnn4yneYiDRSoLecTRmu6wrM36fumucM96wks5JEOW+winLJxgjTCizxSD0vQQ 4LIxu9C5zIHRcDqu2u2lNecbhUbn/2TWEkJJNOnQRGTbP/t+N8tSrjmLqoNZ4Hys/YfY rXjKvD+IaIth1LIDrIKHqgEj2zf3K/v0DQJ1j8rDMz5MwmTvfUGzUOKJa1lVvGPvqf9P +8A42mJo+1FKX2JGEWRbmq1cLWbk1x4A8ndh39gYz9TEaivkCM3GNR8CZxO90PyAaynQ mJT0Ist67AYlzVHi98qIbw0zfJsg4FDWxcQitTzHAY11Ikv4I9i0j4cc7EPR5ECWbtGC CVKw== 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:subject:date; bh=1COoEIPBVX2RpaBUk98TcXRSJaNnm6A+DPC71dE8tyA=; b=6DytehskD4wFrDyK6WGpV+k9Hu3q4qq+DpXP1plHX6Ge63jgzDzyVK2sU1Pn3urjNU Fwob2ub8nPXLwsP9E+0xSZa7erN1Yyz6nCjxoDmDOfgIA6cSWcV1x6pkaMDcGCRHPlUl aY0l06ZM0LDJKhy4G6IVQoCMz/SHsV7dtyVdF5Y9TtfYcJCxHT5zIXDId0xHGQ3RBFo7 WCTHzqqrJEp5z38mg9lqtTULRFerCKx71gkEL3vGKcYp2ttIsaMyPJlb2jyfW2chWp+f z8b6mdI7wu2YYziGHgWeeoExQf6F8XDzv3T9L9M97hwHknrSH6OY/RMrC4d2Sd8PeYIO pwKA== X-Gm-Message-State: ACgBeo0YE0wxZQ43hmrcB1+NeMXfnfLWZXwPjkq7dfm4dkd/6GHVfOya hcXKp5fXbc0O/6scqfPI6CimRyXq0teJfxGiWlU= X-Google-Smtp-Source: AA6agR4PDE9DXpqaLgbI/t9G91mUki/RmvatymlHezczkZ1UM0qxH+3O/M1DPc+CuckZPxkGq1Gw30BzmtKEQyH16HA= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:9755:c523:9dcb:2228]) (user=ndesaulniers job=sendgmr) by 2002:a05:6902:72a:b0:69e:f780:4de1 with SMTP id l10-20020a056902072a00b0069ef7804de1mr1597326ybt.53.1662526772788; Tue, 06 Sep 2022 21:59:32 -0700 (PDT) Date: Tue, 6 Sep 2022 21:59:06 -0700 In-Reply-To: <20220907045907.484043-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220907045907.484043-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=1662526746; l=3571; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=izinVuTPOGuJAOWpMqC3T3tWj1j7qEU602s5D6R33gQ=; b=3HKm8e+bXV4z5Vehfj0HJ55Vwjh98Cw8BeO7rIXrOAoTmo0gFo5f7KN8zo1XTJHURY3xrr+qxu8O 7wO+MevQBnzuM/Tu/NZEUxCAUC2q1PZIAlDnuHsKyAQG1XPgoYnY X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220907045907.484043-5-ndesaulniers@google.com> Subject: [PATCH v3 4/5] 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") 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 Reviewed-by: Nathan Chancellor Suggested-by: Masahiro Yamada Signed-off-by: Nick Desaulniers --- Changes v2 -> v3: * Replace diff outright with Masahiro's suggestion in https://lore.kernel.org/llvm/CAK7LNATWDH01=3DZKLnsxc0vcib1zGDbEq8jLQwhWP7= HkkmSb_Mw@mail.gmail.com/2-dwarf.diff with some modifications, PTAL. * Pick up Nathan's RB tag and Masahiro's SB tag. * Cut down commit message. Changes v1 -> v2: * Use newly added compiler-specific macros, as per Bill. lib/Kconfig.debug | 4 +++- scripts/Makefile.debug | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index bcbe60d6c80c..d3e5f36bb01e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -264,8 +264,10 @@ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT config DEBUG_INFO_DWARF4 bool "Generate DWARF Version 4 debuginfo" select DEBUG_INFO + depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && A= S_VERSION >=3D 23502))) help - Generate DWARF v4 debug info. This requires gcc 4.5+ and gdb 7.0+. + Generate DWARF v4 debug info. This requires gcc 4.5+, binutils 2.35.2 + if using clang without clang's integrated assembler, and gdb 7.0+. =20 If you have consumers of DWARF debug info that are not ready for newer revisions of DWARF, you may wish to choose this or have your diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug index 9f39b0130551..2845145c1220 100644 --- a/scripts/Makefile.debug +++ b/scripts/Makefile.debug @@ -3,17 +3,16 @@ DEBUG_CFLAGS :=3D ifdef CONFIG_DEBUG_INFO_SPLIT DEBUG_CFLAGS +=3D -gsplit-dwarf else -DEBUG_CFLAGS +=3D -g +debug-cflags-y +=3D -g endif =20 -ifndef CONFIG_AS_IS_LLVM -KBUILD_AFLAGS +=3D -Wa,-gdwarf-2 -endif +debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) +=3D -gdwarf-4 +debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) +=3D -gdwarf-5 =20 -ifndef 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) +ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy) +# Clang does not pass -g or -gdwarf-* option down to GAS. +# Add -Wa, prefix to explicitly specify the flags. +KBUILD_AFLAGS +=3D $(addprefix -Wa$(comma), $(debug-flags-y)) endif =20 ifdef CONFIG_DEBUG_INFO_REDUCED @@ -29,5 +28,7 @@ KBUILD_AFLAGS +=3D -gz=3Dzlib KBUILD_LDFLAGS +=3D --compress-debug-sections=3Dzlib endif =20 -KBUILD_CFLAGS +=3D $(DEBUG_CFLAGS) +DEBUG_CFLAGS +=3D $(debug-flags-y) +KBUILD_AFLAGS +=3D $(debug-flags-y) +KBUILD_CFLAGS +=3D $(DEBUG_CFLAGS) export DEBUG_CFLAGS --=20 2.37.2.789.g6183377224-goog From nobody Tue Apr 7 00:38:13 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 9F427C38145 for ; Wed, 7 Sep 2022 05:00:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiIGFAB (ORCPT ); Wed, 7 Sep 2022 01:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbiIGE7j (ORCPT ); Wed, 7 Sep 2022 00:59:39 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1804A12A80 for ; Tue, 6 Sep 2022 21:59:36 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id i194-20020a253bcb000000b00676d86fc5d7so10052242yba.9 for ; Tue, 06 Sep 2022 21:59:36 -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:subject:date; bh=c0DpBOnZ7fHKw3QNWuDsBHLUoP21ketOwjbqwElOkqs=; b=G3opd2Kk7smjSi01ZxULHYBb3aZEPYHUyBy3/mRzPOA7AoYOgM1AG5Hr7cycpkvp2k 7zmIUTwbwGDC2E7T4vT/WYWusN78+R87+am64PQyPlKsAzEmY50QiKUKIAoq02QVC52q AeM1hmMw/deHDfPRbcEMAs2fdxfnRnwQin//MD28AjsSEt8iOmIlErdGoPa9zNXWO15A X4/SX+bm7r1NdOrUdFOy1qu4GZ4TxCTv6HXUl8Hqc7sWxBBNwG8BE1eVwLXfWAwS1aQw +0gDpWtqgpEKjBXTHa3efxgcMH+NWtwBBFv0w/mQISgkan8BA28APqByaEUis7YN7XH1 gbPA== 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:subject:date; bh=c0DpBOnZ7fHKw3QNWuDsBHLUoP21ketOwjbqwElOkqs=; b=iDcprqsn6KyZ0vX8MQm00susJMUOVWyeTyPfLpUNRHp0U00g3yWsBM6SEy8IgsG+7U +//ZuZuae5QDSwJWLF2mw5LRE6UgdNEXECPjFmTDd3OHz45KwPle5zfvcXr1XhqhtrAW A5VKzxyo2fWNP7fOEbOHtcu12jlLXOAl0OM78R86zDA4U0j4pY+DrJHQuP3FrYwdBGMz x700Ghf7NLe6UPY9pq+c8B44MsLmaFlrhq/ZEVjrvO2NQBw0Kq4H5pWxkC+RGvv7fxn6 H+o3v6gP6EPNSGGoTlX3khs8oFPMeifeBk8MVxneX7Y6kSjjs34mWdpZInpiX2tH7yRR DTbw== X-Gm-Message-State: ACgBeo2WMZqmn9O2wrfV1vTqcYUaTucrXWaeine6e5rGxfUJikkG73Sf FybgjBZoa12eNpGxeOHqKRyHWwzEMX9YYSfiRzw= X-Google-Smtp-Source: AA6agR4yqG8oXRGrN2c3vGVjKmn+ZXcqxyGd3kFbqy9a7TH8mlfm2goz1npG5dcXN3vR8r+Mk+rzj0/w3aimHdWPBSI= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:9755:c523:9dcb:2228]) (user=ndesaulniers job=sendgmr) by 2002:a25:26c9:0:b0:6a9:922:4a6d with SMTP id m192-20020a2526c9000000b006a909224a6dmr1571274ybm.239.1662526775388; Tue, 06 Sep 2022 21:59:35 -0700 (PDT) Date: Tue, 6 Sep 2022 21:59:07 -0700 In-Reply-To: <20220907045907.484043-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220907045907.484043-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=1662526746; l=2043; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=0UUXvo2ECsHljJrCvpyFZ/IOiA9qf1pxH+OXOsjnp1k=; b=EPZloRmrF5sgzyoix1T+c/b0M8kYWBCLqwRogtnVgQh3+LO3Uy4aqeBCu1Thtarw+ZI/xgMsperC QC/5HfWjCEpJsJsOsjwgYmvtS6GTbJlSsOD2ruSzWrRZsqSP2wbm X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220907045907.484043-6-ndesaulniers@google.com> Subject: [PATCH v3 5/5] 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 , Andi Kleen 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. -gsplit-dwarf has been mutually exclusive with -g since support for CONFIG_DEBUG_INFO_SPLIT was introduced in commit 866ced950bcd ("kbuild: Support split debug info v4") I don't think it ever needed to be. 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 Cc: Andi Kleen Reported-by: Dmitrii Bundin Reported-by: Fangrui Song Reported-by: Masahiro Yamada Suggested-by: Dmitrii Bundin Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes v2 -> v3: * Pick up Nathan's RB tag. Changes v1 -> v2: * Add reference to 866ced950bcd, cc Andi, in commit message. scripts/Makefile.debug | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug index 2845145c1220..c20f8f2e76bf 100644 --- a/scripts/Makefile.debug +++ b/scripts/Makefile.debug @@ -1,10 +1,4 @@ -DEBUG_CFLAGS :=3D - -ifdef CONFIG_DEBUG_INFO_SPLIT -DEBUG_CFLAGS +=3D -gsplit-dwarf -else -debug-cflags-y +=3D -g -endif +DEBUG_CFLAGS :=3D -g =20 debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) +=3D -gdwarf-4 debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) +=3D -gdwarf-5 @@ -15,6 +9,8 @@ ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy) KBUILD_AFLAGS +=3D $(addprefix -Wa$(comma), $(debug-flags-y)) endif =20 +debug-flags-$(CONFIG_DEBUG_INFO_SPLIT) +=3D -gsplit-dwarf + ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS +=3D -fno-var-tracking ifdef CONFIG_CC_IS_GCC --=20 2.37.2.789.g6183377224-goog