Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-11-28 07:22:36 +0400
committerChristopher Faylor <me@cgf.cx>2012-11-28 07:22:36 +0400
commit29413f0630f13279a938d68c11a36e8c137538f5 (patch)
treede741a514c3719ede7ecf7afbba4de1e0f3e6768 /winsup/utils
parent66444a6b4036ddd31483c106ad9854e24a3ed76a (diff)
* Makefile.in: Move CFLAGS and CXXFLAGS so that they can be manipulated by
Makefile.common. Add -static-libstdc++ to *LDFLAGS. Add dependencies for loadlib.h. * loadlib.h: Update copyright. (_load_sys_library): Properly define set_dll_library as WINAPI to avoid stack corruption.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog9
-rw-r--r--winsup/utils/Makefile.in16
-rw-r--r--winsup/utils/loadlib.h8
3 files changed, 22 insertions, 11 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 1ad1a1b2e..85f82c2ee 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,5 +1,14 @@
2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx>
+ * Makefile.in: Move CFLAGS and CXXFLAGS so that they can be manipulated
+ by Makefile.common. Add -static-libstdc++ to *LDFLAGS. Add
+ dependencies for loadlib.h.
+ * loadlib.h: Update copyright.
+ (_load_sys_library): Properly define set_dll_library as WINAPI to avoid
+ stack corruption.
+
+2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx>
+
* Makefile.in (ZLIBS): Common define to force static load.
(MINGW_LDFLAGS): Use static libgcc.
diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
index 484b0770f..d9aecad7b 100644
--- a/winsup/utils/Makefile.in
+++ b/winsup/utils/Makefile.in
@@ -16,6 +16,10 @@ configure_args=@configure_args@
export CC:=@CC@
export CXX:=@CXX@
+CFLAGS:=@CFLAGS@
+CXXFLAGS:=@CXXFLAGS@
+override CXXFLAGS+=-fno-exceptions -fno-rtti
+
include ${srcdir}/../Makefile.common
cygwin_build:=${target_builddir}/winsup/cygwin
@@ -42,14 +46,10 @@ override INSTALL_DATA:=@INSTALL_DATA@
EXEEXT:=@EXEEXT@
EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
-CFLAGS:=@CFLAGS@
-CXXFLAGS:=@CXXFLAGS@
-override CXXFLAGS+=-fno-exceptions -fno-rtti -DHAVE_DECL_GETOPT=0
-
.PHONY: all install clean realclean warn_dumper warn_cygcheck_zlib
-LDLIBS := -lnetapi32 -ladvapi32 -lkernel32 -luser32
-CYGWIN_LDFLAGS := -static-libgcc -Wl,--enable-auto-import -L${WINDOWS_LIBDIR} $(LDLIBS)
+LDLIBS := -lnetapi32 -ladvapi32 -lkernel32 -luser32
+CYGWIN_LDFLAGS := -static-libgcc -static-libstdc++ -Wl,--enable-auto-import -L${WINDOWS_LIBDIR} $(LDLIBS)
DEP_LDLIBS := $(cygwin_build)/libcygwin.a
MINGW_CXX := @MINGW_CXX@
@@ -67,7 +67,7 @@ MINGW_BINS := ${addsuffix .exe,cygcheck cygwin-console-helper ldh strace}
# 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
+MINGW_LDFLAGS:=-L${WINDOWS_LIBDIR} -static-libgcc -static-libstdc++
CYGCHECK_OBJS:=cygcheck.o bloda.o path.o dump_setup.o
ZLIB:=-Wl,-dn,-lz,-dy
@@ -152,6 +152,8 @@ $(CYGWIN_BINS): %.exe: %.o
$(MINGW_BINS): $(DEP_LDLIBS)
$(CYGWIN_BINS): $(DEP_LDLIBS)
+cygcheck.o cygpath.o module_info.o path.o ps.o regtool.o strace.o: loadlib.h
+
.PHONY: clean
clean:
rm -f *.o $(CYGWIN_BINS) $(MINGW_BINS) path-testsuite.cc testsuite.exe
diff --git a/winsup/utils/loadlib.h b/winsup/utils/loadlib.h
index b2da8c76d..34ed1277d 100644
--- a/winsup/utils/loadlib.h
+++ b/winsup/utils/loadlib.h
@@ -1,6 +1,6 @@
/* loadlib.h
- Copyright 2010, 2011 Red Hat, Inc.
+ Copyright 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -23,7 +23,7 @@ static HMODULE _load_sys_library (const wchar_t *dll) __attribute__ ((used));
static HMODULE
_load_sys_library (const wchar_t *dll)
{
- static BOOL (*set_dll_directory)(LPCWSTR);
+ static BOOL WINAPI (*set_dll_directory)(LPCWSTR);
static WCHAR sysdir[MAX_PATH];
static UINT sysdir_len;
@@ -39,10 +39,10 @@ _load_sys_library (const wchar_t *dll)
{
HMODULE k32 = GetModuleHandleW (L"kernel32.dll");
if (k32)
- set_dll_directory = (BOOL (*)(LPCWSTR))
+ set_dll_directory = (BOOL WINAPI (*)(LPCWSTR))
GetProcAddress (k32, "SetDllDirectoryW");
if (!set_dll_directory)
- set_dll_directory = (BOOL (*)(LPCWSTR)) -1;
+ set_dll_directory = (BOOL WINAPI (*)(LPCWSTR)) -1;
else
set_dll_directory (L"");
}