public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix 30808 gprofng tests failed
@ 2023-09-01 20:04 vladimir.mezentsev
  2024-01-17 11:24 ` Xi Ruoyao
  0 siblings, 1 reply; 5+ messages in thread
From: vladimir.mezentsev @ 2023-09-01 20:04 UTC (permalink / raw)
  To: binutils; +Cc: Vladimir Mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

In gprofng testing, we need a tempory gprofng installation to resolve run-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.

Tested on aarch64 and x86_64 with and without --enable-shared and --target=<>.

gprofng/ChangeLog
2023-08-31  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	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.
---
 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/config/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"
 }
 
+remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
 if { "$CHECK_TARGET" == "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=program_transform_name= DESTDIR=$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)"
 
 set TEST_TIMEOUT 300
 
-# 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 ../libcollector/.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/Makefile.skel
index 5a30966c1cd..9ccc0340c10 100644
--- a/gprofng/testsuite/lib/Makefile.skel
+++ b/gprofng/testsuite/lib/Makefile.skel
@@ -39,11 +39,6 @@ DISPLAY	    = $(GPROFNG) display text
 EXPERIMENT  = test.er
 DISPLAY_LOG = display.log
 
-export LD_LIBRARY_PATH := $(BUILDDIR)/src
-
-# Set GPROFNG_SYSCONFDIR to find out gprofng.rc:
-export GPROFNG_SYSCONFDIR := $(srcdir)/../../../src
-
 .PHONY: all collect compare clobber clean
 
 all: compare
-- 
2.31.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix 30808 gprofng tests failed
  2023-09-01 20:04 [PATCH] Fix 30808 gprofng tests failed vladimir.mezentsev
@ 2024-01-17 11:24 ` Xi Ruoyao
  2024-01-18  0:49   ` Vladimir Mezentsev
  0 siblings, 1 reply; 5+ messages in thread
From: Xi Ruoyao @ 2024-01-17 11:24 UTC (permalink / raw)
  To: vladimir.mezentsev, binutils

On Fri, 2023-09-01 at 13:04 -0700, Vladimir Mezentsev via Binutils wrote:

> diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/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"
>  }
>  
> +remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
>  if { "$CHECK_TARGET" == "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=program_transform_name= DESTDIR=$BUILDDIR/tmpdir/root\""

Unfortunately this has bring back PR29107.  I've created PR31252.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix 30808 gprofng tests failed
  2024-01-17 11:24 ` Xi Ruoyao
@ 2024-01-18  0:49   ` Vladimir Mezentsev
  2024-01-18  3:52     ` Xi Ruoyao
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Mezentsev @ 2024-01-18  0:49 UTC (permalink / raw)
  To: Xi Ruoyao, binutils

On 1/17/24 03:24, Xi Ruoyao wrote:
> On Fri, 2023-09-01 at 13:04 -0700, Vladimir Mezentsev via Binutils wrote:
>
>> diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/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"
>>   }
>>   
>> +remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
>>   if { "$CHECK_TARGET" == "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=program_transform_name= DESTDIR=$BUILDDIR/tmpdir/root\""
> Unfortunately this has bring back PR29107.  I've created PR31252.
>

I cannot reproduce the problem on the master branch ( OL8 / x86_64 ).
I did:

mkdir bld_x86_64
cd bld_x86_64
../configure --prefix=/usr --with-system-zlib --enable-shared 
--disable-{gdb,gdbserver,libbacktrace,libdecnumber,readline,sim}
make -j16 -O tooldir=/usr V=1 2>&1 | tee make.log
make -k -j16 -O check 2>&1 | tee make_check.log

I see errors but they are not related to 30808.
% grep FAIL make_check.log
FAIL: 
/ws/gprofng-dev-backedup/vmezents/GPROF/binutils-gdb/libctf/testsuite/libctf-regression/libctf-repeat-cu.exp
FAIL: 
/ws/gprofng-dev-backedup/vmezents/GPROF/binutils-gdb/libctf/testsuite/libctf-regression/nonstatic-var-section-ld-r.c
FAIL: replacing SOURCE_DATE_EPOCH deterministic member (wrong size, 
expected: 1120)
FAIL: archive with empty element
FAIL: cxxfilt: demangling _Z1fIvJiELb0EEvPDOT1_EFT_DpT0_E
FAIL: cxxfilt: demangling 
_Z14int_if_addableI1YERiP1AIXszpldecvPT_Li0EdecvS4_Li0EEE

Could you send me the log files with errors.

Thank you,
-Vladimir


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix 30808 gprofng tests failed
  2024-01-18  0:49   ` Vladimir Mezentsev
@ 2024-01-18  3:52     ` Xi Ruoyao
  2024-01-18 13:28       ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Xi Ruoyao @ 2024-01-18  3:52 UTC (permalink / raw)
  To: Vladimir Mezentsev, binutils

在 2024-01-17星期三的 16:49 -0800,Vladimir Mezentsev写道:
> On 1/17/24 03:24, Xi Ruoyao wrote:
> > On Fri, 2023-09-01 at 13:04 -0700, Vladimir Mezentsev via Binutils wrote:
> > 
> > > diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/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"
> > >   }
> > >   
> > > +remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
> > >   if { "$CHECK_TARGET" == "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=program_transform_name= DESTDIR=$BUILDDIR/tmpdir/root\""
> > Unfortunately this has bring back PR29107.  I've created PR31252.
> > 
> 
> I cannot reproduce the problem on the master branch ( OL8 / x86_64 ).
> I did:
> 
> mkdir bld_x86_64
> cd bld_x86_64
> ../configure --prefix=/usr --with-system-zlib --enable-shared 
> --disable-{gdb,gdbserver,libbacktrace,libdecnumber,readline,sim}
> make -j16 -O tooldir=/usr V=1 2>&1 | tee make.log
> make -k -j16 -O check 2>&1 | tee make_check.log
> 
> I see errors but they are not related to 30808.

But they are likely caused by the change.

I think I (and Nick) have explained the issue well in
https://sourceware.org/bugzilla/show_bug.cgi?id=29107: if you run "make
install" in the test suite, libtool will relink some shared libraries
and the other test suite using these shared libraries will error out
with messages like "file too short" or "undefined symbol" while the
shared libraries are being overwritten.

So you shouldn't run "make install" in the test suite, period, no some
sort of "but I need it" things.


-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix 30808 gprofng tests failed
  2024-01-18  3:52     ` Xi Ruoyao
@ 2024-01-18 13:28       ` H.J. Lu
  0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2024-01-18 13:28 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: Vladimir Mezentsev, binutils

On Wed, Jan 17, 2024 at 7:53 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> 在 2024-01-17星期三的 16:49 -0800,Vladimir Mezentsev写道:
> > On 1/17/24 03:24, Xi Ruoyao wrote:
> > > On Fri, 2023-09-01 at 13:04 -0700, Vladimir Mezentsev via Binutils wrote:
> > >
> > > > diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/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"
> > > >   }
> > > >
> > > > +remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\""
> > > >   if { "$CHECK_TARGET" == "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=program_transform_name= DESTDIR=$BUILDDIR/tmpdir/root\""
> > > Unfortunately this has bring back PR29107.  I've created PR31252.
> > >
> >
> > I cannot reproduce the problem on the master branch ( OL8 / x86_64 ).
> > I did:
> >
> > mkdir bld_x86_64
> > cd bld_x86_64
> > ../configure --prefix=/usr --with-system-zlib --enable-shared
> > --disable-{gdb,gdbserver,libbacktrace,libdecnumber,readline,sim}
> > make -j16 -O tooldir=/usr V=1 2>&1 | tee make.log
> > make -k -j16 -O check 2>&1 | tee make_check.log
> >
> > I see errors but they are not related to 30808.
>
> But they are likely caused by the change.
>
> I think I (and Nick) have explained the issue well in
> https://sourceware.org/bugzilla/show_bug.cgi?id=29107: if you run "make
> install" in the test suite, libtool will relink some shared libraries
> and the other test suite using these shared libraries will error out
> with messages like "file too short" or "undefined symbol" while the
> shared libraries are being overwritten.
>
> So you shouldn't run "make install" in the test suite, period, no some
> sort of "but I need it" things.
>

I agree.  Does LD_LIBRARY_PATH work for gprofng tests?

-- 
H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-18 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01 20:04 [PATCH] Fix 30808 gprofng tests failed vladimir.mezentsev
2024-01-17 11:24 ` Xi Ruoyao
2024-01-18  0:49   ` Vladimir Mezentsev
2024-01-18  3:52     ` Xi Ruoyao
2024-01-18 13:28       ` H.J. Lu

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 read-only IMAP folder(s) and NNTP newsgroup(s).