[RFA] testsuite: Avoid auto-import warning on cygwin/mingw

Pierre Muller
2009-10-01T22:09:33Z

Several tests fail on cygwin
because of:
gdb compile failed,
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin
/bin/ld: warning: auto-importing has been activated without
--enable-auto-import
specified on the command line.
This should work unless it involves constant data structures referencing
symbols
from auto-imported DLLs.Info: resolving _sg by linking to __imp__sg
(auto-impor
t)
UNTESTED: gdb.base/shlib-call.exp: Could not compile
/usr/local/src/gdbcvs/build
-normal/gdb/testsuite/gdb.base/shr1.sl,
/usr/local/src/gdbcvs/build-normal/gdb/t
estsuite/gdb.base/shr2.sl, or ../../../src/gdb/testsuite/gdb.base/shmain.c.

Adding --enable-auto-import to link stage
fixes this problem.

Is this OK?

Pierre Muller
Pascal language support maintainer for GDB

2009-10-02 Pierre Muller <muller@ics.u-strasbg.fr>

* lib/gdb.exp (gdb_compile): Add --enable-auto-import option for
mingw and cygwin targets.

Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.119
diff -u -p -r1.119 gdb.exp
--- lib/gdb.exp 13 Jul 2009 19:24:18 -0000 1.119
+++ lib/gdb.exp 1 Oct 2009 22:03:25 -0000
@@ -1731,7 +1731,10 @@ proc gdb_compile {source dest type optio
lappend options "additional_flags=-L${outdir}"
} elseif { [istarget "mips-sgi-irix*"] } {
lappend options "additional_flags=-rpath ${outdir}"
- }
+ } elseif { ([istarget "*-*-mingw*"]
+ || [istarget *-*-cygwin*]) } {
+ lappend new_options
"additional_flags=-Wl,--enable-auto-import"
+ }
}
} elseif { $opt == "shlib_load" } {
if { ([istarget "*-*-mingw*"]