From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id 5C7733858D35; Tue, 5 Sep 2023 20:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C7733858D35 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix 30808 gprofng tests failed X-Act-Checkin: binutils-gdb X-Git-Author: Vladimir Mezentsev X-Git-Refname: refs/heads/master X-Git-Oldrev: a006bc9c37e95b4afaf85715cc54fe57b3300ccd X-Git-Newrev: a13e4c5c10d1a13d9128d033c9525810e876ac14 Message-Id: <20230905201052.5C7733858D35@sourceware.org> Date: Tue, 5 Sep 2023 20:10:52 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2023 20:10:52 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da13e4c5c10d1= a13d9128d033c9525810e876ac14 commit a13e4c5c10d1a13d9128d033c9525810e876ac14 Author: Vladimir Mezentsev Date: Thu Aug 31 16:26:59 2023 -0700 Fix 30808 gprofng tests failed =20 In gprofng testing, we need a tempory gprofng installation to resolve r= un-time dependencies on libraries (libgprofng, libopcodes, libbfd, etc). We set LD_LIBRARY_PATH and GPROFNG_SYSCONFDIR to find our libraries and configuration file. These variables must be set for all gprofng tests. =20 Tested on aarch64 and x86_64 with and without --enable-shared and --tar= get=3D<>. =20 gprofng/ChangeLog 2023-08-31 Vladimir Mezentsev =20 PR gprofng/30808 * testsuite/config/default.exp: Make a temporary install dir. Set LD_LIBRARY_PATH, GPROFNG_SYSCONFDIR. * testsuite/lib/Makefile.skel: Move LD_LIBRARY_PATH and GPROFNG_SYSCONFDIR setting in testsuite/config/default.exp. Diff: --- gprofng/testsuite/config/default.exp | 20 ++++++++++++++------ gprofng/testsuite/lib/Makefile.skel | 5 ----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/confi= g/default.exp index 1c862d54592..c4a6588bb64 100644 --- a/gprofng/testsuite/config/default.exp +++ b/gprofng/testsuite/config/default.exp @@ -32,17 +32,25 @@ if {![info exists CFLAGS]} { set CFLAGS "-g -O2" } =20 +remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\"" if { "$CHECK_TARGET" =3D=3D "check-install" } { set ::env(GPROFNG) "$PREFIX/bin/gprofng" } else { - set ::env(GPROFNG) "$BUILDDIR/src/gprofng" + # Make a temporary install dir to run gprofng from, and point at it + remote_exec host "sh -c \"$MAKE -C .. install-gprofng MAKEFLAGS=3Dprog= ram_transform_name=3D DESTDIR=3D$BUILDDIR/tmpdir/root\"" + set ::env(GPROFNG) [exec find $BUILDDIR/tmpdir -type f -name gprofng -= perm -u+x | head -1] + + set x [exec find $BUILDDIR/tmpdir -type d -name gprofng | head -1] + set ::env(LD_LIBRARY_PATH) "$x:$x/.." + + set x [exec find $BUILDDIR/tmpdir -type f -name gprofng.rc | head -1] + set ::env(GPROFNG_SYSCONFDIR) [exec dirname $x] + + puts "### LD_LIBRARY_PATH: $env(LD_LIBRARY_PATH)" + puts "### GPROFNG_SYSCONFDIR: $env(GPROFNG_SYSCONFDIR)" } +puts "### GPROFNG: $env(GPROFNG)" =20 set TEST_TIMEOUT 300 =20 -# Create directories where gprofng can find libraries and binaries: -remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\"" -remote_exec host "sh -c \"mkdir -p lib; rm -f lib/gprofng; ln -s ../libcol= lector/.libs lib/gprofng\"" -remote_exec host "sh -c \"rm -f bin; ln -s src bin\"" - load_lib display-lib.exp diff --git a/gprofng/testsuite/lib/Makefile.skel b/gprofng/testsuite/lib/Ma= kefile.skel index 5a30966c1cd..9ccc0340c10 100644 --- a/gprofng/testsuite/lib/Makefile.skel +++ b/gprofng/testsuite/lib/Makefile.skel @@ -39,11 +39,6 @@ DISPLAY =3D $(GPROFNG) display text EXPERIMENT =3D test.er DISPLAY_LOG =3D display.log =20 -export LD_LIBRARY_PATH :=3D $(BUILDDIR)/src - -# Set GPROFNG_SYSCONFDIR to find out gprofng.rc: -export GPROFNG_SYSCONFDIR :=3D $(srcdir)/../../../src - .PHONY: all collect compare clobber clean =20 all: compare