git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 07/14] Fix BASIC_LDFLAGS and COMPAT_CFLAGS for 64bit MinGW-w64

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 10, 2014, 06:38 UTC
Message-ID
<alpine.DEB.1.00.1410100809450.990@s15462909.onlinehome-server.info>
In-Reply-To
<CAOYw7dtouon0EXYQPnvpc7ZMARKwaureNTK6ZL+aByknpPG-9A@mail.gmail.com>
Hi Ray,
On Fri, 10 Oct 2014, Ray Donnelly wrote:
Show 33 quoted lines
> On Thu, Oct 9, 2014 at 8:47 PM, Johannes Schindelin <
> Johannes.Schindelin@gmx.de> wrote:
> >
> > On Thu, 9 Oct 2014, Ray Donnelly wrote:
> >
> >> On Thu, Oct 9, 2014 at 8:22 PM, Johannes Schindelin
> >> <Johannes.Schindelin@gmx.de> wrote:
> >> >
> >> > On Wed, 8 Oct 2014, Marat Radchenko wrote:
> >> >
> >> >> +CC_MACH := $(shell sh -c '$(CC) -dumpmachine 2>/dev/null || echo
> not')
> >> >
> >> > There is a rather huge problem with that. The latest mingw-w64
> >> > release, 4.9.1, does not do what you expect here: while
> >> > '.../mingw32/bin/gcc -m32 -o 32.exe test.c' and
> >> > '.../mingw32/bin/gcc -m64 -o 64.exe test.c' work fine, producing
> >> > i686 and x86_64 executables respectively, '.../mingw32/bin/gcc
> >> > -dumpmachine' prints i686-w64-mingw32 *always*, even when
> >> > specifying the -m64 option.
> >> >
> >> > So unfortunately, the test introduced by this patch (intended to
> >> > figure out whether the build targets i686, and skip a compiler and
> >> > a linker option otherwise) is incorrect.
> >>
> >> Which release are you talking about? Can you point me to the tarball
> >> please?
> >
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.1/threads-win32/sjlj/
> >
> > (rev1, not rev0)
> 
> I guess I can add passing in CFLAGS also to try to catch that case.

Well, my tests say that the CFLAGS do *not* change the behavior of -dumpmachine. IOW `i686-w64-mingw32-gcc -m64 -dumpmachine` *still* spits out i686-w64-mingw32. Even if the -m64 flag would cause the compiler to generate 64-bit binaries.

> I've added support to build using your branch to MSYS2's MINGW-packages
> git-git package in case anyone wants to help out:
> 
> https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-git-git
Interesting.

With Git for Windows, we aim to become waaaaay more standards-compliant by providing Git as a regular mingw-get'able package. To this end, we use mgwport recipes to build the required packages.

It looks as if the PKGBUILD system is similar, but *just* incompatible enough with mgwport to prevent code sharing. Is this fixable?

> Change _based_on_dscho_w64_msysgit=no to =yes. Note also that some more
> patches are needed before we can build, and I think more are needed.
> Using plain msysGit (I.e. =no) and 15 patches we are able to build a
> somewhat functional git.

So here is my plan, please let me know whether you think we can compromise on a strategy that benefits both of us:

Since I want mingw-get'able packages – also for 64-bit – I would like to keep the CPU architecture dependent parts as contained as possible and use only one package system for both. Likewise, I would really prefer to have a single development environment for both architectures, and the Git for Windows SDK is really coming along nicely, thanks to the tremendous efforts put in by Thomas Braun and Sebastian Schuberth.

I am planning, therefore, to provide the MinGW-w64 compiler as an add-on package that needs to be installed in order to build 64-bit stuff.

At this stage, it is actually *more* than a plan: I already have a package to install 7za – required to unpack MinGW-w64 pre-built packages – and the script to package mingw-w64 is in the process of being fleshed out.

With this compiler, and the 'w64' branch from https://github.com/dscho/git – intended to be merged into https://github.com/git-for-windows/git – the following command-line produces 64-bit Git:

	PATH=/path/to/unpacked/mingw-w64/mingw64/bin/:$PATH \
	make \
		CROSS_COMPILE=x86_64-w64-mingw32- CC='$(CROSS_COMPILE)gcc' \
		AR=ar RC=windres \
		NO_ICONV=1 NO_OPENSSL=1 NO_CURL=1 NEEDS_LIBICONV= USE_LIBPCRE=

The test suite passes so far (still running, at the time of writing it is going through t3404).

Ciao, Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Previous: Ray DonnellyNext: Johannes Schindelin
Message 15 of 45 in “MinGW(-W64) compilation”
  1. MinGW(-W64) compilationMarat Radchenko, Oct 8, 2014
  2. 01/14 MINGW: compat/mingw.h: do not attempt to redefine lseek on mingw-w64Marat Radchenko, Oct 8, 2014
  3. Erik Faye-LundOct 9, 2014
  4. 02/14 MSVC: config.mak.uname: drop -D__USE_MINGW_ACCESS from CFLAGSMarat Radchenko, Oct 8, 2014
  5. 03/14 MINGW: compat/mingw.h: drop fork() definitionMarat Radchenko, Oct 8, 2014
  6. 04/14 MINGW: do not fail at redefining pid_t on MinGW-W64Marat Radchenko, Oct 8, 2014
  7. 05/14 MINGW: config.mak.uname: allow using cURL for non-msysGit buildsMarat Radchenko, Oct 8, 2014
  8. 06/14 MINGW: compat/winansi.c: do not redefine CONSOLE_FONT_INFOEXMarat Radchenko, Oct 8, 2014
  9. 07/14 Fix BASIC_LDFLAGS and COMPAT_CFLAGS for 64bit MinGW-w64Marat Radchenko, Oct 8, 2014
  10. Junio C HamanoOct 8, 2014
  11. Johannes SchindelinOct 9, 2014
  12. Ray DonnellyOct 9, 2014
  13. Johannes SchindelinOct 9, 2014
  14. Ray DonnellyOct 9, 2014
  15. Johannes SchindelinOct 10, 2014
  16. Johannes SchindelinOct 10, 2014
  17. Johannes SchindelinOct 11, 2014
  18. Marat RadchenkoOct 14, 2014
  19. 08/14 MINGW: git-compat-util.h: use inttypes.h for printf macrosMarat Radchenko, Oct 8, 2014
  20. Junio C HamanoOct 8, 2014
  21. 09/14 MINGW: config.mak.uname: reorganize MinGW settingsMarat Radchenko, Oct 8, 2014
  22. 10/14 Makefile: introduce CROSS_COMPILE variableMarat Radchenko, Oct 8, 2014
  23. Junio C HamanoOct 8, 2014
  24. 11/14 compat/nedmalloc/malloc.c.h: fix compilation under MinGW-W64Marat Radchenko, Oct 8, 2014
  25. 12/14 Fix pointer -> integer casts on IL32P64 systemsMarat Radchenko, Oct 8, 2014
  26. 13/14 git-compat-util.h: fix integer overflow on IL32P64 systemsMarat Radchenko, Oct 8, 2014
  27. Junio C HamanoOct 8, 2014
  28. Junio C HamanoOct 8, 2014
  29. Marat RadchenkoOct 9, 2014
  30. Junio C HamanoOct 9, 2014
  31. Johannes SchindelinOct 9, 2014
  32. 14/14 MINGW: config.mak.uname: auto-detect MinGW build from compilerMarat Radchenko, Oct 8, 2014
  33. Junio C HamanoOct 8, 2014
  34. Marat RadchenkoOct 9, 2014
  35. Johannes SchindelinOct 9, 2014
  36. Junio C HamanoOct 9, 2014
  37. Johannes SchindelinOct 9, 2014
  38. Marat RadchenkoOct 9, 2014
  39. Junio C HamanoOct 8, 2014
  40. Johannes SchindelinOct 9, 2014
  41. Marat RadchenkoOct 9, 2014
  42. Johannes SchindelinOct 9, 2014
  43. Johannes SchindelinOct 9, 2014
  44. Johannes SchindelinOct 9, 2014
  45. Johannes SchindelinOct 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.