From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Amy Fong <amy.fong@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] External modules fail to load due to unknown symbols
Date: Fri, 05 Jun 2015 23:53:07 +0100 [thread overview]
Message-ID: <1433544787.28975.48.camel@linuxfoundation.org> (raw)
In-Reply-To: <20150605171815.GA20636@windriver.com>
On Fri, 2015-06-05 at 13:18 -0400, Amy Fong wrote:
> From da12fa5e6daca0c0b7bb15df030b1c79fbefa089 Mon Sep 17 00:00:00 2001
> From: Amy Fong <amy.fong@windriver.com>
> Date: Mon, 1 Jun 2015 13:16:20 -0400
> Subject: [PATCH] External modules fail to load due to unknown symbols
>
> When building external kernel modules, a failure can happen
> when the module has dependencies on other kernel modules.
> In such cases, the build looks at Module.symvers to do
> symbol lookups of the other kernel modules that it depends on.
>
> Module.symvers gets copied by do_shared_workdir
> after do_compile and Module.symvers gets updated during
> do_compile_kernelmodules.
>
> do_compile_kernelmodules is modified to explicitly copy Module.symvers
> to the shared workdir.
>
> Signed-off-by: Amy Fong <amy.fong@windriver.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> meta/classes/kernel.bbclass | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 4f22cde..4a177b1 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -215,6 +215,14 @@ do_compile_kernelmodules() {
> unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> oe_runmake ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
> +
> + # Module.symvers gets updated during the
> + # building of the kernel modules. We need to
> + # update this in the shared workdir since some
> + # external kernel modules has a dependency on
> + # other kernel modules and will look at this
> + # file to do symbol lookups
> + cp Module.symvers ${STAGING_KERNEL_BUILDDIR}
> else
> bbnote "no modules to compile"
> fi
Sadly this will give rise to a race. shared_workdir is defined as:
addtask shared_workdir after do_compile before do_compile_kernelmodule
and other modules depend on the shared_workdir task. Your other modules
could therefore compile before the code in compile_kernelmodule has run.
At a guess you will next suggest we change shared_workdir to be after
compile_kernelmodules. The problem there is one of performance. We had
bug reports from the community and Wind River people about the fact that
shared_workdir executes when building kernel modules and doesn't come
from sstate. Forcing shared_workdir to run more tasks every time isn't
going to make people happy either :(
So I'm not sure how we solve this but it is going to need more thought
and the above patch isn't right.
Cheers,
Richard
next prev parent reply other threads:[~2015-06-05 22:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 17:18 [PATCH] External modules fail to load due to unknown symbols Amy Fong
2015-06-05 22:53 ` Richard Purdie [this message]
2015-06-07 20:30 ` Bruce Ashfield
-- strict thread matches above, loose matches on Subject: below --
2015-06-02 20:41 Amy Fong
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=1433544787.28975.48.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=amy.fong@windriver.com \
--cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.