This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: Use `gdb_compile' instead of `target_link' for linking asm-source testcase
Corinna Vinschen <vinschen@redhat.com> writes:
> On Thu, Dec 20, 2001 at 08:53:12AM -0500, Fernando Nasser wrote:
> > Corinna Vinschen wrote:
> > >
> > > On Tue, Dec 18, 2001 at 01:38:20PM -0500, Fernando Nasser wrote:
> > > > This looks reasonable to me.
> > > >
> > > > Fernando
> > >
> > > Since there's no further discussion or any complaints, does that mean
> > > the patch is ok and approved?
> > >
> >
> > Yes. Thanks.
>
> Thanks, applied.
Unfortunately this breaks the test on FreeBSD 4.4.
gdb_compile automatically links against libc, and on FreeBSD that
makes the link fail since libc depends on certain symbols in crt0.o,
which we don't link in because of -nostartfiles. Adding -nostdlib
isn't an option since gdb_compile also adds -lm which depends on
libc. Removing -nostartfiles isn't an option either since it would
result in confilicting symbols.
Instead of reverting Corrina's patch, we could add "-static" to
ldflags (see the attached patch).
Opinions?
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.asm/asm-source.exp: Add ldflags=-static for gdb_compile.
Index: testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.16
diff -u -p -r1.16 asm-source.exp
--- testsuite/gdb.asm/asm-source.exp 2001/12/20 22:12:20 1.16
+++ testsuite/gdb.asm/asm-source.exp 2001/12/27 14:27:51
@@ -81,7 +81,7 @@ if {[target_assemble ${src2} asmsrc2.o "
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-set opts "debug ldflags=-nostartfiles"
+set opts "debug ldflags=-nostartfiles ldflags=-static"
foreach i ${link-flags} {
append opts " ldflags=$i"
}