From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Anyone building Emacs trunk with MinGW w64 (32 bits) Date: Mon, 25 Mar 2013 22:30:33 +0100 Message-ID: <8738vjcgli.fsf@wanadoo.es> References: <87zjxumbjf.fsf@wanadoo.es> <83vc8f1t0x.fsf@gnu.org> <87sj3jcr6t.fsf@wanadoo.es> <86zjxrs4jm.fsf@gmail.com> <87k3ovcn1r.fsf@wanadoo.es> <87fvzjcles.fsf@wanadoo.es> <83boa71a0u.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364247062 17917 80.91.229.3 (25 Mar 2013 21:31:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Mar 2013 21:31:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 25 22:31:25 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UKEzC-0002Y1-8u for ged-emacs-devel@m.gmane.org; Mon, 25 Mar 2013 22:31:22 +0100 Original-Received: from localhost ([::1]:36099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKEyo-0003Pi-6Z for ged-emacs-devel@m.gmane.org; Mon, 25 Mar 2013 17:30:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKEye-0003PM-BI for emacs-devel@gnu.org; Mon, 25 Mar 2013 17:30:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKEyc-00051E-2K for emacs-devel@gnu.org; Mon, 25 Mar 2013 17:30:48 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKEyb-00050t-NQ for emacs-devel@gnu.org; Mon, 25 Mar 2013 17:30:45 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UKEyw-0002EV-T3 for emacs-devel@gnu.org; Mon, 25 Mar 2013 22:31:06 +0100 Original-Received: from 87.red-88-15-56.dynamicip.rima-tde.net ([88.15.56.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Mar 2013 22:31:06 +0100 Original-Received: from ofv by 87.red-88-15-56.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Mar 2013 22:31:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 170 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 87.red-88-15-56.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:dxRmVr54WJZFOFsdKFwCaH+7sL8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158171 Archived-At: Eli Zaretskii writes: >> I have no time for investigating why the linker searches for lstat and >> fstatat as if they were dllimports and ignores those defined in w32.c. > > Try removing _CRTIMP from the prototypes in nt/inc/sys/stat.h. Yep, it works. >> -#define _WIN32_IE 0x400 >> +/* c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 */ >> +/* 4-mingw32/include/shlguid.h:16:2: error: #error _WIN32_IE setting conflicts */ >> +/* #define _WIN32_IE 0x400 */ > > Please show the relevant parts of shlguid.h. #ifndef _WIN32_IE #define _WIN32_IE 0x0501 #else /* FIXME: This really must be 0x0501 !!! */ #if (_WIN32_IE < 0x0500) #error _WIN32_IE setting conflicts #endif #endif >> --- a/nt/inc/ms-w32.h >> +++ b/nt/inc/ms-w32.h >> @@ -154,7 +154,7 @@ extern char *getenv (); >> >> #ifdef emacs >> >> -#ifdef _MSC_VER >> +#if 1 >> #include >> #include >> #include > > What was the problem here? gcc -o oo-spd/i386/temacs.bin -gdwarf-2 -g3 -Lc:/apps/GnuWin32/lib -Wl,-stack ,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-subsystem,conso le -Wl,-entry,__start -Wl,-Map,oo-spd/i386/temacs.map oo-spd/i386/firstfile.o oo -spd/i386/emacs.res oo-spd/i386/temacs0.a oo-spd/i386/temacs1.a oo-spd/i386/tema cs2.a oo-spd/i386/lastfile.a ../lib/oo-spd/i386/libgnu.a -lwinmm -ladvapi32 -lgd i32 -lcomdlg32 -luser32 -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10 c:/apps/msys/1.0/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 4-mingw32/lib/../lib/libmingwex.a(lib32_libmingwex_a-_fstat.o): In function `fst at': /home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/stdio/_fstat.c:11: multiple de finition of `fstat' oo-spd/i386/temacs1.a(w32.o):D:\dev\emacs\emacs\src/w32.c:4320: first defined he re oo-spd/i386/temacs1.a(fileio.o): In function `Fset_file_modes': D:\dev\emacs\emacs\src/fileio.c:3237: undefined reference to `_imp__sys_chmod' >> --- a/nt/inc/sys/time.h >> +++ b/nt/inc/sys/time.h >> @@ -6,6 +6,10 @@ >> * have the below stuff. >> */ >> >> +#include >> +#include >> + >> +#ifndef _TIMESPEC_DEFINED >> struct timeval >> { >> long tv_sec; /* seconds */ >> @@ -17,6 +21,7 @@ struct timezone >> int tz_minuteswest; /* minutes west of Greenwich */ >> int tz_dsttime; /* type of dst correction */ >> }; >> +#endif > > And here? Avoid redefinition of timeval. The inclusion of sys/types.h is to ensure that _TIMESPEC_DEFINED is defined. is for bringing in MinGW64's timeval. There are files that includes just nt/inc/sys/time.h for timeval (hence #include is required), others that include too for other purposes (hence removing the #if _TIMESPEC_DEFINED is required for avoiding redefinition.) >> /* MinGW64 defines 'struct itimerval' and _TIMESPEC_DEFINED in sys/types.h. */ >> -#ifndef _TIMESPEC_DEFINED >> +// #ifndef _TIMESPEC_DEFINED >> struct itimerval >> { >> struct timeval it_interval; /* timer interval */ >> struct timeval it_value; /* current value */ >> }; >> -#endif >> +// #endif > > What's wrong with the #ifndef here? MinGW64 does not define itimerval. >> +/* w32.c:2392:1: error: conflicting types for 'gettimeofday' */ >> +/* In file included from w32.c:32:0: */ >> +/* ../nt/inc/sys/time.h:25:6: note: previous declaration of 'gettimeofday' was here */ >> >> /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ >> -void >> -gettimeofday (struct timeval *tv, struct timezone *tz) > > That's not the right solution. There's no conflict between w32.c and > nt/inc/sys/time.h in how they declare/define gettimeofday. The reason > must be something else, like the order of definition of the relevant > structures. Presumably, by the time the prototype in time.h is seen, > one or both of the types of its arguments are not yet defined. Please > look deeper. Okay. >> --- a/src/w32term.c >> +++ b/src/w32term.c >> @@ -109,7 +109,7 @@ struct w32_display_info *x_display_list; >> Lisp_Object w32_display_name_list; >> >> >> -#if _WIN32_WINNT < 0x0500 >> +#if 0 // _WIN32_WINNT < 0x0500 >> /* Pre Windows 2000, this was not available, but define it here so >> that Emacs compiled on such a platform will run on newer versions. */ > > What's the problem here? The enclosed definitions already are on MinGW64's headers, apparently without the _WIN32_WINNT condition: gcc -I. -c -gdwarf-2 -g3 -mtune=pentium4 -O2 -isystemc:/apps/GnuWin32/includ e -Demacs=1 -I../lib -I../nt/inc -DUSE_CRT_DLL=1 -o oo-spd/i386/w32term.o w32ter m.c w32term.c:116:16: error: redefinition of 'struct tagWCRANGE' In file included from c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7 .2/../../../../i686-w64-mingw32/include/windows.h:61:0, from w32gui.h:21, from w32term.h:21, from w32term.c:25: c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 4-mingw32/include/wingdi.h:2536:18: note: originally defined here w32term.c:120:3: error: conflicting types for 'WCRANGE' In file included from c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7 .2/../../../../i686-w64-mingw32/include/windows.h:61:0, from w32gui.h:21, from w32term.h:21, from w32term.c:25: c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 4-mingw32/include/wingdi.h:2539:5: note: previous declaration of 'WCRANGE' was h ere w32term.c:122:16: error: redefinition of 'struct tagGLYPHSET' In file included from c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7 .2/../../../../i686-w64-mingw32/include/windows.h:61:0, from w32gui.h:21, from w32term.h:21, from w32term.c:25: c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 4-mingw32/include/wingdi.h:2541:18: note: originally defined here w32term.c:129:3: error: conflicting types for 'GLYPHSET' In file included from c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7 .2/../../../../i686-w64-mingw32/include/windows.h:61:0, from w32gui.h:21, from w32term.h:21, from w32term.c:25: c:\apps\msys\1.0\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w6 4-mingw32/include/wingdi.h:2547:5: note: previous declaration of 'GLYPHSET' was here mingw32-make[1]: *** [oo-spd/i386/w32term.o] Error 1