qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Warner Losh <imp@bsdimp.com>
Cc: fam@euphon.net, "Daniel P. Berrange" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [RFC PATCH 3/3] tests/tcg: commit Makefile atrocities in the name of portability
Date: Fri, 17 Sep 2021 17:41:16 +0100	[thread overview]
Message-ID: <87y27vrw17.fsf@linaro.org> (raw)
In-Reply-To: <CANCZdfoR=xBietGR-y_9VpDiinNwOz2u44HGOpOx3CHwKs5fBw@mail.gmail.com>


Warner Losh <imp@bsdimp.com> writes:

> On Fri, Sep 17, 2021 at 8:39 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
>  Warner Losh <imp@bsdimp.com> writes:
>
>  > On Tue, Aug 3, 2021 at 5:02 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>  >
>  >  Not all of the multiarch tests are pure POSIX so elide over those
>  >  tests on a non-Linux system. This allows for at least some of the
>  >  tests to be nominally usable by *BSD user builds.
>  >
>  >  Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>  >  Cc: Warner Losh <imp@bsdimp.com>
>  >  ---
>  >   tests/tcg/multiarch/Makefile.target | 6 +++++-
>  >   tests/tcg/x86_64/Makefile.target    | 4 ++++
>  >   2 files changed, 9 insertions(+), 1 deletion(-)
>  >
>  > Acked-by: Warner Losh <imp@bsdimp.com>
>  >
>  > To do this with gcc10, however, I had to add -Wno-error=overflow
>  > otherwise I got a lot of warnings about constants being truncated to
>  > 0.
>  >
>  > It also fails the sha1 test, but when I run it by hand it works. It turns
>  > out that I have a sha1 in my path, and at least in the bsd-user edition
>  > of qemu-i386 tries to run that and fails.
>  >
>  > Also, the hello world program needed tweaking
>  >
>  > So with this applied and the following patch
>  >
>  > diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
>  > index 63cf1b2573..39420631a8 100644
>  > --- a/tests/tcg/Makefile.target
>  > +++ b/tests/tcg/Makefile.target
>  > @@ -155,7 +155,7 @@ RUN_TESTS+=$(EXTRA_RUNS)
>  >
>  >  ifdef CONFIG_USER_ONLY
>  >  run-%: %
>  > -       $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
>  > +       $(call run-test, $<, $(QEMU) $(QEMU_OPTS) ./$<, "$< on $(TARGET_NAME)")
>  >
>  >  run-plugin-%:
>  >         $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
>  > @@ -168,7 +168,7 @@ run-%: %
>  >         $(call run-test, $<, \
>  >           $(QEMU) -monitor none -display none \
>  >                   -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
>  > -                 $(QEMU_OPTS) $<, \
>  > +                 $(QEMU_OPTS) ./$<, \
>  >           "$< on $(TARGET_NAME)")
>
>  That's weird. I'm not super keen to merge this because it's incomplete
>  (we have a large number of manual run-FOO stanzas). AFAICT neither of
>  the loaders attempt to enumerate and search path so I wonder if this is
>  a function of the shell?
>
> bsd-user does, in fact, search the path. It does so in loader_exec. It does this,
> I believe, to support execing native binaries, but I'll need to check
> on that.

It's certainly different from what linux-user does. The execing of
native binaries seems a bit niche given you can always pass an explicit
path. Maybe you could tweak loader_exec to check for the local binary
first. It seems to skip straight to searching the path if there are no
/'s in the filename.

This is unrelated to how you handle foreign binaries on the BSDs? Is
there an equivalent to binfmt_misc?

-- 
Alex Bennée


  reply	other threads:[~2021-09-17 16:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 11:02 [RFC PATCH 0/3] check-tcg hacks for BSD Alex Bennée
2021-08-03 11:02 ` [RFC PATCH 1/3] configure: don't override the selected host test compiler if defined Alex Bennée
2021-08-03 11:02 ` [RFC PATCH 2/3] tests/tcg/sha1: remove endian include Alex Bennée
2021-08-03 13:55   ` Warner Losh
2021-08-03 14:20     ` Warner Losh
2021-08-03 11:02 ` [RFC PATCH 3/3] tests/tcg: commit Makefile atrocities in the name of portability Alex Bennée
2021-09-14 16:03   ` Warner Losh
2021-09-17 14:34     ` Alex Bennée
2021-09-17 15:08       ` Warner Losh
2021-09-17 16:41         ` Alex Bennée [this message]
2021-09-17 17:23           ` Warner Losh

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=87y27vrw17.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=imp@bsdimp.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).