* [RFA] Handle unsupported "-shared" in gdb1555.exp test
@ 2004-02-25 4:58 Fred Fish
2004-02-25 5:19 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Fred Fish @ 2004-02-25 4:58 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
There are 8 gdb tests that attempt to create a shared file using the
"-shared" option:
gdb.base/gdb1555.exp
gdb.base/pending.exp
gdb.base/shlib-call.exp
gdb.base/shreloc.exp:51
gdb.base/so-impl-ld.exp
gdb.base/so-indr-cl.exp
gdb.base/solib.exp:101
gdb.threads/tls-shared.exp
All of them, with the exception of gdb1555.exp and tls-shared.exp,
first do some test to see if this is expected to work for the target.
The shreloc.exp test uses:
if {[istarget *-elf*] || [istarget *-coff] || [istarget *-aout]} then {
verbose "test skipped - shared object files not supported by this target."
return 0
}
The tls-shared.exp test actually tries to run the compile, but it uses
a special version of gdb_compile that doesn't pass on a link failure
to the user output.
The rest of the tests use:
# are we on a target board?
if ![isnative] then {
return 0
}
Since gdb1555.exp does nothing to avoid or hide link failures with
-shared the following type of message can appear in the user output
for targets where -shared isn't supported, such as sh-elf:
Running /src/sourceware/gdb/src/gdb/testsuite/gdb.base/gdb1555.exp ...
gdb compile failed, /links1/usr/local/sourceware/bin/../lib/gcc/sh-elf/3.5.0/../../../../sh-elf/bin/ld: warning: cannot find entry symbol start; defaulting to 0000000000001038
I propose that the gdb1555.exp test use the "isnative" check.
Attached is a patch for review and comment.
-Fred
2004-02-24 Fred Fish <fnf@redhat.com>
* gdb.base/gdb1555.exp: Skip test if not a native target.
Index: gdb.base/gdb1555.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/gdb1555.exp,v
retrieving revision 1.1
diff -c -p -r1.1 gdb1555.exp
*** gdb.base/gdb1555.exp 18 Feb 2004 03:35:08 -0000 1.1
--- gdb.base/gdb1555.exp 25 Feb 2004 04:40:38 -0000
*************** if $tracelevel then {
*** 25,30 ****
--- 25,35 ----
strace $tracelevel
}
+ # are we on a target board?
+ if ![isnative] then {
+ return 0
+ }
+
set testfile gdb1555-main
set libfile gdb1555
set srcfile ${testfile}.c
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] Handle unsupported "-shared" in gdb1555.exp test
2004-02-25 4:58 [RFA] Handle unsupported "-shared" in gdb1555.exp test Fred Fish
@ 2004-02-25 5:19 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2004-02-25 5:19 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
On Tue, Feb 24, 2004 at 09:57:59PM -0700, Fred Fish wrote:
> There are 8 gdb tests that attempt to create a shared file using the
> "-shared" option:
>
> gdb.base/gdb1555.exp
> gdb.base/pending.exp
> gdb.base/shlib-call.exp
> gdb.base/shreloc.exp:51
> gdb.base/so-impl-ld.exp
> gdb.base/so-indr-cl.exp
> gdb.base/solib.exp:101
> gdb.threads/tls-shared.exp
>
> All of them, with the exception of gdb1555.exp and tls-shared.exp,
> first do some test to see if this is expected to work for the target.
This suggests that we need code in lib/gdb.exp to:
- check whether shared library tests should be run
- build shared libraries
> I propose that the gdb1555.exp test use the "isnative" check.
> Attached is a patch for review and comment.
Please don't. I run cross-debugger tests which should test shared
library support on a regular basis. I know this disagrees with prior
art in the testsuite, but I would prefer not to propogate it further.
How about something like:
proc gdb_compile_solib { whatever } {
if {[istarget whatever]} {
return -1
}
whatever
}
and using that to issue an unsupported (or silently return, I don't
know which is the accepted practice).
An alternative would be inclusive lists: {[istarget *-*-linux*] ||
[istarget *-*-bsd*] || ...} and so on as we teach the function how to
build shared libraries in different settings. This might be the best
idea.
It is at this point that in any conversation about building shared
librares that someone should normally suggest making the testsuite use
libtool. I give advance warning that I will do my worst to anyone who
makes such a suggestion. Libtool is a disgusting pile of dung. That's
my opinion and I'll stand by it.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-25 5:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 4:58 [RFA] Handle unsupported "-shared" in gdb1555.exp test Fred Fish
2004-02-25 5:19 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox