Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: kernel test robot <lkp@intel.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [paulmckrcu:dev 47/49] ERROR: modpost: "rcutorture_format_gp_seqs" [kernel/rcu/rcutorture.ko] undefined!
Date: Tue, 10 Dec 2024 13:35:52 -0700	[thread overview]
Message-ID: <20241210203552.GA4141507@ax162> (raw)
In-Reply-To: <41482ec9-5048-46ea-9c8b-9d33a05ea2a6@paulmck-laptop>

On Tue, Dec 10, 2024 at 10:47:22AM -0800, Paul E. McKenney wrote:
> On Wed, Dec 04, 2024 at 12:04:15PM +0800, kernel test robot wrote:
> > tree:   https://github.com/paulmckrcu/linux dev
> > head:   48ca997e8632db65609dcc6a715207a1b6dded57
> > commit: 13e3224fa73ec6c7dfeda04b2741c95787196588 [47/49] rcutorture: Include grace-period sequence numbers in failure/close-call
> > config: arm-randconfig-001-20241203 (https://download.01.org/0day-ci/archive/20241204/202412041204.ys3dSglL-lkp@intel.com/config)
> > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041204.ys3dSglL-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202412041204.ys3dSglL-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>, old ones prefixed by <<):
> > 
> > ERROR: modpost: "rcutorture_gather_gp_seqs" [kernel/rcu/rcutorture.ko] undefined!
> > >> ERROR: modpost: "rcutorture_format_gp_seqs" [kernel/rcu/rcutorture.ko] undefined!
> 
> This commit has EXPORT_SYMBOL_GPL() for both the Tree and Tiny definitions
> of both of these functions.  What am I missing here?

This configuration has CONFIG_RCU_TINY=y and CONFIG_RCU_TORTURE_TEST=m,
so the definition and export do not work correctly because the define is
CONFIG_RCU_TORTURE_TEST_MODULE in that case. I think you should be using
IS_ENABLED(), which will handle =y and =m. This resolves the error for
me.

Cheers,
Nathan

diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index f068bd9dc037..773944257e79 100644
--- a/kernel/rcu/tiny.c
+++ b/kernel/rcu/tiny.c
@@ -257,7 +257,7 @@ void kvfree_call_rcu(struct rcu_head *head, void *ptr)
 EXPORT_SYMBOL_GPL(kvfree_call_rcu);
 #endif
 
-#ifdef CONFIG_RCU_TORTURE_TEST
+#if IS_ENABLED(CONFIG_RCU_TORTURE_TEST)
 unsigned long rcutorture_gather_gp_seqs(void)
 {
 	return READ_ONCE(rcu_ctrlblk.gp_seq) & 0xff;

  reply	other threads:[~2024-12-10 20:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04  4:04 [paulmckrcu:dev 47/49] ERROR: modpost: "rcutorture_format_gp_seqs" [kernel/rcu/rcutorture.ko] undefined! kernel test robot
2024-12-10 18:47 ` Paul E. McKenney
2024-12-10 20:35   ` Nathan Chancellor [this message]
2024-12-10 21:37     ` Paul E. McKenney
2024-12-11  5:24       ` Nathan Chancellor
2024-12-11 20:47         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210203552.GA4141507@ax162 \
    --to=nathan@kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paulmck@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox