This is the mail archive of the binutils@sourceware.cygnus.com 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]

RFA: cygwin-specific patch for ldfile.c


The following patch to binutils/ld/ldfile.c allows ld to search the
library path for foo.dll and libfoo.dll, prior to searching for
libfoo.a, in response to a '-lfoo' argument if linking is dynamic
(-Bdynamic). This takes advantage of the recent ability of ld to link
against a dll without an explicit import library (that is, generating an
implicit import lib from the dll on-the-fly)

This may also work for MINGW, but I can't test that; for now, I just
guarded the extra code with '#ifdef __CYGWIN__' instead of '#if defined
(__CYGWIN__) || (MINGW)'.

The patch is against binutils-19990818, which is the most recent version
distributed with cygwin. It is pasted below for your perusal, and a
gzipped & uuencoded version is attached as well.

--Chuck Wilson

----------------------snip---------------------
--- ldfile.c.orig       Mon May 15 12:59:05 2000
+++ ldfile.c    Mon May 15 13:34:05 2000
@@ -241,6 +241,18 @@
           arch != (search_arch_type *) NULL;
           arch = arch->next)
        {
+#ifdef __CYGWIN__
+         /* First look for foo.dll, then libfoo.dll */
+         /* This is *before* hunting for libfoo.a, if and only if
-Bdynamic */
+         if (entry->dynamic) {
+                if (ldfile_open_file_search (arch->name, entry, "",
".dll")) {
+                       return;
+                }
+           if (ldfile_open_file_search (arch->name, entry, "lib",
".dll")) {
+             return;
+           }
+         }
+#endif
          if (ldfile_open_file_search (arch->name, entry, "lib", ".a"))
            return;
 #ifdef VMS
----------------------snip------------------------


begin 664 binutils-19990818-ldfile-cygwin.patch.gz
M'XL(""$U(#D``V)I;G5T:6QS+7!A=&-H`)U1R6[",!`])U_Q"A>R&!*6J@6!
MHE9J50FX=%-/42`.L6IL%(S4J.J_UW$"76ZM98_'X_?>>#R$$/`T8YQVUUU9
ML(VUD`*+I$0X0M@?CR['P0C](`ALS_-.T!^HP7@P/*&B"*0_#/US>-467B"*
M;%@`DF*=XVR*SIY6;FR,*G<4KH/EXWP^^8:;FHW,!'U3CHZ_VUZ;92G-$,?7
M+[?/=\LXMCT-[[FX8<5>@4OYBDP6>LENRKD/E5,!SE9-`&[OR'C(V1YZNBNJ
M&=1%?A"*B8WA-XS$!\N0B!12\++RR55:BF3+UD<E'>M0H8J2S)H;!_JAEF5N
MZK^*Y8Z*V'AUW>@TE25;ZL/0?;1:>E6/;#F-A%50=2C$Q,A]F'3XNZRNY;<R
GS/A2KTZUOK9M*E*6F3[\.U>B,]6=/&5!T[NGQ;W]"4AK@0=R`@``
`
end

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