This is the mail archive of the cygwin-patches mailing list for the Cygwin 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]

[PATCH] utils: force static linkage


Last time I checked, we were linking all utils statically, so this
caught me by surprise:

$ /bin/ldd dumper.exe 
	ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x77d70000)
	kernel32.dll => /cygdrive/c/Windows/syswow64/kernel32.dll (0x75a50000)
	KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll (0x76ef0000)
	cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
	cygintl-8.dll => /usr/bin/cygintl-8.dll (0x49bd0000)
	cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x6bfb0000)
	??? => ??? (0x550000)

The -static flag implies -static-libgcc (see gcc -dumpspecs) and affects
all other libraries (including libstdc++).  Patch for HEAD attached.


Yaakov
2013-02-20  Yaakov Selkowitz  <yselkowitz@...>

	* Makefile.in (CYGWIN_LDFLAGS): Replace -static-lib* with -static.
	(MINGW_LDFLAGS): Ditto.
	(ZLIB): Simplify accordingly.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/utils/Makefile.in,v
retrieving revision 1.109
diff -u -p -r1.109 Makefile.in
--- Makefile.in	21 Jan 2013 16:28:27 -0000	1.109
+++ Makefile.in	20 Feb 2013 21:19:54 -0000
@@ -49,7 +49,7 @@ EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
 .PHONY: all install clean realclean warn_dumper warn_cygcheck_zlib
 
 LDLIBS := -lnetapi32 -ladvapi32 -lkernel32 -luser32
-CYGWIN_LDFLAGS := -static-libgcc -static-libstdc++ -Wl,--enable-auto-import -L${WINDOWS_LIBDIR} $(LDLIBS)
+CYGWIN_LDFLAGS := -static -Wl,--enable-auto-import -L${WINDOWS_LIBDIR} $(LDLIBS)
 DEP_LDLIBS := $(cygwin_build)/libcygwin.a
 
 MINGW_CXX      := @MINGW_CXX@
@@ -67,10 +67,10 @@ MINGW_BINS := ${addsuffix .exe,cygcheck 
 # list will will be compiled in Cygwin mode implicitly, so there is no
 # need for a CYGWIN_OBJS.
 MINGW_OBJS := bloda.o cygcheck.o dump_setup.o ldh.o path.o strace.o
-MINGW_LDFLAGS:=-L${WINDOWS_LIBDIR} -static-libgcc -static-libstdc++
+MINGW_LDFLAGS:=-L${WINDOWS_LIBDIR} -static
 
 CYGCHECK_OBJS:=cygcheck.o bloda.o path.o dump_setup.o
-ZLIB:=-Wl,-dn,-lz,-dy
+ZLIB:=-lz
 
 .PHONY: all
 all:

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