This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: On cygwin: FAIL: linking auto-import client using a standard import library


Nick Clifton escreveu:
Hi Christian,

When running the ld testsuite from today's binutils snapshot, I get a
failure like this:

/usr/local/src/trunk/objdir-binutils/ld/ld-new -o
tmpdir/client-linklib.exe --enable-auto-import
--enable-runtime-pseudo-reloc /lib/crt0.o tmpdir/client.o -Ltmpdir
-lstandard -L/usr/lib -lcygwin -L/usr/lib/w32api -lkernel32
/usr/local/src/trunk/objdir-binutils/ld/.libs/ld-new: cannot find -lstandard
FAIL: linking auto-import client using a standard import library

Is this still happening ? (I do not have easy access to a cygwin environment to check for myself).


If it is, please can you check to see if the problem was introduced on
2006-12-18 ? (I am just guessing here, not accusing anyone. But that appears to be the last time that the library recognition code was tweaked).



I doubt that. The import lib really isn't being generated, so it's natural that ld can't find it.

The test should be invoking ld to link, via ld_special_link, but for
some reason, it's passing $CC, which results in this:

gcc -v -shared --enable-auto-import --out-implib=tmpdir/libstandard.dll.a -o tmpdir/dll.dll tmpdir/dll.o -L/usr/lib -lcygwin -L/usr/lib/w32api -lkernel32

The --out-implib, and --enable-auto-import aren't special, they're not
passed to the linker (read: need -Wl,), so libstandard.dll.a isn't output.

I don't know how that ever worked.  The attached patch fixes that here,
but then I get:
FAIL: application runtime segfault check

:/ the executable didn't run.

Looks like some digging is needed here.

--
Pedro Alves
Index: ld/testsuite/ld-auto-import/auto-import.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-auto-import/auto-import.exp,v
retrieving revision 1.4
diff -u -p -r1.4 auto-import.exp
--- ld/testsuite/ld-auto-import/auto-import.exp	2 Oct 2007 12:47:08 -0000	1.4
+++ ld/testsuite/ld-auto-import/auto-import.exp	1 Feb 2008 03:36:42 -0000
@@ -122,7 +122,7 @@ if [istarget *-pc-cygwin] {
     if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/dll.c $tmpdir/dll.o] {
 	fail "compiling shared lib"
     }
-    if ![ld_special_link "$CC -shared --enable-auto-import --out-implib=$tmpdir/libstandard.dll.a" $tmpdir/dll.dll "$tmpdir/dll.o $MYLIBS"] {
+    if ![ld_special_link "$ld -shared --enable-auto-import --out-implib=$tmpdir/libstandard.dll.a" $tmpdir/dll.dll "$tmpdir/dll.o $MYLIBS"] {
 	fail "linking shared lib"
     }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]