From e05d3a05bfe8bb14e6f9246d76c7c9134eb101a1 Mon Sep 17 00:00:00 2001 From: Fabrice Popineau Date: Sat, 11 Jan 2014 15:36:06 +0200 Subject: [PATCH] Fix minor build problems related to MinGW64. configure.ac: Read $srcdir/nt/mingw-cfg.site when $MSYSTEM is "MINGW64" as well. nt/inc/ms-w32.h (pthread_sigmask): Undefine if defined, for MinGW64. src/unexw32.c (_start) [__MINGW64__]: Define to __start. --- ChangeLog | 5 +++++ configure.ac | 3 ++- nt/ChangeLog | 4 ++++ nt/inc/ms-w32.h | 5 +++++ src/ChangeLog | 4 ++++ src/unexw32.c | 7 +++++++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6cf2f87391f..436dcdab5cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-01-11 Fabrice Popineau + + * configure.ac: Read $srcdir/nt/mingw-cfg.site when $MSYSTEM is + "MINGW64" as well. + 2014-01-11 Paul Eggert Merge from gnulib, incorporating: diff --git a/configure.ac b/configure.ac index b3d28d1d720..8443d168c7d 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,8 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) AC_INIT(emacs, 24.3.50) -if test "x$MSYSTEM" = "xMINGW32" +dnl We get MINGW64 with MSYS2 +if test "x$MSYSTEM" = "xMINGW32" -o "x$MSYSTEM" = "xMINGW64" then . $srcdir/nt/mingw-cfg.site diff --git a/nt/ChangeLog b/nt/ChangeLog index 52582532fb3..551b973b016 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2014-01-11 Fabrice Popineau + + * inc/ms-w32.h (pthread_sigmask): Undefine if defined, for MinGW64. + 2013-12-31 Fabrice Popineau * inc/ms-w32.h (sys_kill): Fix prototype. diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 7f523cb74f9..dca3476b2b6 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -388,6 +388,11 @@ extern int sigemptyset (sigset_t *); extern int sigaddset (sigset_t *, int); extern int sigfillset (sigset_t *); extern int sigprocmask (int, const sigset_t *, sigset_t *); +/* MinGW64 defines pthread_sigmask as zero in its pthread_signal.h + header, but we have an implementation for that function in w32proc.c. */ +#ifdef pthread_sigmask +#undef pthread_sigmask +#endif extern int pthread_sigmask (int, const sigset_t *, sigset_t *); extern int sigismember (const sigset_t *, int); extern int setpgrp (int, int); diff --git a/src/ChangeLog b/src/ChangeLog index 556fcce5fa5..637164281d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-01-11 Fabrice Popineau + + * unexw32.c (_start) [__MINGW64__]: Define to __start. + 2014-01-11 Eli Zaretskii * xdisp.c (try_window_id): Don't use this function's optimizations diff --git a/src/unexw32.c b/src/unexw32.c index 5411cd2a95c..f70cdd79478 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -85,6 +85,13 @@ DWORD_PTR extra_bss_size_static = 0; PIMAGE_SECTION_HEADER heap_section; +/* MinGW64 doesn't add a leading underscore to external symbols, + whereas configure.ac sets up LD_SWITCH_SYSTEM_TEMACS to force the + entry point at __start, with two underscores. */ +#ifdef __MINGW64__ +#define _start __start +#endif + /* Startup code for running on NT. When we are running as the dumped version, we need to bootstrap our heap and .bss section into our address space before we can actually hand off control to the startup -- 2.39.2