From patchwork Wed Aug 31 18:44:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12961300 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 DBE32ECAAD1 for ; Wed, 31 Aug 2022 18:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbiHaSoS (ORCPT ); Wed, 31 Aug 2022 14:44:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbiHaSoQ (ORCPT ); Wed, 31 Aug 2022 14:44:16 -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 89D0A2F0 for ; Wed, 31 Aug 2022 11:44:15 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-33daeaa6b8eso208549427b3.7 for ; Wed, 31 Aug 2022 11:44:15 -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=6le8oKuVgvil+VEktUjcgmMbP4uznetVRcbKqcwmc9g=; b=hOSBJ0dhMM/gcYrV4pHQaaLJizqGUf7PQqU9HmaLDYXQMBvqqV8eJtVT2xij1ey8fW xA18V4atnIwDoGam9xmx8sC/ETkDGJyKaYMZYOodeaXCVISFSeBXTag+sHDiVL5IEtjN baY8Wv7c3EYa3B1s2Dvd/wKmwFB2IXABSbOJcq3vBKYB+6EGYHPZ61tcveP91ULX47vj BOiD3cYEKzcI1t+aKx9dC3cDkyFy09WVOhFbOjdDg/QdShRYru0Ht0/nBSb6vmySyqon 9QQvFO4hj1Bn976gID72FEHd78xT5FiynWo8dKXnH7T4P78M/PiMV0dAHUF4wQ34ndCY HzWQ== 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=6le8oKuVgvil+VEktUjcgmMbP4uznetVRcbKqcwmc9g=; b=39+39fd1TjSc4oYl3BsreAwRJryl7nlX3wKhF/8UpMm0J0zvmjhJEBMiKGtUuVb9o3 o3HAAGRJc3i0BVXNejSWzHi+4Nb8vdmdmp+IvihYmori6efNvI88CgLx9lypH7dKDRfJ XjDyzaowgLPBWvob6UFNKJxls3ssBIbtSHckd8DwgJPGhhPMIgE4b7Zh794kbp/Sr0Lb Jto89FybXHAqF7yYpsCBM5S9uxjKxdIwzozbgJ3Nby99H+Ok2GK3ocnCJq2ek1xJZsrQ AaTBbK0V8qlrQQo/nqirBUVagqMOGRn/bEdtuUF9J1R2XrZGlnjiJOqunpvGnp9Q8cUB QPEw== X-Gm-Message-State: ACgBeo2NBvjHmH3xBmEbRpEuPOaRBHeR0bN0+QF/dCM6A1OBBIDBi8vT DLWs8BA7Oe5S/0BnMKgd7ZN1cKVkEo6xP0ttntU= X-Google-Smtp-Source: AA6agR45wDOUkCh/L2HDnf9K1endI406O6j9IzYUDsAfQICWpUAgKXoC+Rp0ECqLGm7Um6L/2tphQDrnjlqrAKim+p0= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:5f5d:95d5:9a3:d41]) (user=ndesaulniers job=sendgmr) by 2002:a0d:f045:0:b0:324:55ec:6595 with SMTP id z66-20020a0df045000000b0032455ec6595mr19520284ywe.255.1661971454809; Wed, 31 Aug 2022 11:44:14 -0700 (PDT) Date: Wed, 31 Aug 2022 11:44:04 -0700 In-Reply-To: <20220831184408.2778264-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220831184408.2778264-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=1661971448; l=1613; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=SUQQIb6Y+sTgOkn8ylHM+uEVIsOT1dvilITBQ2Hta9o=; b=nLKSJd3L/Tgv6SsitOrCoIehfWuY3K87K27T3Hn17A3aSaePVrNvQiC6Dlex7MqpilBpzEIeUbf9 F8/QrNuIA98h1PJISpPwZ7+m08r3OLYFGMEeVu5PDfeUL7B2Kwdb X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831184408.2778264-2-ndesaulniers@google.com> Subject: [PATCH v2 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-kbuild@vger.kernel.org We have an issue where as-option is testing new options with accumulated CFLAGS. This makes it so that we can't use as-option to update AFLAGS since many CFLAGS aren't valid AFLAGS. This is being fixed in a follow up patch. Before doing so, move the assembler test for -Wa,-mrelax-relocations=no from using as-option to cc-option. Cc: Arvind Sankar Cc: x86@kernel.org Link: https://lore.kernel.org/llvm/CAK7LNATcHt7GcXZ=jMszyH=+M_LC9Qr6yeAGRCBbE6xriLxtUQ@mail.gmail.com/ Suggested-by: Masahiro Yamada Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor --- 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/Makefile index 35ce1a64068b..85934204d905 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -49,7 +49,7 @@ KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -D__DISABLE_EXPORTS # Disable relocation relaxation in case the link is not PIE. -KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) +KBUILD_CFLAGS += $(call cc-option,-Wa$(comma)-mrelax-relocations=no) KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h # sev.c indirectly inludes inat-table.h which is generated during From patchwork Wed Aug 31 18:44:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12961301 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 47C9DECAAD1 for ; Wed, 31 Aug 2022 18:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232919AbiHaSo1 (ORCPT ); Wed, 31 Aug 2022 14:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbiHaSoT (ORCPT ); Wed, 31 Aug 2022 14:44:19 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F0E1F0 for ; Wed, 31 Aug 2022 11:44:18 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id j11-20020a05690212cb00b006454988d225so2787845ybu.10 for ; Wed, 31 Aug 2022 11:44:18 -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=MAguRqe6d5HTDJzfY/4c4ymnDwIQdY6ECkW7ZQgoLNw=; b=lLpdU5JClnKvEn/Gjr4GzD569CDxOzC9A2l7JJtmlIw0QmqkRleBGN7K/MkqlowrMc eB4kklda7dRbzl7OP5b3PBBDrFZg68Q9Art7RJscyj8EPXmL4NezkymgMjS4yzeCS0om aTwJU4zA4WWTPRYIHEOrwxQLBXewtnwrpQfXnXR/bGn8FCIvXLHQsuDgB+xqmD1uMUSg GJbMAq/lFD3+PA28c0PIyfaaHV46bv/0zDNF+K14nzXjdjiVq2KyUA2BkuAWkpgFJZ6r XreGAn31i0HAzl/FoHyUDd6NRg/Xz9hfEKHkEFRNW8R//VAOxa/sCfFqsAhTblQgMB7F WyEA== 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=MAguRqe6d5HTDJzfY/4c4ymnDwIQdY6ECkW7ZQgoLNw=; b=hKm784z5hsyZHSeCm4Uohyvf1CYDm3wkoHa3FuNRPNBy5PBYs8y3WZMZUcfrqRpV4r 7CUIljTFAvgwk9ttvRY70Xqm5DH2arkXpcoHY5puivg9noOU/NusteQU8vaAx0TbGtGY aIKqjw+4oCNxg7hOcQSTm77YvaxKQ5GR7XNoH2Rh2gr24XArgXaDlnVzyMcdeKpq3908 nwjDdjbIJwk7C+TlAANfwGHScXBUiQa/PoEXVtreU52ej4lMPQeeqMeHV73eKhdBMtht /vhR8oXoHuhNwQ/sTno7aZ2ZnRGN2VyrDf+/VLrgYmB6FLU5EQZe5b5f3DDFaA23x72u wW4A== X-Gm-Message-State: ACgBeo0lGkrMh5HV43J33PmLrWfbe82x7tTALCZX3kir0FKmWRz+QuGu 1h9C9ioBq5oy3CM9qSu/121ts6mZbuTfXBqkblo= X-Google-Smtp-Source: AA6agR4p7Kp/AOktsa3PVwZf+E9KjpLFgWWbGnI9zwHlkeKlGhPyWPytRi9y6bP/8vCcBhJE3Gf55QU1RKXkrNnB+10= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:5f5d:95d5:9a3:d41]) (user=ndesaulniers job=sendgmr) by 2002:a81:a905:0:b0:33c:1ec4:e704 with SMTP id g5-20020a81a905000000b0033c1ec4e704mr19390415ywh.275.1661971457428; Wed, 31 Aug 2022 11:44:17 -0700 (PDT) Date: Wed, 31 Aug 2022 11:44:05 -0700 In-Reply-To: <20220831184408.2778264-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220831184408.2778264-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=1661971448; l=1550; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=xn2eK78nuKFsrx144Xn+vmQ1XO0dKmn4QRoxa/IrOQQ=; b=FBM2n36UJ2NPU2dr4Ry0FWWemrN0IbAHk/nAkgqQ1k7F1XgiFnavYAEad6JcMZLiqrTNAxxwX3VS UiZHtT+CDff5XY04hUNq35dwQ8M78Khr4I1cSE5UqBOqwzh+MLiz X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831184408.2778264-3-ndesaulniers@google.com> Subject: [PATCH v2 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-kbuild@vger.kernel.org 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 Reviewed-by: Nathan Chancellor --- Changes v1 -> v2: * Split off changes to arch/x86/boot/compressed/Makefile into parent patch, as per Masahiro. scripts/Makefile.compiler | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 = $(shell set -e; \ fi) # as-option -# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) +# Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) as-option = $(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)) # as-instr -# Usage: cflags-y += $(call as-instr,instr,option1,option2) +# Usage: aflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) From patchwork Wed Aug 31 18:44:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12961302 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 55F9BECAAD4 for ; Wed, 31 Aug 2022 18:44:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232570AbiHaSoa (ORCPT ); Wed, 31 Aug 2022 14:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232911AbiHaSo1 (ORCPT ); Wed, 31 Aug 2022 14:44:27 -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 B520610ED for ; Wed, 31 Aug 2022 11:44:20 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id d135-20020a25688d000000b0069578d248abso2795798ybc.21 for ; Wed, 31 Aug 2022 11:44:20 -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=jeIDU7bkvi8qrUeCQKjSgf4R1NQDEDk5WzvSWsZHRgY=; b=hx1WadVFGfM2WHW+QMiqbRpB+tGtox/ZvfK2iSj6s7TWGpw2+YfDNLd71aeLJikF5A ut7591nG+1XtZZnWDLGHqvw7JJwxJ0XUqThW+DOuVmXx5U3HEA3SXJbmTWIaXpZ2woGZ RTEaI3LgVK8uilz+J1vZWsPlPY0651QNaHnpsTlpgvFMVxMQjssruP9r+aB90KHTVpR/ SrpgK6Xxyza7FDY2erOi2mdc5Qq7aDYAg+yKZnkJsavJ/Dfs+V/FjohIVlEbMIrrrnc8 VTZr1169mV2GmgrWFZhOXY+DTyvlyMMDWkpUhba503fcTfGVw+anr6JRNo1wjKRsiWNd VysQ== 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=jeIDU7bkvi8qrUeCQKjSgf4R1NQDEDk5WzvSWsZHRgY=; b=fVlYjAaA48MqcQhJzxhlX/DuZTPeT79ALI08GJxcAeHy0Fpl1LHtuAqUmgXe/xgQnm 7TE+PBu4BqyorNymjl2v8ZJNvjWAKqepjjYqlVuFKH3DHhMNavoI4LssDTvGsaB/lEPb Bdciynd52Le/wB1dML/SQJNrT52z0m7Xp+BJM1LD9HfJow+d9CBieRfC1W/rJONaMDe4 g0KcwjHvtlf+gTiKrstsEKmumPnk/TCSIAz/4L3mOdOfpINHhEoIwJoh/sr8CW8r1JfE wH5B7O7aS81zfJBZAP05QYNKohTq0fujx72vIjpzd/c211bJL9NHQycAzM3Cnc6tjwmb k8Mg== X-Gm-Message-State: ACgBeo0dMAwwEZUnQdUPe9qfHosjkz+hl/abr8AAu5jsSvjX85qJGi4i Drf1rHfmeTYAxbEsv9hVXTJg7OVYfqDNlnbOdcQ= X-Google-Smtp-Source: AA6agR7Ag1fKKG3WlrfE60Hng53gw5R2d8mq+Pf+nJEkCn34r/4b9t9bbknLWL4Dz5mBS6VyDJJaVwKf1/TD3gZm/D4= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:5f5d:95d5:9a3:d41]) (user=ndesaulniers job=sendgmr) by 2002:a25:7608:0:b0:694:220b:8bf6 with SMTP id r8-20020a257608000000b00694220b8bf6mr16732077ybc.210.1661971460048; Wed, 31 Aug 2022 11:44:20 -0700 (PDT) Date: Wed, 31 Aug 2022 11:44:06 -0700 In-Reply-To: <20220831184408.2778264-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220831184408.2778264-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=1661971448; l=6313; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=4nrhFDfzIr6P2uEi5X9UGCfe5n7Png+PEC4jrJ9T2hY=; b=Asevhm76deGOJCh2wzvhWYmHcNqfB9w30KRQRslJFMSwOMNo1qdlvq1fib/n0CQt0uFs4EHOV7W4 zd9FYCZZAcwt9VhTRml2m/KTX3mSvtSLn8veXUGEL29ZkuqxycP8 X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831184408.2778264-4-ndesaulniers@google.com> Subject: [PATCH v2 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 , Jonathan Corbet , linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org cc-ifversion is GCC specific. Replace it with compiler specific variants. Update the users of cc-ifversion to use these new macros. Provide a helper for checking compiler versions for GCC and Clang simultaneously, that will be used in a follow up patch. Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Link: https://github.com/ClangBuiltLinux/linux/issues/350 Link: https://lore.kernel.org/llvm/CAGG=3QWSAUakO42kubrCap8fp-gm1ERJJAYXTnP1iHk_wrH=BQ@mail.gmail.com/ Suggested-by: Bill Wendling Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- Changes v1 -> v2: * New patch. Documentation/kbuild/makefiles.rst | 44 +++++++++++++++------ Makefile | 4 +- drivers/gpu/drm/amd/display/dc/dml/Makefile | 12 ++---- scripts/Makefile.compiler | 15 +++++-- 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index 11a296e52d68..e46f5b45c422 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -682,22 +682,42 @@ 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. - 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 than + or equal to the provided value and evaluates to y if so. Example:: - #fs/reiserfs/Makefile - ccflags-y := $(call cc-ifversion, -lt, 0402, -O1) + cflags-$(call gcc-min-version, 70100) := -foo - 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 >= 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) := -foo + + In this example, cflags-y will be assigned the value -foo if $(CC) is clang + and $(CONFIG_CLANG_VERSION) is >= 11.0.0. + + cc-min-version + cc-min-version tests if the value of $(CONFIG_GCC_VERSION) is greater + than or equal to the first value provided, or if the value of + $(CONFIG_CLANG_VERSION) is greater than or equal to the second value + provided, and evaluates + to y if so. + + Example:: + + cflags-$(call cc-min-version, 70100, 110000) := -foo + + In this example, cflags-y will be assigned the value -foo if $(CC) is gcc and + $(CONFIG_GCC_VERSION) is >= 7.1, or if $(CC) is clang and + $(CONFIG_CLANG_VERSION) is >= 11.0.0. 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 952d354069a4..caa39ecb1136 100644 --- a/Makefile +++ b/Makefile @@ -972,7 +972,7 @@ ifdef CONFIG_CC_IS_GCC KBUILD_CFLAGS += -Wno-maybe-uninitialized endif -ifdef CONFIG_CC_IS_GCC +ifeq ($(call gcc-min-version, 90100),y) # 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,7 +984,7 @@ 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 += $(call cc-ifversion, -ge, 0901, -Wno-alloc-size-larger-than) +KBUILD_CFLAGS += -Wno-alloc-size-larger-than endif # disable invalid "can't wrap" optimizations for signed / pointers diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile index 86a3b5bfd699..d8ee4743b2e3 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -33,20 +33,14 @@ ifdef CONFIG_PPC64 dml_ccflags := -mhard-float -maltivec endif -ifdef CONFIG_CC_IS_GCC -ifeq ($(call cc-ifversion, -lt, 0701, y), y) -IS_OLD_GCC = 1 -endif -endif - ifdef CONFIG_X86 -ifdef IS_OLD_GCC +ifeq ($(call gcc-min-version, 70100),y) +dml_ccflags += -msse2 +else # Stack alignment mismatch, proceed with caution. # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # (8B stack alignment). dml_ccflags += -mpreferred-stack-boundary=4 -else -dml_ccflags += -msse2 endif endif diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index d1739f0d3ce3..13dade724fa3 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -61,9 +61,18 @@ cc-option-yn = $(call try-run,\ cc-disable-warning = $(call try-run,\ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) -# cc-ifversion -# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) -cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) +# gcc-min-version +# Usage: cflags-$(call gcc-min-version, 70100) += -foo +gcc-min-version = $(shell [ $(CONFIG_GCC_VERSION) -ge $(1) ] && echo y) + +# clang-min-version +# Usage: cflags-$(call clang-min-version, 110000) += -foo +clang-min-version = $(shell [ $(CONFIG_CLANG_VERSION) -ge $(1) ] && echo y) + +# cc-min-version +# Usage: cflags-$(call cc-min-version, 701000, 110000) +# ^ GCC ^ Clang +cc-min-version = $(filter y, $(call gcc-min-version, $(1)), $(call clang-min-version, $(2))) # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) From patchwork Wed Aug 31 18:44:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12961303 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 5CFC8C0502A for ; Wed, 31 Aug 2022 18:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232911AbiHaSoa (ORCPT ); Wed, 31 Aug 2022 14:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbiHaSo2 (ORCPT ); Wed, 31 Aug 2022 14:44:28 -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 5FF94DA0 for ; Wed, 31 Aug 2022 11:44:23 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-335ff2ef600so210510737b3.18 for ; Wed, 31 Aug 2022 11:44:23 -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=wE732wZm675iVXKD6yeBsDTR2gqwSJrBRBhO3wQb7iQ=; b=eShEMrNUlFCTE9aYVbAg0DgI0iTQu9WfmERbirOoR6oYYyP7ijLwfq/E0+J6ooYtcE hxeV/9DeC6BXMbXwjkhtDyt8TSgZSaPG4uWNHh1vS/Lm4jxju9dnHS4OACxqtaYPTOO1 XV4aI25xVG9jdotAUGyN/q4M+4pIaTJ7EBgTNYEDPvwKJUKn+I04yZSNYaXo7PgWY8uU Neq26b8Ccc3YvSqH4Xn3np4CbJbmZ4dbr1gCWD29mDhWNarK2JjGE5RKGT+5YA2QY+MG aZKL8/MPstyqcl9bPEfhUfgACivj0gAhLIQlUXFH6yDEiSnetjzQWcAS4UebJrDqCNL5 uhZg== 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=wE732wZm675iVXKD6yeBsDTR2gqwSJrBRBhO3wQb7iQ=; b=sRaKatI70PSr3wrqcgtnA09oXynmDup/rC6xZzChq6YM8lWVzuC4fPiGX2Efr/WqOt gfgGXyeXut2UtTxxP5eKD9yXXGs1Pv0Ef0lIe21aDwungUzukLtlTL+ZsTuG9Rkavq7p iXM2G+SqjqFh+yZEEeAnJufn0KiwCI1uRNmCcnDCG5rru3q6bU6X1SFMUrdOW0hN/nPS gfo/o/OmNys8L79LLFucWmhIAYEO9fuOIYZ/XWVvt3wmzomX3ACJjXV1fiisdDx1JPwj Uvltx92/ExEHcCQ5LgZxVEiUR2wZvRLOKXb2Zvz+9aoJ4+n36SGWXstyNSnIUlXC9L5N wjEQ== X-Gm-Message-State: ACgBeo0UgrAT7i+CR7fEpnT2unB1GH9e0UJpxzDwixyQf4B+7t46Ank5 sRORzkTnb+Cp3IGp4Zj+rEv7KfIP+He4xwX6Z5g= X-Google-Smtp-Source: AA6agR4+Ebu40vcHAmRMaudQ83J0/q9XXte3H1wM0GkT9zrEW8Y29d4ev5N+HjYyH+Ir/SWkm0uyd9uQ2tSYFkmGf4o= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:5f5d:95d5:9a3:d41]) (user=ndesaulniers job=sendgmr) by 2002:a0d:d5c2:0:b0:337:5d95:8bcb with SMTP id x185-20020a0dd5c2000000b003375d958bcbmr19167887ywd.359.1661971462704; Wed, 31 Aug 2022 11:44:22 -0700 (PDT) Date: Wed, 31 Aug 2022 11:44:07 -0700 In-Reply-To: <20220831184408.2778264-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220831184408.2778264-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=1661971448; l=3120; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=NliQXprEuvO3t8z2w/GlA1aYI6D3EzX025tg2ksOCjQ=; b=u4wE/I7MNagG4I/nE2e5f0OfGZvDcBSQ12AuaA53Y2L7ge5X1x5R2F9kOpMQ2NHWcLdZ20mpNrM4 +wycsrFcDvMkzcCjDBQ7pjAFIsqooWQNXvQdegA5VPqWXge0u9Kh X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831184408.2778264-5-ndesaulniers@google.com> Subject: [PATCH v2 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-kbuild@vger.kernel.org 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=1") 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=binutils-gdb.git;h=31bf18645d98b4d3d7357353be840e320649a67d Fixes: b8a9092330da ("Kbuild: do not emit debug info for assembly with LLVM_IAS=1") Reported-by: Alexey Alexandrov Reported-by: Bill Wendling Reported-by: Greg Thelen Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- Changes v1 -> v2: * Use newly added compiler-specific macros, as per Bill. scripts/Makefile.debug | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug index 9f39b0130551..46e88f0ca998 100644 --- a/scripts/Makefile.debug +++ b/scripts/Makefile.debug @@ -4,18 +4,32 @@ ifdef CONFIG_DEBUG_INFO_SPLIT DEBUG_CFLAGS += -gsplit-dwarf else DEBUG_CFLAGS += -g +KBUILD_AFLAGS += -g endif -ifndef CONFIG_AS_IS_LLVM -KBUILD_AFLAGS += -Wa,-gdwarf-2 +ifdef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT +# gcc-11+, clang-14+ +ifeq ($(call cc-min-version, 110000, 140000),y) +dwarf-version-y := 5 +else +dwarf-version-y := 4 endif - -ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT +else # !CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5 DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) endif +# Binutils 2.35+ (or clang) required for -gdwarf-{4|5}. +# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31bf18645d98b4d3d7357353be840e320649a67d +ifneq ($(call as-option,-Wa$(comma)-gdwarf-$(dwarf-version-y)),) +KBUILD_AFLAGS += -Wa,-gdwarf-$(dwarf-version-y) +else +ifndef CONFIG_AS_IS_LLVM +KBUILD_AFLAGS += -Wa,-gdwarf-2 +endif +endif + ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS += -fno-var-tracking ifdef CONFIG_CC_IS_GCC From patchwork Wed Aug 31 18:44:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 12961304 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 481AAECAAD4 for ; Wed, 31 Aug 2022 18:44:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232965AbiHaSoc (ORCPT ); Wed, 31 Aug 2022 14:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbiHaSo3 (ORCPT ); Wed, 31 Aug 2022 14:44: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 28FED26FD for ; Wed, 31 Aug 2022 11:44:26 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-340a4dcb403so190023017b3.22 for ; Wed, 31 Aug 2022 11:44: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; bh=nxmpsFmEnqVW7vmZQzr2xRuU6Ch0EkVsaTgU/u2vV4k=; b=SAAFmWyauBySzjpJrNvt73SE2HPay3Orf8jgDhjx36QAx7OjiDOdYgsm0SfNZdYfwR 1aWZ13i7QRQptij6GuG9iGtF5yNsL2kRXMc/dvOv+5aTsicc+ef1Ql2h5biLg+VJPx0G rmMAQwuOVN9lN15VJGyMBfX+4vBc79LhEGOh+DryEgZCI6vTG2qdzrFp2UzJi1YWMD9a vVxzoMSlkBRJLBl9oBX4X28ujseOHFASxxhznifxHhpBPOECjZcdTeTNVIfpWNZ/Xz1a F2xgmh8MU7SgOqR7WoUtklnxM60uI9cp0b8xB0qwWelT9D1xKvMAqzogZGtG4cA2VV1t OZqQ== 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=nxmpsFmEnqVW7vmZQzr2xRuU6Ch0EkVsaTgU/u2vV4k=; b=Ff2cK2uqjIh6DD8BgL/YIFm0cMQt/cmQhfel6gJC4AoT7ZAsIokb79ZTMBdvhbwHYg CcpUCxD7oHavfEaE8ZwYOKzRnZzKM040i3WzGkkH9joJxx1BgCpQKPEeFhOxiqIE5FvO yzZLLX2qFGloUAgn7QMRWvcJBnLY/+yR4P5aqjOHVJYK1tev0iKt4FjG/1tWrZB8/RJw bdpa2GIjBj6/zF4F/32rUYVHlb+zzDortv8CU3Gc60/RA4ICWOz23uc0EYC7L5R17gWq 5RfbPrctwhrYmlVFwPQ4pew1qZ0JOBZoQZhbOK+jwh+VCB+EFCkVi8GPfEEV6w2sf4rp xoiA== X-Gm-Message-State: ACgBeo1sB+CoAyPrdjGFt50EWjU8XrwG697Vm0iQ3tG/OVcn6PngKqou r+ykgKTUJNYorL2DkWkK2jAgGSi4FFxj82KMvwo= X-Google-Smtp-Source: AA6agR79hkk5fE74ISpRQrASiipyjZ0iIGE2aErmcWn9sSqmbylmLaYlnrPt+lkeerueBeb+/SoRGdoJiwqeKBj6cUk= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:0:100e:712:5f5d:95d5:9a3:d41]) (user=ndesaulniers job=sendgmr) by 2002:a0d:e850:0:b0:33d:c65e:db0f with SMTP id r77-20020a0de850000000b0033dc65edb0fmr19134259ywe.253.1661971465422; Wed, 31 Aug 2022 11:44:25 -0700 (PDT) Date: Wed, 31 Aug 2022 11:44:08 -0700 In-Reply-To: <20220831184408.2778264-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20220831184408.2778264-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=1661971448; l=1621; i=ndesaulniers@google.com; s=20211004; h=from:subject; bh=vWDrWFVICt3Ai14ovaPS7sV9hqYwW1jW8tWWfH+heHY=; b=7NUjXNp3Kko38nPRelaw4RlNwQnLJ60Pq2Feeg9ta5r0PFwgmr+eznfGI29OX44l2Ycx4qKFO/UY y+0hS6/tAzQOJuSLTxlLvDIvqPKvb5NZIizBF2kXCnKd1dlp6AQn X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220831184408.2778264-6-ndesaulniers@google.com> Subject: [PATCH v2 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-kbuild@vger.kernel.org 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 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- Changes v1 -> v2: * Add reference to 866ced950bcd, cc Andi, in commit message. scripts/Makefile.debug | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug index 46e88f0ca998..b6eb532af3cc 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