From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 69C2D3886C6F for ; Mon, 28 Jun 2021 08:29:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69C2D3886C6F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-rQmz9sBjMWqDBG21ZTS9og-1; Mon, 28 Jun 2021 04:29:43 -0400 X-MC-Unique: rQmz9sBjMWqDBG21ZTS9og-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01DD118D6A2C; Mon, 28 Jun 2021 08:29:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-228.ams2.redhat.com [10.36.112.228]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D8925D9C6; Mon, 28 Jun 2021 08:29:38 +0000 (UTC) From: Florian Weimer To: Joseph Myers Cc: Carlos O'Donell , libc-alpha@sourceware.org, Alexandra =?utf-8?B?SMOhamtvdsOh?= Subject: Re: [PATCH] Add valgrind smoke test References: <20210524121532.1374966-1-ahajkova@redhat.com> Date: Mon, 28 Jun 2021 10:29:36 +0200 In-Reply-To: (Joseph Myers's message of "Mon, 24 May 2021 19:28:20 +0000") Message-ID: <878s2uz91r.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 08:29:48 -0000 * Joseph Myers: > On Mon, 24 May 2021, Carlos O'Donell via Libc-alpha wrote: > >> > +# Run smoke tests with valgrind to verify dynamic loader >> > +ifneq ($(VALGRIND),false) >> > +tests-special += $(objpfx)valgrind-smoke-test.out >> > +$(objpfx)valgrind-smoke-test.out: $(objpfx)ld.so >> > + $(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true > $@ >> > + $(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true --help >> $@ >> > +endif >> Does this work for cross-compiling? >> >> Do you correctly detect the target valgrind and does the test wrapper >> allow the correct execution of valgrind on the target system? > > My expectation is that -valgrind won't exist - but AC_CHECK_TOOL is > documented as falling back to the tool without a host prefix if a prefixed > version doesn't exist, which is a problem. Logically, this test should > run if valgrind is available on the test system (which would need to be > determined when the tests are run, test-wrapper isn't available when glibc > is built), but the test-wrapper interface doesn't strictly support running > arbitrary installed programs like that. So you might need a test program > (run on the test system via test-wrapper) that itself checks for valgrind > being available in the PATH and runs it or returns UNSUPPORTED if not > available. That is, something like nptl/tst-pthread-gdb-attach.c, which > handles checking for whether gdb is available. Would it be okay to run these tests only if $(run-built-tests) is yes, $(cross-compiling) is no, and configure had found a valgrind binary? I think even a minimal test which is does not work for cross-compilation would be valuable. Thanks, Florian