Message ID | 20230316155104.594662-1-elver@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp563289wrt; Thu, 16 Mar 2023 09:01:14 -0700 (PDT) X-Google-Smtp-Source: AK7set9JJYLYgTEi7snKgoJzP1+6R+0PIJ3OWYuNAVVqdC3pMdfmJHI6BhhxPTdtuxsB4dx/U54t X-Received: by 2002:a17:90a:1a01:b0:237:d44c:5861 with SMTP id 1-20020a17090a1a0100b00237d44c5861mr4796654pjk.12.1678982473346; Thu, 16 Mar 2023 09:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678982473; cv=none; d=google.com; s=arc-20160816; b=fcwd0ABOc5G8u/hEsAbLuRqJgu3FnXoAhRmYxf/mZcuyOtOXEc77k6Nrs/il74+5fU vzYBjz7gdFY32T4sG2Y61K9oZ3E8400JgjzFtOnWEJMu7WI6QCXG8Dle7RXOMgx6RpAE e82VtL7/KGyWlAjSiwe4D72Ar9x2SFBWH++QHbDIOe+s69l/zbkIDzJ/7p2zhu8reitF BBL6sThRgN4adq+NdGEwlZWNAnQmUEh9LpGWCfL77zEy/Ma8irnhppvGxoxx5uji3t3E L74UzYX1mT5DvderRb66t80W9AMVsrVG4lXPU1T1hP5T4m7rcm4lmg57zMXNyxlfEL4D yoIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=ExLMwJzNgwWRHjnTjtALJSPVKx9BbSWtrYmWXQLM/Bk=; b=NzsB+IKWYZ3fUVr6Nl6XFkc7Ua5BpV0iBwgJ7BzCn0NVfO52QCOzEMjOP/KzBRkkv7 uiYFb4tLkt97Ui6L+lsRgBhGAgifptj8b+Htpo1VEeYr9oLnv4h2eDyeFJhjY7C2gzNX 8n+Nsn7fO9A8BjOCH11Z4jYrXslaB/2RzTCbR/VQPymOY+V/ZPvbrL2RVX6Wvr5fM5ba q30OxxU20JENZjQfuypEa67dDaSqwcyHzSRSCemi6djUAxoqCd149eZAWl/XNHYevj3x 4MX+m9byBd7EqbDkiSEUkzn66XAwgrgvN44BjW3BOb+kDh5nNoOcVNhCZ+O4pK9Ps1C7 kifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BaozqFKk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a636907000000b0050bd8ddd41asi5867444pgc.811.2023.03.16.09.00.58; Thu, 16 Mar 2023 09:01:13 -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=BaozqFKk; 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 S231474AbjCPPvb (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Thu, 16 Mar 2023 11:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbjCPPvU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Mar 2023 11:51:20 -0400 Received: from mail-ed1-x54a.google.com (mail-ed1-x54a.google.com [IPv6:2a00:1450:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D8D1E5F1 for <linux-kernel@vger.kernel.org>; Thu, 16 Mar 2023 08:51:16 -0700 (PDT) Received: by mail-ed1-x54a.google.com with SMTP id y24-20020aa7ccd8000000b004be3955a42eso3673693edt.22 for <linux-kernel@vger.kernel.org>; Thu, 16 Mar 2023 08:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678981874; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=ExLMwJzNgwWRHjnTjtALJSPVKx9BbSWtrYmWXQLM/Bk=; b=BaozqFKkD3sCcThM3kJ0CJeU1oKVvG2IZTEZYRhcVPVNMkZ1lFzWF9as+MMZ8hsld7 tZ3GmrajONdoZqutkUpFP17bnuQ/1GSMT+4xd5Z0upJdJchDmE5BiRfjKY7kKS4mrZem NJsUJendQeheVIikqG7slo7ctosxTk0J/IANNs9/xvgYw2BbqggYZTXPLMQDq7WxBvS4 NdWvxaHOdqZ5eUoP9yCwMRgeFncikGyhyqzUJ1IoIlLYH5H2hJCWGH+xjlVSQnVjDARK xstaHNw72Eu5bUEcZiJfIVBSYiXVOPFhGNIZ5RMPCG2zaog+4lxteu0Hqpd31h/TmoOx nZLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678981874; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ExLMwJzNgwWRHjnTjtALJSPVKx9BbSWtrYmWXQLM/Bk=; b=TrjVvs3k3lW6653gQ9qmHnE1ciyBSg6HvZrWrjOkOG5BJWp+nLen9Doy6rTq7kaA3s NF4dVwM7ZWfudSaEh3rv9EtlyMRtROaTKQugo+lq48DAXt5HTv5/lrQOmMB+CSIs4DrT X76fG4Uq+Dcctl4vEF3SmsXTwdgksu0Bn8nwqWj3aCNTsMSwYvsjJpAS8sYb13PxBFfj vSre13aT+rPSmJCVdD1PIDf8KhckEHto3SW1m0aXsF43uvALHbvardyfUz81gng9ae9k eWf0RJ587Zb/Gsu2ZO9xYmQ7f5GjgDZApz0g8NOG7Z9bljtLdpJSwRVIEiXMVtJikzJV rEYA== X-Gm-Message-State: AO0yUKWmehzJeUNxWKErFqQAJnSZNmXeSi91XIOMc1IpxTICZyYbloF5 fJciD4kKoo1Bqkdk8Yng9/ytEKnRvw== X-Received: from elver.muc.corp.google.com ([2a00:79e0:9c:201:f359:6b95:96e:1317]) (user=elver job=sendgmr) by 2002:a50:ce1a:0:b0:4bb:e549:a2ad with SMTP id y26-20020a50ce1a000000b004bbe549a2admr43911edi.4.1678981874737; Thu, 16 Mar 2023 08:51:14 -0700 (PDT) Date: Thu, 16 Mar 2023 16:51:04 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230316155104.594662-1-elver@google.com> Subject: [PATCH] kfence, kcsan: avoid passing -g for tests From: Marco Elver <elver@google.com> To: elver@google.com, Andrew Morton <akpm@linux-foundation.org> Cc: Alexander Potapenko <glider@google.com>, Dmitry Vyukov <dvyukov@google.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nathan Chancellor <nathan@kernel.org> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760540725842216763?= X-GMAIL-MSGID: =?utf-8?q?1760540725842216763?= |
Series |
kfence, kcsan: avoid passing -g for tests
|
|
Commit Message
Marco Elver
March 16, 2023, 3:51 p.m. UTC
Nathan reported that when building with GNU as and a version of clang
that defaults to DWARF5:
$ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
LLVM=1 LLVM_IAS=0 O=build \
mrproper allmodconfig mm/kfence/kfence_test.o
/tmp/kfence_test-08a0a0.s: Assembler messages:
/tmp/kfence_test-08a0a0.s:14627: Error: non-constant .uleb128 is not supported
/tmp/kfence_test-08a0a0.s:14628: Error: non-constant .uleb128 is not supported
/tmp/kfence_test-08a0a0.s:14632: Error: non-constant .uleb128 is not supported
/tmp/kfence_test-08a0a0.s:14633: Error: non-constant .uleb128 is not supported
/tmp/kfence_test-08a0a0.s:14639: Error: non-constant .uleb128 is not supported
...
This is because `-g` defaults to the compiler debug info default. If the
assembler does not support some of the directives used, the above errors
occur. To fix, remove the explicit passing of `-g`.
All these tests want is that stack traces print valid function names,
and debug info is not required for that. I currently cannot recall why I
added the explicit `-g`.
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
---
kernel/kcsan/Makefile | 2 +-
mm/kfence/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Thu, Mar 16, 2023 at 04:51:04PM +0100, Marco Elver wrote: > Nathan reported that when building with GNU as and a version of clang > that defaults to DWARF5: > > $ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ > LLVM=1 LLVM_IAS=0 O=build \ > mrproper allmodconfig mm/kfence/kfence_test.o > /tmp/kfence_test-08a0a0.s: Assembler messages: > /tmp/kfence_test-08a0a0.s:14627: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14628: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14632: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14633: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14639: Error: non-constant .uleb128 is not supported > ... > > This is because `-g` defaults to the compiler debug info default. If the > assembler does not support some of the directives used, the above errors > occur. To fix, remove the explicit passing of `-g`. > > All these tests want is that stack traces print valid function names, > and debug info is not required for that. I currently cannot recall why I > added the explicit `-g`. > > Reported-by: Nathan Chancellor <nathan@kernel.org> > Signed-off-by: Marco Elver <elver@google.com> Thanks for the quick patch! Reviewed-by: Nathan Chancellor <nathan@kernel.org> > --- > kernel/kcsan/Makefile | 2 +- > mm/kfence/Makefile | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile > index 8cf70f068d92..a45f3dfc8d14 100644 > --- a/kernel/kcsan/Makefile > +++ b/kernel/kcsan/Makefile > @@ -16,6 +16,6 @@ obj-y := core.o debugfs.o report.o > KCSAN_INSTRUMENT_BARRIERS_selftest.o := y > obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o > > -CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer > +CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -fno-omit-frame-pointer > CFLAGS_kcsan_test.o += $(DISABLE_STRUCTLEAK_PLUGIN) > obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o > diff --git a/mm/kfence/Makefile b/mm/kfence/Makefile > index 0bb95728a784..2de2a58d11a1 100644 > --- a/mm/kfence/Makefile > +++ b/mm/kfence/Makefile > @@ -2,5 +2,5 @@ > > obj-y := core.o report.o > > -CFLAGS_kfence_test.o := -g -fno-omit-frame-pointer -fno-optimize-sibling-calls > +CFLAGS_kfence_test.o := -fno-omit-frame-pointer -fno-optimize-sibling-calls > obj-$(CONFIG_KFENCE_KUNIT_TEST) += kfence_test.o > -- > 2.40.0.rc1.284.g88254d51c5-goog >
On Thu, 16 Mar 2023 16:51:04 +0100 Marco Elver <elver@google.com> wrote: > Nathan reported that when building with GNU as and a version of clang > that defaults to DWARF5: > > $ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ > LLVM=1 LLVM_IAS=0 O=build \ > mrproper allmodconfig mm/kfence/kfence_test.o > /tmp/kfence_test-08a0a0.s: Assembler messages: > /tmp/kfence_test-08a0a0.s:14627: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14628: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14632: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14633: Error: non-constant .uleb128 is not supported > /tmp/kfence_test-08a0a0.s:14639: Error: non-constant .uleb128 is not supported > ... > > This is because `-g` defaults to the compiler debug info default. If the > assembler does not support some of the directives used, the above errors > occur. To fix, remove the explicit passing of `-g`. > > All these tests want is that stack traces print valid function names, > and debug info is not required for that. I currently cannot recall why I > added the explicit `-g`. Does this need to be backported into earlier kernels? If so, we'd need to do it as two patches, each with the relevant Fixes:, which appear to be a146fed56f8 and bc8fbc5f30.
On Thu, 16 Mar 2023 at 23:33, Andrew Morton <akpm@linux-foundation.org> wrote: > > On Thu, 16 Mar 2023 16:51:04 +0100 Marco Elver <elver@google.com> wrote: > > > Nathan reported that when building with GNU as and a version of clang > > that defaults to DWARF5: > > > > $ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \ > > LLVM=1 LLVM_IAS=0 O=build \ > > mrproper allmodconfig mm/kfence/kfence_test.o > > /tmp/kfence_test-08a0a0.s: Assembler messages: > > /tmp/kfence_test-08a0a0.s:14627: Error: non-constant .uleb128 is not supported > > /tmp/kfence_test-08a0a0.s:14628: Error: non-constant .uleb128 is not supported > > /tmp/kfence_test-08a0a0.s:14632: Error: non-constant .uleb128 is not supported > > /tmp/kfence_test-08a0a0.s:14633: Error: non-constant .uleb128 is not supported > > /tmp/kfence_test-08a0a0.s:14639: Error: non-constant .uleb128 is not supported > > ... > > > > This is because `-g` defaults to the compiler debug info default. If the > > assembler does not support some of the directives used, the above errors > > occur. To fix, remove the explicit passing of `-g`. > > > > All these tests want is that stack traces print valid function names, > > and debug info is not required for that. I currently cannot recall why I > > added the explicit `-g`. > > Does this need to be backported into earlier kernels? > > If so, we'd need to do it as two patches, each with the relevant > Fixes:, which appear to be a146fed56f8 and bc8fbc5f30. Good point - sent https://lkml.kernel.org/r/20230316224705.709984-1-elver@google.com Thanks, -- Marco
diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile index 8cf70f068d92..a45f3dfc8d14 100644 --- a/kernel/kcsan/Makefile +++ b/kernel/kcsan/Makefile @@ -16,6 +16,6 @@ obj-y := core.o debugfs.o report.o KCSAN_INSTRUMENT_BARRIERS_selftest.o := y obj-$(CONFIG_KCSAN_SELFTEST) += selftest.o -CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -g -fno-omit-frame-pointer +CFLAGS_kcsan_test.o := $(CFLAGS_KCSAN) -fno-omit-frame-pointer CFLAGS_kcsan_test.o += $(DISABLE_STRUCTLEAK_PLUGIN) obj-$(CONFIG_KCSAN_KUNIT_TEST) += kcsan_test.o diff --git a/mm/kfence/Makefile b/mm/kfence/Makefile index 0bb95728a784..2de2a58d11a1 100644 --- a/mm/kfence/Makefile +++ b/mm/kfence/Makefile @@ -2,5 +2,5 @@ obj-y := core.o report.o -CFLAGS_kfence_test.o := -g -fno-omit-frame-pointer -fno-optimize-sibling-calls +CFLAGS_kfence_test.o := -fno-omit-frame-pointer -fno-optimize-sibling-calls obj-$(CONFIG_KFENCE_KUNIT_TEST) += kfence_test.o