Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Vyacheslav Yurkov" <uvv.mail@gmail.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: Patches and discussions about the oe-core layer
	<Openembedded-core@lists.openembedded.org>,
	Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Subject: Re: [OE-core] [PATCH] module.bbclass: add HOSTCC for out-of-tree modules
Date: Thu, 1 Oct 2020 17:05:49 +0200	[thread overview]
Message-ID: <f850b3d4-b530-ade5-d64f-bc8611a1aba9@gmail.com> (raw)
In-Reply-To: <CADkTA4O_M+Wb5bXdiSTzKJDnB0GJVKoNUhD_t3x5qZsG0EvfLQ@mail.gmail.com>

On 01.10.2020 16:53, Bruce Ashfield wrote:
> On Thu, Oct 1, 2020 at 10:47 AM Vyacheslav Yurkov <uvv.mail@gmail.com> wrote:
>> On 01.10.2020 16:36, Bruce Ashfield wrote:
>>> We already ran into this with the main kernel flags, and we don't want
>>> to duplicate them here.
>>>
>>> Why aren't what we have in kernel.bbclass working in your scenario ?
>>>
>>> Bruce
>>>
>> Because kernel.bbclass is not pulled in into the environment of
>> out-of-tree module recipe. Should it be?
>> This can easily be checked when you do 'bitbake hello-mod -c devshell'
>> and examine $EXTRA_OEMAKE variable.
> Yes, it should be.
>
> We build out of tree modules in each autobuilder test run, so it is
> functional for the most part. I'd be interested to see the reproducing
> kernel module and build steps, so they can be built into the tests to
> catch this.
>
> But we absolutely do not want to duplicate those flags into this class.
>
> So with a reproducer, we can perhaps shuffle things around and make
> sure that both this new case and the old ones continue to work.
>
> Bruce
>
That's interesting to know. It has been easy to reproduce in 4.x kernel, 
but with 5.x in master it fails silently. So here's what you do with 5.x 
and meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb module

1. Set machine to any x86, e.g. qemux86-64
2. Enable CONFIG_UNWINDER_ORC in the kernel configuration
3. Modify kernel Makefile as follows:
Vyacheslav, [01.10.20 17:01]
index 8b1d5b9017a5..e35da9f9bb75 100644
--- a/Makefile
+++ b/Makefile
@@ -1058,7 +1058,9 @@ ifdef CONFIG_STACK_VALIDATION
       echo "int main() {}" | $(HOSTCC) -xc -o /dev/null 
$(HOST_LIBELF_LIBS) -,1,0)
    ifeq ($(has_libelf),1)
      objtool_target := tools/objtool FORCE
+    $(info "Validation enabled")
    else
+    $(info "Check failed, disabling stack validation")
      SKIP_STACK_VALIDATION := 1
      export SKIP_STACK_VALIDATION
    endif

4. If HOSTCC is set properly, then you should see "Validation enabled" 
in log.do_compile of hello-mod recipe.

Any hints where autobuilder tests are? Perhaps I could take a look and 
find a way to cover this...

Vyacheslav

  reply	other threads:[~2020-10-01 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 13:59 [PATCH] module.bbclass: add HOSTCC for out-of-tree modules Vyacheslav Yurkov
2020-10-01 14:36 ` [OE-core] " Bruce Ashfield
2020-10-01 14:47   ` Vyacheslav Yurkov
2020-10-01 14:53     ` Bruce Ashfield
2020-10-01 15:05       ` Vyacheslav Yurkov [this message]
2020-10-01 15:16         ` Bruce Ashfield
     [not found]     ` <1639E5FC19B7A570.14692@lists.openembedded.org>
2020-10-01 15:05       ` Bruce Ashfield

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=f850b3d4-b530-ade5-d64f-bc8611a1aba9@gmail.com \
    --to=uvv.mail@gmail.com \
    --cc=Openembedded-core@lists.openembedded.org \
    --cc=Vyacheslav.Yurkov@bruker.com \
    --cc=bruce.ashfield@gmail.com \
    /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