From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BF80C433EF for ; Fri, 17 Sep 2021 16:47:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4E9360EFF for ; Fri, 17 Sep 2021 16:47:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A4E9360EFF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:51314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRH1l-0007cv-TA for qemu-devel@archiver.kernel.org; Fri, 17 Sep 2021 12:47:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRGzB-0005Nx-U1 for qemu-devel@nongnu.org; Fri, 17 Sep 2021 12:45:13 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:40549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRGzA-0005YO-3v for qemu-devel@nongnu.org; Fri, 17 Sep 2021 12:45:13 -0400 Received: by mail-wr1-x430.google.com with SMTP id q26so16166128wrc.7 for ; Fri, 17 Sep 2021 09:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=RXNRs2YChbM2q/tazkXpFs70yL3wLXFi3eLTjH8y224=; b=HBAYANXP/DEYVuebTczJMsUDr6nk8iK6Ryg5ly7JbgnCRpi3188EH/jXnkaalgSf5I JGJJAeAtTg7wiXFhrd/VpVFHEL860DL4EpvE4Y9ExkWYn2I7Kv8jvLpIhdjyBIsdVS7p f2TVm4dc+vNF5tqlrbCQgKS62FLE6wwFjw9XdwA7i4fm5SBjgI7Kp0MhffzRF9UNcOy+ UQbfKnGXmOv2oFTZZTkU8RwChSnsXhjn65PGsBNGdBjuqCf2pPDap5FNK+NROJBv1H95 OE4H63OmWk1GmKm8jVx1L/6zcaiexkU3e1RTgSTZjIpxE1b/dsfFncrwbxgzIYk7aLWF ZtoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=RXNRs2YChbM2q/tazkXpFs70yL3wLXFi3eLTjH8y224=; b=fdOndJ2v+aJdCWUACgD9+aM8m87RkBEIkeEZ9RwIryRpYV15vEIwx41v0RLXFpw4AL WxiJ8mNCaQhg1vz5v56w7JIfqOv85DPTJUvVsvlIREfW9PARk0eZeK08nsMRIHZITgQ0 U63TCeXXaFLQgUk7SFyN0gbMDUgH9QEGiifW0uiLfV5vf1ZSUb8/hqQlP8SMum8JD16a HGUCLPlv49L1NUS8R2+NY9wWqvaoD1iFyDGxn54H/ya7W0G5Tkpjje6mNhSQshGjKrOU UpI2rJQOchD3N3TQiPh8DlnKY2AeIvIJZottdh2cO9J/vpOWuBnd+W/Og2sRqP8O9aVL Wjpg== X-Gm-Message-State: AOAM531IHDCvUT07YRltynANOP+0R7Yq7kacMhjvXG9F+tbSkmldlTD4 6tsIdR132AmFWvJNWeuZPAPkAw== X-Google-Smtp-Source: ABdhPJwZ3Q3a9tkSGT13B8atfdVboXrNiCx8IqRkAJkinwKVENItyIEMskqgje9vcdBo1sdIOpjYNg== X-Received: by 2002:adf:df0d:: with SMTP id y13mr13174759wrl.335.1631897110318; Fri, 17 Sep 2021 09:45:10 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s3sm2571425wra.72.2021.09.17.09.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Sep 2021 09:45:09 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A62EC1FF96; Fri, 17 Sep 2021 17:45:08 +0100 (BST) References: <20210803110237.1051032-1-alex.bennee@linaro.org> <20210803110237.1051032-4-alex.bennee@linaro.org> <8735q3tgfo.fsf@linaro.org> User-agent: mu4e 1.7.0; emacs 28.0.50 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Warner Losh 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 In-reply-to: Message-ID: <87y27vrw17.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, "Daniel P. Berrange" , Eduardo Habkost , Richard Henderson , QEMU Developers , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Warner Losh writes: > On Fri, Sep 17, 2021 at 8:39 AM Alex Benn=C3=A9e = wrote: > > Warner Losh writes: > > > On Tue, Aug 3, 2021 at 5:02 AM Alex Benn=C3=A9e 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=C3=A9e > > Cc: Warner Losh > > --- > > tests/tcg/multiarch/Makefile.target | 6 +++++- > > tests/tcg/x86_64/Makefile.target | 4 ++++ > > 2 files changed, 9 insertions(+), 1 deletion(-) > > > > Acked-by: Warner Losh > > > > To do this with gcc10, however, I had to add -Wno-error=3Doverflow > > 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 tu= rns > > 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+=3D$(EXTRA_RUNS) > > > > ifdef CONFIG_USER_ONLY > > run-%: % > > - $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_= NAME)") > > + $(call run-test, $<, $(QEMU) $(QEMU_OPTS) ./$<, "$< on $(TARGE= T_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=3D$<.out$(COMMA)id=3Doutpu= t \ > > - $(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 do= es 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? --=20 Alex Benn=C3=A9e