emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone building Emacs trunk with MinGW w64 (32 bits)


From: rzl24ozi
Subject: Re: Anyone building Emacs trunk with MinGW w64 (32 bits)
Date: Wed, 27 Mar 2013 00:48:58 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

> Thanks.  But what does it mean "on Cygwin" in this context?  If you
> are building with the MinGW64 tools, what Cygwin has got to do with
> this?

It mean that I use MinGW64 tools on Cygwin shell.
I think Cygwin is not important.

>  --- ./nt/addpm.c.orig        2013-03-26 17:33:23.000000000 +0900
>  +++ ./nt/addpm.c     2013-03-26 21:46:23.405698700 +0900
>  @@ -34,15 +34,17 @@
    :
> What was wrong with the original code, and why did you need to move
> the definition of _WIN32_IE further down?  What error messages did you
> see with the original code?

Because _W64 is defined after include MinGW64 header.

>   --- ./nt/configure.bat.orig 2013-03-26 22:06:16.528698700 +0900
>   +++ ./nt/configure.bat      2013-03-26 22:06:16.492698700 +0900
>   @@ -479,10 +479,10 @@
    :
> What was wrong with the original gcc commands?

"-mtune=pentium4" cause an error in 64bit gcc, like
"hello.c:1:0: error: CPU you selected does not support x86-64 instruction set"

If "-mtune=pentium4" is failed configure.bat use "-mcpu=i686" instead,
but it cause gcc warnig like
"gcc.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead"

>   #ifdef _W64
>   /* MinGW64 specific stuff.  */
>  -#define USE_NO_MINGW_SETJMP_TWO_ARGS 1
>   /* Make sure 'struct timespec' and 'struct timezone' are defined.  */
>   #include <sys/types.h>
>  +#include <sys/stat.h>
>   #include <time.h>
>  +#ifdef WIN64
>  +#define _start __start
>  +#endif
>   #endif
>
>   #ifdef _MSC_VER
>
> Please explain why these changes to ms-w32.h were needed.

If USE_NO_MINGW_SETJMP_TWO_ARGS is defined, it seems that emacs crash
when byte-compile. I do not know what happened in this case exactly,
sorry.

In ms-w32.h, some functions are defined to sys_...,
such as chmod -> sys_chmod.
if it is defined before "#include <sys/stat.h>",
functions in sys/stat.h are changed.
It cause warning like "warning: 'sys_chmod' redeclared without
dllimport...", I think. so I include it here.

__start is entry point that specified by linker option in makefile,
but 64bit gcc does not add '_' to symbol, so change _start to
__start.

>   --- ./nt/inc/sys/time.h.orig        2013-03-26 17:33:23.000000000 +0900
>   +++ ./nt/inc/sys/time.h     2013-03-26 21:46:23.425698700 +0900
    :
> This breaks the MinGW32 build, so please see if the current trunk has
> a better solution for this problem.

I understand.

>     --- ./src/image.c.orig    2013-03-24 18:16:45.000000000 +0900
>     +++ ./src/image.c 2013-03-26 21:46:23.437698700 +0900
>     @@ -5545,6 +5545,9 @@
>        png_byte **rows;
>      };
>
>     +#ifdef _W64
>     +#define _setjmp setjmp
>     +#endif
>
> Why is this needed?

In image.c, _setjmp() is used with 1 arg. It seems that some compile error.
This is also related to the following.

>   --- ./src/lisp.h.orig       2013-03-25 12:31:37.000000000 +0900
>   +++ ./src/lisp.h    2013-03-26 21:46:23.442698700 +0900
>   @@ -2164,7 +2164,11 @@
>
>    #ifdef HAVE__SETJMP
>    typedef jmp_buf sys_jmp_buf;
>   +#ifdef _W64
>   +# define sys_setjmp(j) setjmp (j)
>   +#else
>    # define sys_setjmp(j) _setjmp (j)
>   +#endif
>    # define sys_longjmp(j, v) _longjmp (j, v)
>
> And this?

If USE_NO_MINGW_SETJMP_TWO_ARGS is not defined,
it seems that _setjmp() need 2 args (see mingw-w64's setjmp.h).
so I change this.

Sorry for my poor english. I'm not english native.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]