RFA: cygwin-specific patch for collect2 and cygwin-specs

Charles S. Wilson cwilson@ece.gatech.edu
Tue May 16 23:31:00 GMT 2000


Since ld is capable of linking directly to dll's without an importlib,
these patches enable those features to be used by gcc more conveniently
on the cygwin platform. Patch pasted in both plaintext and
gzip/uuencoded format below.

Aside: binutils recently accepted a patch that makes 'ld.exe -Bdynamic'
hunt for .dll's in preference to .a's for linking (for i386pe). So, with
this patch to gcc, on the cygwin platform, gcc will link to dll's by
default, unless the -static option is given. This brings cygwin-gcc more
in line with most other platforms.

CHANGELOG:

	* gcc/config/i386/cygwin.h: change link spec to
	pass -Bstatic or -Bdynamic to ld as appropriate
	* gcc/collect2.c: add "dll" to the list of possible
	library extensions



----------------------------------snip----------------------
diff -u gcc-2.95.2-orig/gcc/config/i386/cygwin.h
gcc-2.95.2/gcc/config/i386/cygwin.h
--- gcc-2.95.2-orig/gcc/config/i386/cygwin.h    Wed May 17 00:54:19 2000
+++ gcc-2.95.2/gcc/config/i386/cygwin.h Wed May 17 00:58:48 2000
@@ -125,7 +125,9 @@
                   %{shared: --shared} %{mdll:--dll} \
                   %{shared|mdll: -e \
                     %{mno-cygwin:_DllMainCRTStartup@12} \
-                    %{!mno-cygwin:__cygwin_dll_entry@12}}"
+                    %{!mno-cygwin:__cygwin_dll_entry@12}} \
+                       %{static:-Bstatic} \
+                       %{!static:-Bdynamic}"
 
 
 #define SIZE_TYPE "unsigned int"
diff -u gcc-2.95.2-orig/gcc/collect2.c gcc-2.96.2/gcc/collect2.c
--- gcc-2.95.2-orig/gcc/collect2.c      Sun May 14 22:44:18 2000
+++ gcc-2.95.2/gcc/collect2.c   Sun May 14 22:40:57 2000
@@ -260,7 +260,7 @@
 static struct path_prefix libpath_lib_dirs; /* directories in LIBPATH
*/
 static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
                                          &libpath_lib_dirs, NULL};
-static char *libexts[3] = {"a", "so", NULL};  /* possible library
extentions */
+static char *libexts[4] = {"a", "so", "dll", NULL};  /* possible
library extentions */
 #endif
 
 void error             PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
----------------------------------snip----------------------


begin 664 gcc-2.95.2-cygwin.patch.gz
M'XL(""<J(CD``V=C8RUP871C:`"54_UOVC`0_3GY*ZZI5K4$)R'E,V@296,:
M$FT1I)OVI2A-#%@*#G+,5M3QO^],2%JA%;6*E#OGGM^=_5YB-IL!6<,\BHAK
M=1J62U+!YC:N[2CE,TS99;MI1YOY'\:MQ3/@BQB=$/)J0NTKC>$ZW$"M!8[C
M->I>K0.NXSBZ:9JOZ79(T/;J[9R@UP-2<QO5%I@J=*#7TT'3`.#=8[8(!8T]
M("3/MOAM&2>)1PB^M_#S`/EW5P1"RXJJ+7E*\CF\X&.27(>,?YCX4QD*N5[U
M:J[B(27ZY#D\R),`:0/*I=@H^-;0S;?`D1[Q&@XI0\DBC_3SY*EP4E;B#0^7
M6#)T4,]I3&>,4Y@.OP\"_]MX`,::9VS.\389EX8>'W5&DM!(NE94E)NE0D7E
MB`L*B#9=\URZ.KBN5T?MVT>T?VD;BMYZ4MQM.DKQ/"C%\QO`(-:1A%4H%\%*
MX.$?(&'WNR7&(&8BZX)=`4RP#4Y+,[P(&`W[XRO_,U3L8TR5/57VX_(7O(?'
MLPC]@M=;4E>5:S2E[=EAURK<W(U&VZY.]OP1.F['2!]D06B$1A6,+#4*-*A9
M5VF6L?N$JI.(4&P`=Z`[6,HS-;#Y7\+Z(:&!IGH3+YQ2CO90-OJ=LABH$*G0
MM/&7\>36OST_Q]\TD_NN5;`LZ^("KGQ_,NS?^8-@/!G>^)^"6E?_!Z_4B-=]
#!```
`
end


More information about the Gcc-patches mailing list