git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/5] config.mak.uname: supporting 64-bit MSys2
Date: Thu, 21 Jan 2016 14:51:28 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1601211438440.2964@virtualbox> (raw)
In-Reply-To: <1453372574-20431-1-git-send-email-szeder@ira.uka.de>

[-- Attachment #1: Type: text/plain, Size: 2923 bytes --]

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:

> > 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...

> >  	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.

> > +		endif
> > +		ifeq (MINGW64,$(MSYSTEM))
> > +			prefix = /mingw64
> 
> Here prefix is set for 64 bit MSys2.  Still OK.

Well, 64-bit *MINGW*, not 64-bit *MSYS2*.

> > +		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.

  reply	other threads:[~2016-01-21 13:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 13:30 [PATCH 0/5] Fix compile errors with MSys2 Johannes Schindelin
2016-01-13 13:30 ` [PATCH 1/5] config.mak.uname: support MSys2 Johannes Schindelin
2016-01-13 16:11   ` Jeff King
2016-01-13 16:45     ` Johannes Schindelin
2016-01-13 19:23     ` Dennis Kaarsemaker
2016-01-13 13:31 ` [PATCH 2/5] config.mak.uname: supporting 64-bit MSys2 Johannes Schindelin
2016-01-21 10:36   ` SZEDER Gábor
2016-01-21 13:51     ` Johannes Schindelin [this message]
2016-01-13 13:31 ` [PATCH 3/5] nedmalloc: allow compiling with MSys2's compiler Johannes Schindelin
2016-01-13 19:28   ` Junio C Hamano
2016-01-13 13:31 ` [PATCH 4/5] compat/mingw: support MSys2-based MinGW build Johannes Schindelin
2016-01-13 13:31 ` [PATCH 5/5] compat/winansi: support compiling with MSys2 Johannes Schindelin
2016-01-13 19:31 ` [PATCH 0/5] Fix compile errors " Junio C Hamano
2016-01-14  6:53   ` Johannes Schindelin
2016-01-14 16:51 ` [PATCH v2 " Johannes Schindelin
2016-01-14 16:51   ` [PATCH v2 1/5] config.mak.uname: support MSys2 Johannes Schindelin
2016-01-14 21:45     ` Johannes Sixt
2016-01-14 16:51   ` [PATCH v2 2/5] config.mak.uname: supporting 64-bit MSys2 Johannes Schindelin
2016-01-14 16:51   ` [PATCH v2 3/5] nedmalloc: allow compiling with MSys2's compiler Johannes Schindelin
2016-01-14 16:51   ` [PATCH v2 4/5] compat/mingw: support MSys2-based MinGW build Johannes Schindelin
2016-01-14 16:52   ` [PATCH v2 5/5] compat/winansi: support compiling with MSys2 Johannes Schindelin
2016-01-14 20:21   ` [PATCH v2 0/5] Fix compile errors " Junio C Hamano
2016-01-14 21:57   ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1601211438440.2964@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder@ira.uka.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).