This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to make egcs work with latest dejagnu
- To: egcs-patches at cygnus dot com
- Subject: PATCH to make egcs work with latest dejagnu
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Thu, 25 Jun 1998 21:23:40 +0200 (CEST)
Ok, this took me four days, because I had never even used dejagnu before,
but here is a patch for a fix that belongs on the egcs side.
This patch is independant on the version of dejagnu (it will always work),
but it is *needed* with dejagnu-980528.
You will ALSO need to patch dejagnu with H.J. Lu's lookfor_dir_with_trigger
patch.
----
Motivation
The first hunk resets `ld_library_path', otherwise the (same) path is
appended to it every test executable, possibly causing an overflow of
the environment variable (apart from that it is stupid to make a search
path of many times the same directory being repeated).
The two hunks in libstdc++.exp change two things: The actual bug fix
is adding the "global ld_library_path", otherwise we are just setting
a local variable here. Setting the environment variables is not needed
anymore then: dejagnu sets the environment variables, using the global
ld_library_path. The reason that dejagnu-980528 stopped working is
that it does unset the environment variables now, directly after execution
of a test executable.
Changing the regular expression " -lstdc.*" into " -lstdc.." doesn't really
fix anything, but it is what the comment says it does. Using ".*" might
in the future break something because it removes everything that comes
after -lstdc++ too.
----
<date> Carlo Wood <carlo@runaway.xs4all.nl>
* lib/libio.exp (test_libio): Reset ld_library_path before appending
the same path(s) again.
* lib/libstdc++.exp: Use global variable ld_library_path (not local)
that is a lot more persistent; dejagnu-980528 needs this.
* lib/libstdc++.exp (test_stdc++): Use regular expression " -lstdc.."
to remove -lstdc++ arguments (not " -lstdc.*").
----
Index: libio/testsuite/lib/libio.exp
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libio/testsuite/lib/libio.exp,v
retrieving revision 1.3
diff -c -p -r1.3 libio.exp
*** libio.exp 1997/12/11 18:46:55 1.3
--- libio.exp 1998/06/25 18:56:45
*************** proc test_libio { srcfile compile_args i
*** 48,60 ****
global LIBIO
global srcdir subdir objdir
global TOOL_OPTIONS
! global wrapper_file wrap_compile_flags;
if { $inpfile != "" } {
set inpfile "$srcdir/../tests/$inpfile"
}
set args ""
lappend args "additional_flags=-O3";
lappend args "additional_flags=-I.. -I$srcdir/.."
lappend args "additional_flags=$wrap_compile_flags";
--- 48,62 ----
global LIBIO
global srcdir subdir objdir
global TOOL_OPTIONS
! global wrapper_file wrap_compile_flags
! global ld_library_path
if { $inpfile != "" } {
set inpfile "$srcdir/../tests/$inpfile"
}
set args ""
+ set ld_library_path ""
lappend args "additional_flags=-O3";
lappend args "additional_flags=-I.. -I$srcdir/.."
lappend args "additional_flags=$wrap_compile_flags";
Index: libstdc++/testsuite/lib/libstdc++.exp
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/testsuite/lib/libstdc++.exp,v
retrieving revision 1.3
diff -c -p -r1.3 libstdc++.exp
*** libstdc++.exp 1997/12/24 23:29:39 1.3
--- libstdc++.exp 1998/06/25 18:57:15
*************** proc test_libstdc++ { options srcfile co
*** 56,61 ****
--- 56,62 ----
global LIBSTDCPP
global srcdir subdir objdir
global TOOL_OPTIONS
+ global ld_library_path
if [info exists LIBSTDCPP] {
set libstdcpp $LIBSTDCPP;
*************** proc test_libstdc++ { options srcfile co
*** 81,95 ****
regsub -all -- "-L" $libstdcpp "" ld_library_path
# Then remove any -lstdc++ argument.
! regsub -all -- " -lstdc.*" $ld_library_path "" ld_library_path
# That's enough to make things work for the normal case.
# If we wanted to handle an arbitrary value of libstdcpp,
# then we'd have to do a lot more work.
- # Set variables the dynamic linker looks at.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
if { $compile_args != "" } {
lappend args "additional_flags=$compile_args"
}
--- 82,93 ----
regsub -all -- "-L" $libstdcpp "" ld_library_path
# Then remove any -lstdc++ argument.
! regsub -all -- " -lstdc.." $ld_library_path "" ld_library_path
# That's enough to make things work for the normal case.
# If we wanted to handle an arbitrary value of libstdcpp,
# then we'd have to do a lot more work.
if { $compile_args != "" } {
lappend args "additional_flags=$compile_args"
}