all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* building Emacs on Msys2/mingw32
@ 2014-09-08 15:54 Stephen Leake
  2014-09-08 20:14 ` Óscar Fuentes
  2014-09-09 13:28 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Stephen Leake @ 2014-09-08 15:54 UTC (permalink / raw)
  To: emacs-devel

I've succesfully built Emacs on Msys2/mingw32. After I got some msys2
install issues sorted out, it went quite smoothly; almost as well as a
typical install on a Linxu/gnu box!

Thanks to all who made this possible!


I have suggested changes to the Msys2 people to iron out the Msys2
install issues I had.


To address the "almost" above:

I built from the current pretest tarball,
http://alpha.gnu.org/gnu/emacs/pretest/emacs-24.3.93.tar.xz

I had to override the guessed build machine on the configure line:

    $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32

config.guess returns x86_64-pc-msys; configure rejects this.

x86_64-pc-msys is the correct host identifier, but we will never
actually build an Emacs for that machine; we will always want to build
for i686-pc-mingw32 or x86_64-pc-mingw32.

It might make sense to have configure translate x86_64-pc-msys to
x86_64-pc-mingw32, and i686-pc-msys to i686-pc-mingw32.

I'm not clear what MSYS (as opposed to MSYS2) does about this.

At least, this case should now be mentioned in nt/INSTALL. Here's a
suggested patch:

--- INSTALL	2014-09-08 10:42:54.523175900 -0500
+++ INSTALL.orig	2014-06-04 23:33:18.000000000 -0500
@@ -14,10 +14,10 @@
 
 * For the brave (a.k.a. "impatient"):
 
-  For those who have a working MSYS/MSYS2/MinGW development
-  environment and are comfortable with running Posix configure
-  scripts, here are the concise instructions for configuring and
-  building the native Windows binary of Emacs with these tools:
+  For those who have a working MSYS/MinGW development environment and
+  are comfortable with running Posix configure scripts, here are the
+  concise instructions for configuring and building the native Windows
+  binary of Emacs with these tools:
 
   0. Start the MSYS Bash window.  Everything else below is done from
      that window's Bash prompt.
@@ -41,14 +41,6 @@
 
         ./configure --prefix=PREFIX ...
 
-      - If you are building with MSYS2, you must specify the build machine:
-
-        --build=i686-pc-mingw32
-
-        or
-
-        --build=x86_64-pc-mingw32
-        
      It is always preferable to use --prefix to configure Emacs for
      some specific location of its installed tree; the default
      /usr/local is not suitable for Windows (see the detailed

@@ -83,16 +75,6 @@
   If these short instructions somehow fail, read the rest of this
   file.
 
-* Installing MinGW32 and MSYS2
-
-  Follow the instructions at http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
-
-  Install the compiler, and tar:
-
-  $ pacman -S mingw-w64-i686-toolchain tar
-
-  Follow the instructions above to build emacs.
-  
 * Installing MinGW and MSYS
 
   Make sure you carefully read the following two sections in their

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-08 15:54 Stephen Leake
@ 2014-09-08 20:14 ` Óscar Fuentes
  2014-09-09  5:00   ` Stephen Leake
  2014-09-09 13:28 ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Óscar Fuentes @ 2014-09-08 20:14 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stephen Leake

Stephen Leake <stephen_leake@stephe-leake.org> writes:

[snip]

> I have suggested changes to the Msys2 people to iron out the Msys2
> install issues I had.
>
>
> To address the "almost" above:
>
> I built from the current pretest tarball,
> http://alpha.gnu.org/gnu/emacs/pretest/emacs-24.3.93.tar.xz
>
> I had to override the guessed build machine on the configure line:
>
>     $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32

All this and the remaining removed text is unnecessary if you use
mingw32_shell.bat instead of msys2_shell.bat. There is no need to run
msys2_shell.bat at all unless you want to build MSYS2 packages (not to
be confused with MinGW-w64 packages, which doesn't depend on
msys-2.0.dll.)

BTW, the changes you proposed to MSYS2 intall/update procedure also
insists on running msys2_shell.bat. That's poor advice.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
@ 2014-09-08 21:54 Angelo Graziosi
  2014-09-08 22:53 ` Óscar Fuentes
  2014-09-09 13:42 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Angelo Graziosi @ 2014-09-08 21:54 UTC (permalink / raw)
  To: Emacs developers

Óscar Fuentes wrote:
> All this and the remaining removed text is unnecessary if you use
> mingw32_shell.bat

Hmm... This was what I thought. I build the W64 binaries of Emacs, and I 
DO use mingw64_shell.bat, where:

$ echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/vendor_perl:/usr/bin/core_perl

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-4.9.1/configure --prefix=/mingw64 
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include 
--libexecdir=/mingw64/lib 
--with-gxx-include-dir=/mingw64/include/c++/4.9.1 --enable-bootstrap 
--with-arch=x86-64 --with-tune=generic 
--enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared 
--enable-static --enable-libatomic --enable-threads=posix 
--enable-graphite --enable-fully-dynamic-string 
--enable-libstdcxx-time=yes --disable-libstdcxx-pch 
--disable-libstdcxx-debug --enable-cloog-backend=isl 
--enable-version-specific-runtime-libs --disable-cloog-version-check 
--disable-isl-version-check --enable-lto --enable-libgomp 
--disable-multilib --enable-checking=release --disable-rpath 
--disable-win32-registry --disable-nls --disable-werror 
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 
--with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 
--with-cloog=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' 
--with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as 
--with-gnu-ld
Thread model: posix
gcc version 4.9.1 (Rev3, Built by MSYS2 project)

and I build with

$ ./autogen.sh
$ ./configure --prefix=/Emacs --with-wide-int --build=x86_64-w64-mingw32 
--without-imagemagick 'CFLAGS=-I/mingw64/include/noX -Ofast -g0 -pipe' 
LDFLAGS=-pipe

$ make -j3


If I remove the "--build=x86_64-w64-mingw32" option to configure, the 
build is configure for x86_64-pc-mingw64,

[...]
Configured for `x86_64-pc-mingw64'.

   Where should the build process find the source code?    .
   What compiler should emacs be built with?               gcc 
-std=gnu99  -I/mingw64/include/noX -Ofast -g0 -pipe
   Should Emacs use the GNU version of malloc?             no
     (The GNU allocators don't work with this system configuration.)
   Should Emacs use a relocating allocator for buffers?    no
   Should Emacs use mmap(2) for buffer allocation?         yes
   What window system should Emacs use?                    w32
   What toolkit should Emacs use?                          none
   Where do we find X Windows header files?                NONE
   Where do we find X Windows libraries?                   NONE
   Does Emacs use -lXaw3d?                                 no
   Does Emacs use -lXpm?                                   yes
   Does Emacs use -ljpeg?                                  yes
   Does Emacs use -ltiff?                                  yes
   Does Emacs use a gif library?                           yes
   Does Emacs use a png library?                           yes
   Does Emacs use -lrsvg-2?                                yes
   Does Emacs use imagemagick?                             no
   Does Emacs support sound?                               no
   Does Emacs use -lgpm?                                   no
   Does Emacs use -ldbus?                                  yes
   Does Emacs use -lgconf?                                 no
   Does Emacs use GSettings?                               no
   Does Emacs use a file notification library?             yes (w32)
   Does Emacs use access control lists?                    yes
   Does Emacs use -lselinux?                               no
   Does Emacs use -lgnutls?                                yes
   Does Emacs use -lxml2?                                  yes
   Does Emacs use -lfreetype?                              no
   Does Emacs use -lm17n-flt?                              no
   Does Emacs use -lotf?                                   no
   Does Emacs use -lxft?                                   no
   Does Emacs directly use zlib?                           yes
   Does Emacs use toolkit scroll bars?                     yes
[...]

and 'make -j3' fails at some point.. Instead, with that configure 
option, the build is configure for 'x86_64-w64-mingw32' and it is 
completed successfully...

So, may you explain how you build Emacs on MSYS2?

TIA,
  Angelo.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-08 21:54 building Emacs on Msys2/mingw32 Angelo Graziosi
@ 2014-09-08 22:53 ` Óscar Fuentes
  2014-09-09 13:42 ` Eli Zaretskii
  1 sibling, 0 replies; 16+ messages in thread
From: Óscar Fuentes @ 2014-09-08 22:53 UTC (permalink / raw)
  To: emacs-devel

Angelo Graziosi <angelo.graziosi@alice.it> writes:

> Óscar Fuentes wrote:
>> All this and the remaining removed text is unnecessary if you use
>> mingw32_shell.bat
>
> Hmm... This was what I thought. I build the W64 binaries of Emacs, and
> I DO use mingw64_shell.bat, where:
>

[snip]

> and I build with
>
> $ ./autogen.sh
> $ ./configure --prefix=/Emacs --with-wide-int
> --build=x86_64-w64-mingw32 --without-imagemagick
> 'CFLAGS=-I/mingw64/include/noX -Ofast -g0 -pipe' LDFLAGS=-pipe
>
> $ make -j3
>
>
> If I remove the "--build=x86_64-w64-mingw32" option to configure, the
> build is configure for x86_64-pc-mingw64,
>
> [...]
> Configured for `x86_64-pc-mingw64'.

[snip]

> and 'make -j3' fails at some point.. Instead, with that configure
> option, the build is configure for 'x86_64-w64-mingw32' and it is
> completed successfully...

Either the configure script does not handle the target triple
x86_64-pc-mingw64 correctly, or that target triple is incorrect (IIRC
the target triple is inferred by a script `configure' calls:
build-aux/config.guess.)

> So, may you explain how you build Emacs on MSYS2?

I don't build Emacs 64 bits on Windows, just the 32 bit build (as the OP
does). It works fine without passing any parameter to `configure'.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-08 20:14 ` Óscar Fuentes
@ 2014-09-09  5:00   ` Stephen Leake
  2014-09-09 10:39     ` Chris Zheng
  2014-09-09 13:48     ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Stephen Leake @ 2014-09-09  5:00 UTC (permalink / raw)
  To: emacs-devel

Óscar Fuentes <ofv@wanadoo.es> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
> [snip]
>
>> I have suggested changes to the Msys2 people to iron out the Msys2
>> install issues I had.
>>
>>
>> To address the "almost" above:
>>
>> I built from the current pretest tarball,
>> http://alpha.gnu.org/gnu/emacs/pretest/emacs-24.3.93.tar.xz
>>
>> I had to override the guessed build machine on the configure line:
>>
>>     $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32
>
> All this and the remaining removed text is unnecessary if you use
> mingw32_shell.bat instead of msys2_shell.bat. 

Sigh. I was actually running mingw64_shell.bat, not msys2_shell.bat. I
just got the wrong name in the emails. Thanks for catching this.

However, Emacs configure was run under Emacs, not directly in the
mingw64 shell, which means I was trying to emulate mingw64_shell.bat
with elisp code. So I need to figure out what I got wrong in that
emulation. I don't see anything obvious in the shell/environment
variables. 

On the gripping hand, I just tested configure under mingw64_shell.bat,
and got:

configure: error: Emacs does not support `x86_64-pc-mingw64'. 

Which is fine; we need i686.

So I tried mingw32_shell.bat; that works.

Just to be clear, the default prefix is still /usr/local. But /usr
exists in msys2/mingw32; it is at c:/msys64/usr. So /usr/local is a
reasonable place to install emacs. Except that will mix 32 bit and 64
bit targets; /usr/local/x86_64 and /usr/local/i686 would be better. So I
suggest we keep the advice to specify --prefix.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09  5:00   ` Stephen Leake
@ 2014-09-09 10:39     ` Chris Zheng
  2014-09-09 13:58       ` Stephen Leake
  2014-09-09 13:48     ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Chris Zheng @ 2014-09-09 10:39 UTC (permalink / raw)
  To: stephen_leake; +Cc: emacs-devel

From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: building Emacs on Msys2/mingw32
Date: Tue, 09 Sep 2014 00:00:29 -0500

Hi Stephen,
> Sigh. I was actually running mingw64_shell.bat, not msys2_shell.bat. I
> just got the wrong name in the emails. Thanks for catching this.
> 
> However, Emacs configure was run under Emacs, not directly in the
> mingw64 shell, which means I was trying to emulate mingw64_shell.bat
> with elisp code. So I need to figure out what I got wrong in that
> emulation. I don't see anything obvious in the shell/environment
> variables. 
Sorry, I can't follow the hole discussion.  But if you want to run
./configure under Emacs, say, the in shell-mode, you can add
  export MSYSTEM=MINGW64
to ~/.bashrc, this will complete what mingw64_shell.bat do for the
build.  And this is what I have done.
> On the gripping hand, I just tested configure under mingw64_shell.bat,
> and got:
> 
> configure: error: Emacs does not support `x86_64-pc-mingw64'. 
> 
> Which is fine; we need i686.
> 
> So I tried mingw32_shell.bat; that works.
> 
> Just to be clear, the default prefix is still /usr/local. But /usr
> exists in msys2/mingw32; it is at c:/msys64/usr. So /usr/local is a
> reasonable place to install emacs. Except that will mix 32 bit and 64
> bit targets; /usr/local/x86_64 and /usr/local/i686 would be better. So I
> suggest we keep the advice to specify --prefix.
I personal prefer /mingw32/local and /mingw64/local because: (1) The
/usr is for MSYS2 system, and programs in it will depend on
msys-*.dll, like Cygwin does.  But Emacs was native Windows programs
which doesn't not depend on MSYS2 dlls; (2) /mingw32 and /mingw64 are
unique and don't exist in /usr and other paths; (3) The Emacs you
builded are more likely a MinGW32 or MinGW64 program than a MSYS2
program, so it should come to /mingw32 or /mingw64.

Best wishes,
Chris.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-08 15:54 Stephen Leake
  2014-09-08 20:14 ` Óscar Fuentes
@ 2014-09-09 13:28 ` Eli Zaretskii
  2014-09-09 22:03   ` Stephen Leake
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-09 13:28 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Date: Mon, 08 Sep 2014 10:54:26 -0500
> 
> I had to override the guessed build machine on the configure line:
> 
>     $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32
> 
> config.guess returns x86_64-pc-msys; configure rejects this.
> 
> x86_64-pc-msys is the correct host identifier

No, it isn't: it identifies an MSYS program, not a MinGW program.  It
would have been correct if you were building an MSYS Emacs for some
reason.

> It might make sense to have configure translate x86_64-pc-msys to
> x86_64-pc-mingw32, and i686-pc-msys to i686-pc-mingw32.

No, it doesn't: people should be able to build an MSYS Emacs, if they
so desire.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-08 21:54 building Emacs on Msys2/mingw32 Angelo Graziosi
  2014-09-08 22:53 ` Óscar Fuentes
@ 2014-09-09 13:42 ` Eli Zaretskii
  2014-09-09 17:53   ` Angelo Graziosi
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-09 13:42 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Date: Mon, 08 Sep 2014 23:54:13 +0200
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> 
> If I remove the "--build=x86_64-w64-mingw32" option to configure, the 
> build is configure for x86_64-pc-mingw64,
> 
> [...]
> Configured for `x86_64-pc-mingw64'.

I see nothing wrong with that, off-hand.

> and 'make -j3' fails at some point.

Where and how does it fail?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09  5:00   ` Stephen Leake
  2014-09-09 10:39     ` Chris Zheng
@ 2014-09-09 13:48     ` Eli Zaretskii
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-09 13:48 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Date: Tue, 09 Sep 2014 00:00:29 -0500
> 
> On the gripping hand, I just tested configure under mingw64_shell.bat,
> and got:
> 
> configure: error: Emacs does not support `x86_64-pc-mingw64'. 

This is already fixed on the trunk.  The release branch insists on
"-mingw32" suffix (of course, you can hack it).

> Just to be clear, the default prefix is still /usr/local. But /usr
> exists in msys2/mingw32; it is at c:/msys64/usr. So /usr/local is a
> reasonable place to install emacs. Except that will mix 32 bit and 64
> bit targets; /usr/local/x86_64 and /usr/local/i686 would be better. So I
> suggest we keep the advice to specify --prefix.

The advice to use --prefix is there for a reason.  My advice is to
stay away of the MSYS tree, so that your absolute file names always
include an explicit drive letter, as in /x/foo/bar.  Otherwise, you
risk passing just /foo/bar to MinGW programs that won't grok it.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 10:39     ` Chris Zheng
@ 2014-09-09 13:58       ` Stephen Leake
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Leake @ 2014-09-09 13:58 UTC (permalink / raw)
  To: emacs-devel

Chris Zheng <chriszheng99@gmail.com> writes:

> Sorry, I can't follow the hole discussion.  But if you want to run
> ./configure under Emacs, say, the in shell-mode, you can add
>   export MSYSTEM=MINGW64
> to ~/.bashrc, this will complete what mingw64_shell.bat do for the
> build.  And this is what I have done.

I have MSYSTEM=MINGW32 in msys bash under Emacs. config.guess returns
x86_64-pc-mingw32. Which is what you want for 64 bit builds (I think)
but just confusing otherwise.

But that is the _only_ difference betwee mingw64_shell.bat and
mingw32_shell.bat. So I don't understand the different behavior between
an Emacs msys shell and a mingw32_shell.bat shell. Sigh.

>> Just to be clear, the default prefix is still /usr/local. But /usr
>> exists in msys2/mingw32; it is at c:/msys64/usr. So /usr/local is a
>> reasonable place to install emacs. Except that will mix 32 bit and 64
>> bit targets; /usr/local/x86_64 and /usr/local/i686 would be better. So I
>> suggest we keep the advice to specify --prefix.

> I personal prefer /mingw32/local and /mingw64/local because: (1) The
> /usr is for MSYS2 system, and programs in it will depend on
> msys-*.dll, like Cygwin does.  But Emacs was native Windows programs
> which doesn't not depend on MSYS2 dlls; (2) /mingw32 and /mingw64 are
> unique and don't exist in /usr and other paths; (3) The Emacs you
> builded are more likely a MinGW32 or MinGW64 program than a MSYS2
> program, so it should come to /mingw32 or /mingw64.

Yes, that makes sense. It would help if the msys2 people would publish
recommended file system conventions with a rationale, rather than just
saying "do whatever you want". Newbies need guidance; we don't _know_
what we want!

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 13:42 ` Eli Zaretskii
@ 2014-09-09 17:53   ` Angelo Graziosi
  2014-09-09 18:11     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Angelo Graziosi @ 2014-09-09 17:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Il 09/09/2014 15:42, Eli Zaretskii ha scritto:
>> Date: Mon, 08 Sep 2014 23:54:13 +0200
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>>
>> If I remove the "--build=x86_64-w64-mingw32" option to configure, the
>> build is configure for x86_64-pc-mingw64,
>>
>> [...]
>> Configured for `x86_64-pc-mingw64'.
>
> I see nothing wrong with that, off-hand.
>
>> and 'make -j3' fails at some point.
>
> Where and how does it fail?
>

Ok, I have repeated the steps from scratch both in mingw32_shell.bat and 
in mingw64_shell.bat shell. As source I have used emacs-master.tar.gz 
(commit 416dd4af, Dmitry Antipov 2014-09-09 11:43:22 (GMT)) from Git mirror.

1) mingw32_shell.bat (failure)

$ ./autogen.sh
$ ./configure
[...]
Configured for `x86_64-pc-mingw32'.
[...]

$ make
[...]
if test "no" = "yes"; then \
   rm -f bootstrap-emacs.exe; \
   ln temacs.exe bootstrap-emacs.exe; \
else \
   ./temacs --batch --load loadup bootstrap || exit 1; \
   test "X" = X ||  -zex emacs.exe; \
   mv -f emacs.exe bootstrap-emacs.exe; \
fi
/bin/sh: riga 4: ./temacs: cannot execute binary file: Exec format error
Makefile:828: set di istruzioni per l'obiettivo "bootstrap-emacs.exe" 
non riuscito
make[1]: *** [bootstrap-emacs.exe] Errore 1
make[1]: uscita dalla directory "/tmp/emacs-master/src"
Makefile:379: set di istruzioni per l'obiettivo "src" non riuscito
make: *** [src] Errore 2

2) mingw64_shell.bat (success)
$ ./autogen.sh
$ ./configure --without-imagemagick
$ make

completed successfully! Maybe the failure I saw before was a consequence 
of the '-j3' option..

So, which way (x86_64-w64-mingw32 / x86_64-pc-mingw32) is the best to 
build Emacs on MSYS2?

Ciao,
  Angelo.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 17:53   ` Angelo Graziosi
@ 2014-09-09 18:11     ` Eli Zaretskii
  2014-09-09 18:15       ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-09 18:11 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Date: Tue, 09 Sep 2014 19:53:18 +0200
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> CC: emacs-devel@gnu.org
> 
> if test "no" = "yes"; then \
>    rm -f bootstrap-emacs.exe; \
>    ln temacs.exe bootstrap-emacs.exe; \
> else \
>    ./temacs --batch --load loadup bootstrap || exit 1; \
>    test "X" = X ||  -zex emacs.exe; \
>    mv -f emacs.exe bootstrap-emacs.exe; \
> fi
> /bin/sh: riga 4: ./temacs: cannot execute binary file: Exec format error
> Makefile:828: set di istruzioni per l'obiettivo "bootstrap-emacs.exe" non riuscito

?? What does "file temacs.exe" says?

> make[1]: *** [bootstrap-emacs.exe] Errore 1
> make[1]: uscita dalla directory "/tmp/emacs-master/src"
> Makefile:379: set di istruzioni per l'obiettivo "src" non riuscito
> make: *** [src] Errore 2
> 
> 2) mingw64_shell.bat (success)
> $ ./autogen.sh
> $ ./configure --without-imagemagick
> $ make
> 
> completed successfully! Maybe the failure I saw before was a consequence 
> of the '-j3' option..

Obviously, the way to answer this is to try mingw32_shell.bat without
"-j3".

> So, which way (x86_64-w64-mingw32 / x86_64-pc-mingw32) is the best to 
> build Emacs on MSYS2?

I have no idea, I use neither MSYS2 nor MinGW64.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 18:11     ` Eli Zaretskii
@ 2014-09-09 18:15       ` Eli Zaretskii
  2014-09-09 19:50         ` Fabrice Popineau
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-09 18:15 UTC (permalink / raw)
  To: angelo.graziosi; +Cc: emacs-devel

> Date: Tue, 09 Sep 2014 21:11:38 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > Date: Tue, 09 Sep 2014 19:53:18 +0200
> > From: Angelo Graziosi <angelo.graziosi@alice.it>
> > CC: emacs-devel@gnu.org
> > 
> > if test "no" = "yes"; then \
> >    rm -f bootstrap-emacs.exe; \
> >    ln temacs.exe bootstrap-emacs.exe; \
> > else \
> >    ./temacs --batch --load loadup bootstrap || exit 1; \
> >    test "X" = X ||  -zex emacs.exe; \
> >    mv -f emacs.exe bootstrap-emacs.exe; \
> > fi
> > /bin/sh: riga 4: ./temacs: cannot execute binary file: Exec format error
> > Makefile:828: set di istruzioni per l'obiettivo "bootstrap-emacs.exe" non riuscito

It's possible that x86_64-pc-mingw32 somehow triggers the use of the
wrong linker script.  Add the -v switch to the link command, and see
if you spot any significant differences between the two builds when
GCC links temacs.exe.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 18:15       ` Eli Zaretskii
@ 2014-09-09 19:50         ` Fabrice Popineau
  0 siblings, 0 replies; 16+ messages in thread
From: Fabrice Popineau @ 2014-09-09 19:50 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz <at> gnu.org> writes:

> 
> > Date: Tue, 09 Sep 2014 21:11:38 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: emacs-devel <at> gnu.org
> > 
> > > Date: Tue, 09 Sep 2014 19:53:18 +0200
> > > From: Angelo Graziosi <angelo.graziosi <at> alice.it>
> > > CC: emacs-devel <at> gnu.org
> > > 
> > > if test "no" = "yes"; then \
> > >    rm -f bootstrap-emacs.exe; \
> > >    ln temacs.exe bootstrap-emacs.exe; \
> > > else \
> > >    ./temacs --batch --load loadup bootstrap || exit 1; \
> > >    test "X" = X ||  -zex emacs.exe; \
> > >    mv -f emacs.exe bootstrap-emacs.exe; \
> > > fi
> > > /bin/sh: riga 4: ./temacs: cannot execute binary file: Exec format 
error
> > > Makefile:828: set di istruzioni per l'obiettivo "bootstrap-
emacs.exe" non riuscito
> 
> It's possible that x86_64-pc-mingw32 somehow triggers the use of the
> wrong linker script.  Add the -v switch to the link command, and see
> if you spot any significant differences between the two builds when
> GCC links temacs.exe.
> 
> 

FWIWn I build Emacs trunk with a standard, not hacked, MSYS2/MingW64.
I update trunk regularly, but I update MSYS2/MingW64 too (with 'pacman -
Syu').
So nowadays, to build trunk, this is what I do :

$ build_alias=x86_64-w64-mingw32 make -j 8 bootstrap

(bootstrap optional).

I'm not sure that the MingW64 changes needed to the configure script can 
be found in another place than emacs trunk (aka : 24.4).

Fabrice





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 13:28 ` Eli Zaretskii
@ 2014-09-09 22:03   ` Stephen Leake
  2014-09-10  3:22     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Stephen Leake @ 2014-09-09 22:03 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stephen Leake <stephen_leake@stephe-leake.org>
>> Date: Mon, 08 Sep 2014 10:54:26 -0500
>> 
>> I had to override the guessed build machine on the configure line:
>> 
>>     $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32
>> 
>> config.guess returns x86_64-pc-msys; configure rejects this.
>> 
>> x86_64-pc-msys is the correct host identifier
>
> No, it isn't: it identifies an MSYS program, not a MinGW program.  

Yes, and the _host_ is MSYS bash.

The _build_ (ie target) is MinGW. Which is why I used --build, not --host.

>> It might make sense to have configure translate x86_64-pc-msys to
>> x86_64-pc-mingw32, and i686-pc-msys to i686-pc-mingw32.
>
> No, it doesn't: people should be able to build an MSYS Emacs, if they
> so desire.

Good point.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: building Emacs on Msys2/mingw32
  2014-09-09 22:03   ` Stephen Leake
@ 2014-09-10  3:22     ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-09-10  3:22 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Date: Tue, 09 Sep 2014 17:03:24 -0500
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Stephen Leake <stephen_leake@stephe-leake.org>
> >> Date: Mon, 08 Sep 2014 10:54:26 -0500
> >> 
> >> I had to override the guessed build machine on the configure line:
> >> 
> >>     $ ./configure --build=i686-pc-mingw32 --prefix=/mingw32
> >> 
> >> config.guess returns x86_64-pc-msys; configure rejects this.
> >> 
> >> x86_64-pc-msys is the correct host identifier
> >
> > No, it isn't: it identifies an MSYS program, not a MinGW program.  
> 
> Yes, and the _host_ is MSYS bash.
> 
> The _build_ (ie target) is MinGW. Which is why I used --build, not --host.

Since MSYS2's main purpose is to build MinGW programs, it should
produce a MinGW targeted triplet by default.  At least that's what
MSYS does.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-09-10  3:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 21:54 building Emacs on Msys2/mingw32 Angelo Graziosi
2014-09-08 22:53 ` Óscar Fuentes
2014-09-09 13:42 ` Eli Zaretskii
2014-09-09 17:53   ` Angelo Graziosi
2014-09-09 18:11     ` Eli Zaretskii
2014-09-09 18:15       ` Eli Zaretskii
2014-09-09 19:50         ` Fabrice Popineau
  -- strict thread matches above, loose matches on Subject: below --
2014-09-08 15:54 Stephen Leake
2014-09-08 20:14 ` Óscar Fuentes
2014-09-09  5:00   ` Stephen Leake
2014-09-09 10:39     ` Chris Zheng
2014-09-09 13:58       ` Stephen Leake
2014-09-09 13:48     ` Eli Zaretskii
2014-09-09 13:28 ` Eli Zaretskii
2014-09-09 22:03   ` Stephen Leake
2014-09-10  3:22     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.