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

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

 



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.

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]