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

Re: [PATCH 2/5] config.mak.uname: supporting 64-bit MSys2

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 21, 2016, 13:51 UTC
Message-ID
<alpine.DEB.2.20.1601211438440.2964@virtualbox>
In-Reply-To
<1453372574-20431-1-git-send-email-szeder@ira.uka.de>
Hi Gábor,
On Thu, 21 Jan 2016, SZEDER Gábor wrote:
> > This just makes things compile, the test suite needs extra tender
> > loving care in addition to this change. We will address these issues
> > in later commits.
Please note this statement:
Show 9 quoted lines
> > While at it, also allow building MSys2 Git (i.e. a Git that uses MSys2's
> > POSIX emulation layer).
> > [...]
> > diff --git a/config.mak.uname b/config.mak.uname
> > index b0592c1..4b2e1b8 100644
> > --- a/config.mak.uname
> > +++ b/config.mak.uname
> > @@ -545,8 +544,17 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
> >  else

... and that this here condition triggers only for MSYS2 [*1*], but in all modes, i.e. 32-bit/64-bit MSYS2/MINGW...

Show 7 quoted lines
> >  	ifeq ($(shell expr "$(uname_R)" : '2\.'),2)
> >  		# MSys2
> > +		prefix = /usr/
> > +		ifeq (MINGW32,$(MSYSTEM))
> > +			prefix = /mingw32
> 
> Here prefix is set for 32 bit MSys2.  OK.

Actually, it is not 32-bit MSYS2 but 32-bit MINGW. Please remember that MSYS2 programs use the MSYS2 runtime (in essence a portable version of Cygwin's runtime), i.e. a POSIX emulation layer, while MINGW programs do not.

As a consequence, MINGW programs are 1) faster, and 2) cannot use POSIX functionality such as fork().

So yes, this triggers when we are using the 32-bit MINGW environment, which is just a mode in which you can start MSYS2 (or for that matter, the Git for Windows SDK), simply by setting the environment variable `MSYSTEM` accordingly.

The modes are MINGW32, MINGW64 and MSYS. You cannot switch between 32-bit MSYS2 and 64-bit MSYS2 that way because you can run either with 32-bit MSYS2 runtime & programs or 64-bit MSYS2 runtime & programs. You can easily mix & match 32-bit and 64-bit MINGW programs, though.

Show 5 quoted lines
> > +		endif
> > +		ifeq (MINGW64,$(MSYSTEM))
> > +			prefix = /mingw64
> 
> Here prefix is set for 64 bit MSys2.  Still OK.
Well, 64-bit *MINGW*, not 64-bit *MSYS2*.
Show 7 quoted lines
> > +		else
> > +			COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
> > +			BASIC_LDFLAGS += -Wl,--large-address-aware
> 
> But then these flags are set for any MSys2 that is not 64 bit, which
> also includes MINGW32, which we've already dealt with above
> explicitly.  Hmm.

Remember the second paragraph of the commit message here, please: we want MSYS2 Git to be compiled, too. As opposed to MINGW Git. It is slower, yes, but by being able to use POSIX functionality, it can side-step any bugs in our Windows-specific code, if any.

And even 64-bit MSYS2's tools can handle those C and LD flags, last time I checked, it is just 64-bit MINGW's tools that cannot.

Ciao, Johannes

Footnote *1*: While "MSYS2" suggests that it is a four-letter acronym rather than a two-letter one (it really only stands for "*M*inimal *Sys*tem" version 2), at least one of the MSYS2 developers is adamant about using all-caps. It's a fight I don't need, so I don't fight it.

Previous: SZEDER GáborNext: Johannes Schindelin
Message 8 of 23 in “Fix compile errors with MSys2”
  1. 0/5 Fix compile errors with MSys2Johannes Schindelin, Jan 13, 2016
  2. 1/5 config.mak.uname: support MSys2Johannes Schindelin, Jan 13, 2016
  3. Jeff KingJan 13, 2016
  4. Johannes SchindelinJan 13, 2016
  5. Dennis KaarsemakerJan 13, 2016
  6. 2/5 config.mak.uname: supporting 64-bit MSys2Johannes Schindelin, Jan 13, 2016
  7. SZEDER GáborJan 21, 2016
  8. Johannes SchindelinJan 21, 2016
  9. 3/5 nedmalloc: allow compiling with MSys2's compilerJohannes Schindelin, Jan 13, 2016
  10. Junio C HamanoJan 13, 2016
  11. 4/5 compat/mingw: support MSys2-based MinGW buildJohannes Schindelin, Jan 13, 2016
  12. 5/5 compat/winansi: support compiling with MSys2Johannes Schindelin, Jan 13, 2016
  13. Junio C HamanoJan 13, 2016
  14. Johannes SchindelinJan 14, 2016
  15. 0/5 Fix compile errors with MSys2Johannes Schindelin, Jan 14, 2016
  16. 1/5 config.mak.uname: support MSys2Johannes Schindelin, Jan 14, 2016
  17. Johannes SixtJan 14, 2016
  18. 2/5 config.mak.uname: supporting 64-bit MSys2Johannes Schindelin, Jan 14, 2016
  19. 3/5 nedmalloc: allow compiling with MSys2's compilerJohannes Schindelin, Jan 14, 2016
  20. 4/5 compat/mingw: support MSys2-based MinGW buildJohannes Schindelin, Jan 14, 2016
  21. 5/5 compat/winansi: support compiling with MSys2Johannes Schindelin, Jan 14, 2016
  22. Junio C HamanoJan 14, 2016
  23. Johannes SixtJan 14, 2016

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.