* [PATCH/RFC] Fix asm-source.exp on FreeBSD
@ 2003-05-10 11:05 Mark Kettenis
2003-05-10 14:24 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2003-05-10 11:05 UTC (permalink / raw)
To: gdb-patches
Ever since asm-source.exp was changed to do the final link using
gdb_compile, the tests have been failing for me. The problem is that
FreeBSD's crt1.o defines some symbols (__progname, environ) that are
referenced by libc.so, which makes the final link fail. Compiling
statically fixes the problem.
I'm fairly certain that NetBSD and probably OpenBSD suffer from the
same problem, so perhaps I should change the regexp to *-*-*bsd*
instead. Can someone check whether that's indeed the case.
I've been using this patch in my local tree for quite some time now,
so if I don't see any objections in the coming days, I'll check this
in.
Mark
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.asm/asm-source.exp: Make sure the final link succeeds on
FreeBSD.
Index: testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.33
diff -u -p -r1.33 asm-source.exp
--- testsuite/gdb.asm/asm-source.exp 7 May 2003 21:52:53 -0000 1.33
+++ testsuite/gdb.asm/asm-source.exp 10 May 2003 10:55:52 -0000
@@ -99,6 +99,15 @@ if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
+# On FreeBSD, crt1.o the final link will fail because of unresolved
+# symbols. It turns out that libc.so references symbols that are
+# normally provided by crt1.o, which isn't linked in since we specify
+# -nostartfiles. Using -nostdlib doesn't help since target_compile
+# automatically adds -lm. Linking statically avoids this mess.
+if [istarget "*-*-freebsd*"] then {
+ set link-flags "-static"
+}
+
# Watch out, we are invoking the assembler, but the testsuite sets multilib
# switches according to compiler syntax. If we pass these options straight
# to the assembler, they won't always make sense. If we don't pass them to
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] Fix asm-source.exp on FreeBSD
2003-05-10 11:05 [PATCH/RFC] Fix asm-source.exp on FreeBSD Mark Kettenis
@ 2003-05-10 14:24 ` Andrew Cagney
2003-05-30 18:05 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2003-05-10 14:24 UTC (permalink / raw)
To: Mark Kettenis, Michael Snyder; +Cc: gdb-patches
> Ever since asm-source.exp was changed to do the final link using
> gdb_compile, the tests have been failing for me. The problem is that
> FreeBSD's crt1.o defines some symbols (__progname, environ) that are
> referenced by libc.so, which makes the final link fail. Compiling
> statically fixes the problem.
>
> I'm fairly certain that NetBSD and probably OpenBSD suffer from the
> same problem, so perhaps I should change the regexp to *-*-*bsd*
> instead. Can someone check whether that's indeed the case.
>
> I've been using this patch in my local tree for quite some time now,
> so if I don't see any objections in the coming days, I'll check this
> in.
Honestly, I think it should be put back to using the linker directly.
The intent of the test was to exercise the assembler functionality, when
there was no C compiler. I confirmed this with Michael, the testsuite's
author.
I've never had the time to do it though :-(
Andrew
> Index: testsuite/ChangeLog
> from Mark Kettenis <kettenis@gnu.org>
>
> * gdb.asm/asm-source.exp: Make sure the final link succeeds on
> FreeBSD.
>
> Index: testsuite/gdb.asm/asm-source.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
> retrieving revision 1.33
> diff -u -p -r1.33 asm-source.exp
> --- testsuite/gdb.asm/asm-source.exp 7 May 2003 21:52:53 -0000 1.33
> +++ testsuite/gdb.asm/asm-source.exp 10 May 2003 10:55:52 -0000
> @@ -99,6 +99,15 @@ if { "${asm-arch}" == "" } {
> gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
> }
>
> +# On FreeBSD, crt1.o the final link will fail because of unresolved
> +# symbols. It turns out that libc.so references symbols that are
> +# normally provided by crt1.o, which isn't linked in since we specify
> +# -nostartfiles. Using -nostdlib doesn't help since target_compile
> +# automatically adds -lm. Linking statically avoids this mess.
> +if [istarget "*-*-freebsd*"] then {
> + set link-flags "-static"
> +}
> +
> # Watch out, we are invoking the assembler, but the testsuite sets multilib
> # switches according to compiler syntax. If we pass these options straight
> # to the assembler, they won't always make sense. If we don't pass them to
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] Fix asm-source.exp on FreeBSD
2003-05-10 14:24 ` Andrew Cagney
@ 2003-05-30 18:05 ` Mark Kettenis
0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2003-05-30 18:05 UTC (permalink / raw)
To: ac131313; +Cc: msnyder, gdb-patches
Date: Sat, 10 May 2003 09:45:35 -0400
From: Andrew Cagney <ac131313@redhat.com>
> Ever since asm-source.exp was changed to do the final link using
> gdb_compile, the tests have been failing for me. The problem is that
> FreeBSD's crt1.o defines some symbols (__progname, environ) that are
> referenced by libc.so, which makes the final link fail. Compiling
> statically fixes the problem.
>
> I'm fairly certain that NetBSD and probably OpenBSD suffer from the
> same problem, so perhaps I should change the regexp to *-*-*bsd*
> instead. Can someone check whether that's indeed the case.
>
> I've been using this patch in my local tree for quite some time now,
> so if I don't see any objections in the coming days, I'll check this
> in.
Honestly, I think it should be put back to using the linker directly.
The intent of the test was to exercise the assembler functionality, when
there was no C compiler. I confirmed this with Michael, the testsuite's
author.
I've never had the time to do it though :-(
Me neither :-(. Simply reverting to using the linker directly would
probably break quite a few targets. Fixing those problems would mean
making extensive changes to DejaGNU. Therefore I've checked my patch
in as a temporary workaround. These tests are pretty valuable, with
all the new unwinder stuff and such.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-30 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-10 11:05 [PATCH/RFC] Fix asm-source.exp on FreeBSD Mark Kettenis
2003-05-10 14:24 ` Andrew Cagney
2003-05-30 18:05 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox