Discussion:
[PATCH v5] MinGW(-W64) compilation
Marat Radchenko
2014-10-08 18:00:53 UTC
Permalink
This patch series fixes building on modern MinGW and MinGW-W64 (including x86_64).

*Compilation* tested on:
- MSVC
- msysGit environment (twice)
- Linux cross-toolchain i686-pc-mingw32
- Linux cross-toolchain i686-w64-mingw32
- Linux cross-toolchain x86_64-w64-mingw32

Also, this patchset is confirmed to pass msysgit testsuite.

Attention: in order to build on MinGW-W64, you need a version that has
https://sourceforge.net/p/mingw-w64/bugs/397 fixed. Otherwise, you'll get:

compat/poll/poll.c: In function 'poll':
compat/poll/poll.c:541:7: warning: implicit declaration of function 'MsgWaitForMultipleObjects'
compat/poll/poll.c:542:26: error 'QS_ALLINPUT' undeclared (first use in this function)

-------

Cosmetic changes since v4:

* Reworded 'MSVC: config.mak.uname: drop -D__USE_MINGW_ACCESS from CFLAGS'
(added note about MinGW section)
* Reworded 'MINGW: config.mak.uname: reorganize MinGW settings'
(now uses gender-neutral singular 'they')
* Reworded 'Fix pointer -> integer casts on IL32P64 systems'
(added references to Gnulib commits)

-------

Additional note:

todays git.git/master is broken on both MSVC and MinGW-W64 because of 7559a1be + 4e6d207c:
MSVC doesn't have sigset_t at all, MinGW-W64 has it in sys/types.h, but it is only
available with -D_POSIX. I hope this can be resolved separately as a regression for MSVC.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:54 UTC
Permalink
Unlike MinGW, MinGW-W64 has lseek already properly defined in io.h.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
Acked-by: Eric Faye-Lund <***@gmail.com>
---
compat/mingw.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/compat/mingw.h b/compat/mingw.h
index 5e499cf..36a47cb 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -286,7 +286,9 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
* Use mingw specific stat()/lstat()/fstat() implementations on Windows.
*/
#define off_t off64_t
+#ifndef lseek
#define lseek _lseeki64
+#endif

/* use struct stat with 64 bit st_size */
#ifdef stat
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Erik Faye-Lund
2014-10-09 01:01:34 UTC
Permalink
Post by Marat Radchenko
Unlike MinGW, MinGW-W64 has lseek already properly defined in io.h.
I spell my name with a K, "Erik Faye-Lund".
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:55 UTC
Permalink
-D__USE_MINGW_ACCESS only affects MinGW and does nothing when
MSVC is used.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
Acked-by: Eric Faye-Lund <***@gmail.com>
---
config.mak.uname | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config.mak.uname b/config.mak.uname
index a2f380f..20cbdcf 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -368,7 +368,7 @@ ifeq ($(uname_S),Windows)
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
compat/win32/dirent.o
- COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
+ COMPAT_CFLAGS = -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
PTHREAD_LIBS =
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:56 UTC
Permalink
fork() is not used in MinGW builds but causes a compiler warning
on x86_64 MinGW-W64: conflicting types for built-in function 'fork'

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
Acked-by: Eric Faye-Lund <***@gmail.com>
---
compat/mingw.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 36a47cb..1ddd663 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -92,8 +92,6 @@ static inline int symlink(const char *oldpath, const char *newpath)
{ errno = ENOSYS; return -1; }
static inline int fchmod(int fildes, mode_t mode)
{ errno = ENOSYS; return -1; }
-static inline pid_t fork(void)
-{ errno = ENOSYS; return -1; }
static inline unsigned int alarm(unsigned int seconds)
{ return 0; }
static inline int fsync(int fd)
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:59 UTC
Permalink
Unlike MinGW, MinGW-W64 has CONSOLE_FONT_INFOEX already properly defined
in wincon.h.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
compat/winansi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/winansi.c b/compat/winansi.c
index efc5bb3..0ac3297 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -22,7 +22,7 @@ static int non_ascii_used = 0;
static HANDLE hthread, hread, hwrite;
static HANDLE hconsole1, hconsole2;

-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
typedef struct _CONSOLE_FONT_INFOEX {
ULONG cbSize;
DWORD nFont;
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:57 UTC
Permalink
pid_t is available in sys/types.h on both MinGW and MinGW-W64

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
Acked-by: Eric Faye-Lund <***@gmail.com>
---
compat/mingw.h | 1 -
compat/msvc.h | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 1ddd663..ba05044 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -5,7 +5,6 @@
* things that are not available in header files
*/

-typedef int pid_t;
typedef int uid_t;
typedef int socklen_t;
#define hstrerror strerror
diff --git a/compat/msvc.h b/compat/msvc.h
index 580bb55..a63d878 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -15,6 +15,8 @@
#define strtoull _strtoui64
#define strtoll _strtoi64

+typedef int pid_t;
+
static __inline int strcasecmp (const char *s1, const char *s2)
{
int size1 = strlen(s1);
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:00 UTC
Permalink
From: Ray Donnelly <***@gmail.com>

Signed-off-by: Ray Donnelly <***@gmail.com>
Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
config.mak.uname | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 324a7fc..4470a928 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -6,6 +6,7 @@ uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
+CC_MACH := $(shell sh -c '$(CC) -dumpmachine 2>/dev/null || echo not')

ifdef MSVC
# avoid the MingW and Cygwin configuration sections
@@ -509,12 +510,15 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
- COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D_USE_32BIT_TIME_T -DNOGDI -Icompat -Icompat/win32
+ COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
+ ifneq (,$(findstring i686,$(CC_MACH)))
+ COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
+ BASIC_LDFLAGS += -Wl,--large-address-aware
+ endif
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
compat/win32/dirent.o
- BASIC_LDFLAGS += -Wl,--large-address-aware
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:24:13 UTC
Permalink
Subject: Re: [PATCH 07/14] Fix BASIC_LDFLAGS and COMPAT_CFLAGS for 64bit MinGW-w64
Please prefix with MinGW: like you did for other changes.
Needs a bit of explanation what breaks without this change. I can
see that unconditional use of USE_32BIT_TIME_T probably goes against
a 64-bit platform by looking at the change, but "Fix Blah" is never
informative enough to justify any change in the log message. We
want to be able to read "Fix Blah *how*/*why*" in our "git log" (and
prefereably in "git shortlog").

Thanks.
---
config.mak.uname | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/config.mak.uname b/config.mak.uname
index 324a7fc..4470a928 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -6,6 +6,7 @@ uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
+CC_MACH := $(shell sh -c '$(CC) -dumpmachine 2>/dev/null || echo not')
ifdef MSVC
# avoid the MingW and Cygwin configuration sections
@@ -509,12 +510,15 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
- COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D_USE_32BIT_TIME_T -DNOGDI -Icompat -Icompat/win32
+ COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
+ ifneq (,$(findstring i686,$(CC_MACH)))
+ COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
+ BASIC_LDFLAGS += -Wl,--large-address-aware
+ endif
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
compat/win32/dirent.o
- BASIC_LDFLAGS += -Wl,--large-address-aware
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
--
2.1.1
--
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 19:22:19 UTC
Permalink
Hi,
Post by Marat Radchenko
+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.

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ray Donnelly
2014-10-09 19:25:42 UTC
Permalink
On Thu, Oct 9, 2014 at 8:22 PM, Johannes Schindelin
Post by Johannes Schindelin
Hi,
Post by Marat Radchenko
+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?
Post by Johannes Schindelin
Ciao,
Johannes
Johannes Schindelin
2014-10-09 19:47:18 UTC
Permalink
Hi Ray,
Post by Ray Donnelly
On Thu, Oct 9, 2014 at 8:22 PM, Johannes Schindelin
Post by Johannes Schindelin
Post by Marat Radchenko
+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?
Certainly:

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.1/threads-win32/sjlj/

(rev1, not rev0)

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ray Donnelly
2014-10-09 23:56:25 UTC
Permalink
Thanks Johannes.

On Thu, Oct 9, 2014 at 8:47 PM, Johannes Schindelin <
Post by Johannes Schindelin
Hi Ray,
Post by Ray Donnelly
On Thu, Oct 9, 2014 at 8:22 PM, Johannes Schindelin
Post by Johannes Schindelin
Post by Marat Radchenko
+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/
Post by Johannes Schindelin
(rev1, not rev0)
I guess I can add passing in CFLAGS also to try to catch that case. What
would you recommend?

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

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.
Post by Johannes Schindelin
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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-10 06:38:09 UTC
Permalink
Hi Ray,
Post by Ray Donnelly
On Thu, Oct 9, 2014 at 8:47 PM, Johannes Schindelin <
Post by Johannes Schindelin
Post by Ray Donnelly
On Thu, Oct 9, 2014 at 8:22 PM, Johannes Schindelin
Post by Johannes Schindelin
Post by Marat Radchenko
+CC_MACH := $(shell sh -c '$(CC) -dumpmachine 2>/dev/null || echo
not')
Post by Johannes Schindelin
Post by Ray Donnelly
Post by Johannes Schindelin
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/
Post by Johannes Schindelin
(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.
Post by Ray Donnelly
I've added support to build using your branch to MSYS2's MINGW-packages
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?
Post by Ray Donnelly
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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-10 10:55:04 UTC
Permalink
Hi,
With this [mingw-w64] 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
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).
And it stopped at t3900-i18n-commit.txt:

not ok 15 - ISO8859-1 should be shown in UTF-8 now
not ok 16 - eucJP should be shown in UTF-8 now
not ok 17 - ISO-2022-JP should be shown in UTF-8 now
not ok 23 - ISO8859-1 should be shown in UTF-8 now
not ok 24 - eucJP should be shown in UTF-8 now
not ok 25 - ISO-2022-JP should be shown in UTF-8 now
not ok 27 - ISO-2022-JP should be shown in eucJP now
not ok 28 - eucJP should be shown in ISO-2022-JP now

Inspecting the test case 15 above, it appears as if ISO-8859-1 was still
shown as ISO-8859-1 instead of UTF-8:

$ hexdump.exe /git/t/t3900/1-UTF-8.txt trash
directory.t3900-i18n-commit/current
---- /git/t/t3900/1-UTF-8.txt ----
0000 c3 84 c3 8b c3 91 c3 8f c3 96 0a 0a c3 81 62 c3
0010 a7 64 c3 a8 66 67 0a
---- trash directory.t3900-i18n-commit/current ----
0000 c4 cb d1 cf d6 0a 0a c1 62 e7 64 e8 66 67 0a

So I fear we have still a ways to go before Git works as a 64-bit Windows
binary...

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-11 11:12:31 UTC
Permalink
Hi,
Post by Johannes Schindelin
With this [mingw-w64] 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
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).
[...]
So I fear we have still a ways to go before Git works as a 64-bit Windows
binary...
It seems to be not *all* that bad: only t3900, t3901, t4041, t4205, t4210,
t5100, t6006 and t7102 display test failures.

Ciao,
Dscho
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-11 09:11:42 UTC
Permalink
Hi Ray,
what's the difference between https://github.com/msysgit/git and
https://github.com/git-for-windows/git ? I noticed that your fork is
forked from msysgit, not git-for-windows?
I am glad you asked!

Git for Windows was developed using the development environment called
"msysGit" ever since 2007. Unfortunately the name caused a *real* lot of
confusion, not only because some people wondered what the heck MSys is,
but those who did not wonder mistook it for a *different* version of Git
for Windows.

Apart from the name, msysGit also has the shortcoming of abusing Git to
deploy binaries. In other words, msysGit itself is a Git-managed project
that delivers the complete development environment. Upgrading individual
components is unnecessarily hard, but msysGit's way was necessary because
there was no nice package manager for MinGW/MSys yet.

Things have changed in the meantime, and pushed forward by Thomas Braun
and Sebastian Schuberth, we now have a light-weight Git for Windows SDK –
which is essentially a standard MinGW/MSys system managed through the
package manager mingw-get. The only two add-ons we have is a nicer
installer (that Sebastian offered to MinGW but they declined) and the
addition of our own mingw-get'able packages (such as openssl, libpcre, and
git itself).

Needless to say, I am a big fan of that new strategy. This is why we
decided to just phase out the name "msysGit" (as well as the GitHub org of
the same name) and work on Git for Windows (with the corresponding GitHub
org, and using the name "Git for Windows" for the installer aimed at
"end-users" and "Git for Windows SDK" for the development environment
targeting Git for Windows developers).

I also added this writeup to the FAQ on the msysGit wiki:
https://github.com/msysgit/msysgit/wiki/Relationship-to-Git-for-Windows

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-14 07:08:22 UTC
Permalink
Post by Johannes Schindelin
Hi,
Post by Marat Radchenko
+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.
According to [1], it is by design. For now, I suggest using separate
gcc binaries for 32/64, without messing with -m32. Of course we can
fallback to `./configure` that will determine bitness by compiling something.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52096#c1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:00:58 UTC
Permalink
Is it absolutely valid and possible to have cURL in generic
MinGW environment. Building Git without cURL is still possible
by passing NO_CURL=1

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
Acked-by: Eric Faye-Lund <***@gmail.com>
---
config.mak.uname | 2 --
1 file changed, 2 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 20cbdcf..324a7fc 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -531,8 +531,6 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
INTERNAL_QSORT = YesPlease
HAVE_LIBCHARSET_H = YesPlease
NO_GETTEXT = YesPlease
-else
- NO_CURL = YesPlease
endif
endif
ifeq ($(uname_S),QNX)
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:01 UTC
Permalink
All MinGW flavors have inttypes.h, so just include it.

However, we need to pass -D__USE_MINGW_ANSI_STDIO=1 to select
GNU-compatible macro definitions on MinGW-W64:
http://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/

As a side-effect, Git no longer builds with MSVC < 2010 due to
its lack of stdint.h but hopefully that is not a problem.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
compat/mingw.h | 2 --
compat/msvc.h | 3 +++
config.mak.uname | 3 ++-
git-compat-util.h | 11 ++++++-----
4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index ba05044..59a50fc 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -358,8 +358,6 @@ static inline char *mingw_find_last_dir_sep(const char *path)
int mingw_offset_1st_component(const char *path);
#define offset_1st_component mingw_offset_1st_component
#define PATH_SEP ';'
-#define PRIuMAX "I64u"
-#define PRId64 "I64d"

void mingw_open_html(const char *path);
#define open_html mingw_open_html
diff --git a/compat/msvc.h b/compat/msvc.h
index a63d878..84a03f9 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -17,6 +17,9 @@

typedef int pid_t;

+#define PRIuMAX "I64u"
+#define PRId64 "I64d"
+
static __inline int strcasecmp (const char *s1, const char *s2)
{
int size1 = strlen(s1);
diff --git a/config.mak.uname b/config.mak.uname
index 4470a928..c7aaa1c 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -328,6 +328,7 @@ ifeq ($(uname_S),Windows)
NO_PREAD = YesPlease
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
+ NO_INTTYPES_H = UnfortunatelyYes
NO_POLL = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
@@ -510,7 +511,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
- COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
+ COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D__USE_MINGW_ANSI_STDIO=1 -DNOGDI -Icompat -Icompat/win32
ifneq (,$(findstring i686,$(CC_MACH)))
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
BASIC_LDFLAGS += -Wl,--large-address-aware
diff --git a/git-compat-util.h b/git-compat-util.h
index fb41118..b338277 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -96,6 +96,12 @@
#define GIT_WINDOWS_NATIVE
#endif

+#ifndef NO_INTTYPES_H
+#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -147,11 +153,6 @@
#include <netdb.h>
#include <pwd.h>
#include <sys/un.h>
-#ifndef NO_INTTYPES_H
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
#ifdef NO_INTPTR_T
/*
* On I16LP32, ILP32 and LP64 "long" is the save bet, however
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:25:44 UTC
Permalink
Post by Marat Radchenko
All MinGW flavors have inttypes.h, so just include it.
However, we need to pass -D__USE_MINGW_ANSI_STDIO=1 to select
http://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
As a side-effect, Git no longer builds with MSVC < 2010 due to
its lack of stdint.h but hopefully that is not a problem.
That "hopefully" does not build much confidence.

"All have inttypes.h, so just include it" does not say why it is a
good idea to do so, if the source before this patch built OK without
including it.

Bad things like this and that happen because the current code
does not include inttypes.h, but the header exists everywhere so
we can fix this and that by including it.

would be more understandable, but otherwise, it is unclear what
problems it attempts to fix, and if it is an improvement overall to
trade it off with the possible breakage on some systems.

The log message also needs to explain why inclusion order in
git-compat-util.h must be changed. What problem does that change
fix?
Post by Marat Radchenko
---
compat/mingw.h | 2 --
compat/msvc.h | 3 +++
config.mak.uname | 3 ++-
git-compat-util.h | 11 ++++++-----
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/compat/mingw.h b/compat/mingw.h
index ba05044..59a50fc 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -358,8 +358,6 @@ static inline char *mingw_find_last_dir_sep(const char *path)
int mingw_offset_1st_component(const char *path);
#define offset_1st_component mingw_offset_1st_component
#define PATH_SEP ';'
-#define PRIuMAX "I64u"
-#define PRId64 "I64d"
void mingw_open_html(const char *path);
#define open_html mingw_open_html
diff --git a/compat/msvc.h b/compat/msvc.h
index a63d878..84a03f9 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -17,6 +17,9 @@
typedef int pid_t;
+#define PRIuMAX "I64u"
+#define PRId64 "I64d"
+
static __inline int strcasecmp (const char *s1, const char *s2)
{
int size1 = strlen(s1);
diff --git a/config.mak.uname b/config.mak.uname
index 4470a928..c7aaa1c 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -328,6 +328,7 @@ ifeq ($(uname_S),Windows)
NO_PREAD = YesPlease
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
+ NO_INTTYPES_H = UnfortunatelyYes
NO_POLL = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
@@ -510,7 +511,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
- COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
+ COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D__USE_MINGW_ANSI_STDIO=1 -DNOGDI -Icompat -Icompat/win32
ifneq (,$(findstring i686,$(CC_MACH)))
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
BASIC_LDFLAGS += -Wl,--large-address-aware
diff --git a/git-compat-util.h b/git-compat-util.h
index fb41118..b338277 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -96,6 +96,12 @@
#define GIT_WINDOWS_NATIVE
#endif
+#ifndef NO_INTTYPES_H
+#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -147,11 +153,6 @@
#include <netdb.h>
#include <pwd.h>
#include <sys/un.h>
-#ifndef NO_INTTYPES_H
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
#ifdef NO_INTPTR_T
/*
* On I16LP32, ILP32 and LP64 "long" is the save bet, however
--
2.1.1
--
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:02 UTC
Permalink
HAVE_LIBCHARSET_H and NO_R_TO_GCC_LINKER are not specific to
msysGit, they're general MinGW settings.

Logic behind HAVE_LIBCHARSET_H: if user is on MinGW and has iconv,
we expect him to have libcharset.h. If user doesn't have iconv,
he has to explicitly say so via NO_ICONV=1 regardless of this
commit.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
config.mak.uname | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index c7aaa1c..f79c0e0 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -532,11 +532,11 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
prefix =
INSTALL = /bin/install
EXTLIBS += /mingw/lib/libz.a
- NO_R_TO_GCC_LINKER = YesPlease
INTERNAL_QSORT = YesPlease
- HAVE_LIBCHARSET_H = YesPlease
NO_GETTEXT = YesPlease
endif
+ HAVE_LIBCHARSET_H = YesPlease
+ NO_R_TO_GCC_LINKER = YesPlease
endif
ifeq ($(uname_S),QNX)
COMPAT_CFLAGS += -DSA_RESTART=0
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:07 UTC
Permalink
When crosscompiling, one cannot rely on `uname` from host system.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
config.mak.uname | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/config.mak.uname b/config.mak.uname
index 9f7037e..182da50 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -14,6 +14,11 @@ ifdef MSVC
uname_O := Windows
endif

+ifneq (,$(findstring mingw,$(CC_MACH)))
+ uname_S := MINGW
+ uname_O := MINGW
+endif
+
# We choose to avoid "if .. else if .. else .. endif endif"
# because maintaining the nesting to match is a pain. If
# we had "elif" things would have been much nicer...
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:26:52 UTC
Permalink
Post by Marat Radchenko
When crosscompiling, one cannot rely on `uname` from host system.
That may well be true, but is that limited to cross-compiling to
mingw? Would it be generally true for any cross compilation,
wouldn't it?

What I am wondering is if it is a better solution to make it easier
to allow somebody who is cross compiling to express "Mr. Makefile,
we know better than you and want you to do a MINGW build for us
without checking with `uname -?` yourself", i.e.

$ make uname_O=MINGW uname_S=MINGW

which would hopefully allow cross-compilation into other
environments, not just MINGW.
Post by Marat Radchenko
---
config.mak.uname | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index 9f7037e..182da50 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -14,6 +14,11 @@ ifdef MSVC
uname_O := Windows
endif
+ifneq (,$(findstring mingw,$(CC_MACH)))
+ uname_S := MINGW
+ uname_O := MINGW
+endif
+
# We choose to avoid "if .. else if .. else .. endif endif"
# because maintaining the nesting to match is a pain. If
# we had "elif" things would have been much nicer...
--
2.1.1
--
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-09 05:03:18 UTC
Permalink
Post by Junio C Hamano
Post by Marat Radchenko
When crosscompiling, one cannot rely on `uname` from host system.
That may well be true, but is that limited to cross-compiling to
mingw? Would it be generally true for any cross compilation,
wouldn't it?
What I am wondering is if it is a better solution to make it easier
to allow somebody who is cross compiling to express "Mr. Makefile,
we know better than you and want you to do a MINGW build for us
without checking with `uname -?` yourself", i.e.
$ make uname_O=MINGW uname_S=MINGW
which would hopefully allow cross-compilation into other
environments, not just MINGW.
So, do you really want this patch to be changed from 5-liner into
a full-blow system detection rewrite based on `cc -dumpmachine`
instead of `uname`?
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 07:04:50 UTC
Permalink
Hi Marat,
Post by Marat Radchenko
Post by Junio C Hamano
Post by Marat Radchenko
When crosscompiling, one cannot rely on `uname` from host system.
That may well be true, but is that limited to cross-compiling to
mingw? Would it be generally true for any cross compilation,
wouldn't it?
What I am wondering is if it is a better solution to make it easier
to allow somebody who is cross compiling to express "Mr. Makefile,
we know better than you and want you to do a MINGW build for us
without checking with `uname -?` yourself", i.e.
$ make uname_O=MINGW uname_S=MINGW
which would hopefully allow cross-compilation into other
environments, not just MINGW.
So, do you really want this patch to be changed from 5-liner into
a full-blow system detection rewrite based on `cc -dumpmachine`
instead of `uname`?
Junio's responsibility as a maintainer is to keep this project afloat for
a broader audience than this patch series tries to reach. Keeping that in
mind, a patch that fixes a broad issue (in this case, cross-compiling)
*just* for one small use case (in this case, cross-compiling for Windows
using MinGW) might need a very good argument to convince the maintainer
that a broader solution is either not achievable or so much more
complicated that it is completely outside of the scope of this patch
series.

FWIW this is *exactly* what I pointed out here:

https://github.com/dscho/git/commit/e31124d4e8ba4e48181306198648cdfe73ff9c30#comments
Hmm. This is a very narrow solution to the underlying problem.
Just think about cross-compiling for e.g. MacOSX. The solution
presented in this commit works for MinGW, only for MinGW, and for
MinGW alone. The commit message needs to do a much better job to
make that clear.

And Junio actually pointed out that a broader solution is neither
impossible nor complex: Junio hinted at the use of the conditional
assignment "FOO ?= bar":

https://www.gnu.org/software/make/manual/make.html#index-_003f_003d

IMHO it would make tons of sense to replace the := assignments in
https://github.com/dscho/git/blob/e31124d4e8ba4e48181306198648cdfe73ff9c30/config.mak.uname#L3-L8
by ?= assignments.

Of course it is very obvious where the idea for the patch we are
discussing here comes from: the current config.mak.uname has this:

ifdef MSVC
# avoid the MingW and Cygwin configuration sections
uname_S := Windows
uname_O := Windows
endif

This could be cleaned up in the same run: to be assigned *before* the
conditional assignments of uname_S. Likewise, the MINGW-specific part
should be done by searching for "mingw" in CROSS_COMPILE, also before the
block of the uname_* variable assignments.

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-09 07:34:25 UTC
Permalink
Post by Marat Radchenko
...
Post by Junio C Hamano
What I am wondering is if it is a better solution to make it easier
to allow somebody who is cross compiling to express "Mr. Makefile,
we know better than you and want you to do a MINGW build for us
without checking with `uname -?` yourself", i.e.
$ make uname_O=MINGW uname_S=MINGW
which would hopefully allow cross-compilation into other
environments, not just MINGW.
So, do you really want this patch to be changed from 5-liner into
a full-blow system detection rewrite based on `cc -dumpmachine`
instead of `uname`?
No, and I do not quite see why you even need to look at -dumbmachine
output when your goal is to make this command line
Post by Marat Radchenko
Post by Junio C Hamano
$ make uname_O=MINGW uname_S=MINGW
work sensibly. Wouldn't it be more like a series of

ifndef uname_O
uname_O := $(shell uname -o)
endif

or something like that?
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 07:38:31 UTC
Permalink
Hi Junio,
Post by Junio C Hamano
Post by Marat Radchenko
...
Post by Junio C Hamano
What I am wondering is if it is a better solution to make it easier
to allow somebody who is cross compiling to express "Mr. Makefile,
we know better than you and want you to do a MINGW build for us
without checking with `uname -?` yourself", i.e.
$ make uname_O=MINGW uname_S=MINGW
which would hopefully allow cross-compilation into other
environments, not just MINGW.
So, do you really want this patch to be changed from 5-liner into
a full-blow system detection rewrite based on `cc -dumpmachine`
instead of `uname`?
No, and I do not quite see why you even need to look at -dumbmachine
Nice Freudian ;-)
Post by Junio C Hamano
output when your goal is to make this command line
Post by Marat Radchenko
Post by Junio C Hamano
$ make uname_O=MINGW uname_S=MINGW
work sensibly. Wouldn't it be more like a series of
ifndef uname_O
uname_O := $(shell uname -o)
endif
or something like that?
Or uname_O ?= $(shell uname -o)

To clarify: it would be enough to look at CROSS_COMPILE to determine
whether we're cross-compiling for MinGW.

The output of -dumpmachine is still needed for the correct CFLAGS/LDFLAGS.

Ciao,
Dscho
Johannes Schindelin
2014-10-09 10:18:51 UTC
Permalink
Hi Junio,
Isn't the primary reason we use colon-assign to avoid running the same
$(shell) over and over again every time $(uname_?) gets referenced? How
would it work with ?= ???
I was under the impression that ?= would only define the variable once,
the next time ?= would be encountered, no assignment (and actually, no
evaluation) would take place because the variable already has a value?

According to

https://www.gnu.org/software/make/manual/make.html#index-_003f_003d

FOO ?= bar

is exactly equivalent to this (see The origin Function):

ifeq ($(origin FOO), undefined)
FOO = bar
endif
Pardon misspellings and grammos, typed on a tablet.
No worries. But you really should use your tablet for reading books after
midnight instead of doing work... ;-)

Ciao,
Dscho
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 15:49:55 UTC
Permalink
Hi Junio,
I didn't mean multiple uses of ?= for the same variable. I meant
multiple uses of (references to) the variable. I.e. wouldn't FOO and
BAR behave differently below?
FOO := $(shell random)
BAR = $(shell random)
echo $(FOO) and $(BAR)
echo twice $(FOO) and $(BAR)
You're correct, of course, my mistake. I just tested with this:

R ?= $(shell echo $$RANDOM)

all:
echo The values of $(R), $(R) and $(R)

and of course a "make" yields three different numbers. Sorry for missing
that.

So what we should do is something like

ifeq ($(uname_S),)
uname_S := $(shell uname -s)
endif

even if repeating that pattern is kind of ugly...

Thanks for correcting my mistake,
Dscho
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-09 08:48:49 UTC
Permalink
Post by Junio C Hamano
No, and I do not quite see why you even need to look at -dumbmachine
output when your goal is to make this command line
Post by Junio C Hamano
$ make uname_O=MINGW uname_S=MINGW
work sensibly. Wouldn't it be more like a series of
ifndef uname_O
uname_O := $(shell uname -o)
endif
or something like that?
I don't want to tell `make` my system name several times. It should be
possible to infer system type from CC.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:03 UTC
Permalink
To ease cross-compilation process, introduce a single variable
with the prefix to all compiler-related executables.

Define CROSS_COMPILE=foo- if your compiler and binary utilities
are foo-cc, foo-ar, foo-strip, etc. More specific variables
override this, so if you set CC=gcc CROSS_COMPILE=ia64-linux-gnu-
then the compiler will be 'gcc', not 'ia64-linux-gnu-gcc'.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
Makefile | 19 +++++++++++++------
config.mak.uname | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index f34a2d4..c412996 100644
--- a/Makefile
+++ b/Makefile
@@ -339,6 +339,11 @@ all::
# return NULL when it receives a bogus time_t.
#
# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
+#
+# Define CROSS_COMPILE=foo- if your compiler and binary utilities
+# are foo-cc, foo-ar, foo-strip, etc. More specific variables
+# override this, so if you set CC=gcc CROSS_COMPILE=ia64-linux-gnu-
+# then the compiler will be 'gcc', not 'ia64-linux-gnu-gcc'.

GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -350,7 +355,6 @@ CFLAGS = -g -O2 -Wall
LDFLAGS =
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
-STRIP ?= strip

# Among the variables below, these:
# gitexecdir
@@ -390,8 +394,12 @@ htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))

export prefix bindir sharedir sysconfdir gitwebdir localedir

-CC = cc
-AR = ar
+AR = $(CROSS_COMPILE)ar
+CC = $(CROSS_COMPILE)cc
+GCOV = $(CROSS_COMPILE)gcov
+RC = $(CROSS_COMPILE)windres
+STRIP = $(CROSS_COMPILE)strip
+
RM = rm -f
DIFF = diff
TAR = tar
@@ -404,13 +412,12 @@ XGETTEXT = xgettext
MSGFMT = msgfmt
PTHREAD_LIBS = -lpthread
PTHREAD_CFLAGS =
-GCOV = gcov

export TCL_PATH TCLTK_PATH

SPARSE_FLAGS =

-
+RCFLAGS =

### --- END CONFIGURATION SECTION ---

@@ -1669,7 +1676,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
mv $@+ $@

git.res: git.rc GIT-VERSION-FILE
- $(QUIET_RC)$(RC) \
+ $(QUIET_RC)$(RC) $(RCFLAGS) \
$(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@

diff --git a/config.mak.uname b/config.mak.uname
index f79c0e0..9f7037e 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -523,7 +523,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
- RC = windres -O coff
+ RCFLAGS += -O coff
NATIVE_CRLF = YesPlease
X = .exe
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:25:56 UTC
Permalink
Post by Marat Radchenko
To ease cross-compilation process, introduce a single variable
with the prefix to all compiler-related executables.
Define CROSS_COMPILE=foo- if your compiler and binary utilities
are foo-cc, foo-ar, foo-strip, etc. More specific variables
override this, so if you set CC=gcc CROSS_COMPILE=ia64-linux-gnu-
then the compiler will be 'gcc', not 'ia64-linux-gnu-gcc'.
---
Makefile | 19 +++++++++++++------
config.mak.uname | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index f34a2d4..c412996 100644
--- a/Makefile
+++ b/Makefile
# return NULL when it receives a bogus time_t.
#
# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
+#
+# Define CROSS_COMPILE=foo- if your compiler and binary utilities
+# are foo-cc, foo-ar, foo-strip, etc. More specific variables
+# override this, so if you set CC=gcc CROSS_COMPILE=ia64-linux-gnu-
+# then the compiler will be 'gcc', not 'ia64-linux-gnu-gcc'.
I think you forgot the "default to empty", i.e.

CROSS_COMPILE =

somewhere to prevent stray an environment variable from affecting
the build (which you did correctly for RCFLAGS).
Post by Marat Radchenko
GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -350,7 +355,6 @@ CFLAGS = -g -O2 -Wall
LDFLAGS =
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
-STRIP ?= strip
# gitexecdir
@@ -390,8 +394,12 @@ htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
export prefix bindir sharedir sysconfdir gitwebdir localedir
-CC = cc
-AR = ar
+AR = $(CROSS_COMPILE)ar
+CC = $(CROSS_COMPILE)cc
+GCOV = $(CROSS_COMPILE)gcov
+RC = $(CROSS_COMPILE)windres
+STRIP = $(CROSS_COMPILE)strip
+
RM = rm -f
DIFF = diff
TAR = tar
@@ -404,13 +412,12 @@ XGETTEXT = xgettext
MSGFMT = msgfmt
PTHREAD_LIBS = -lpthread
PTHREAD_CFLAGS =
-GCOV = gcov
export TCL_PATH TCLTK_PATH
SPARSE_FLAGS =
-
+RCFLAGS =
### --- END CONFIGURATION SECTION ---
@@ -1669,7 +1676,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
git.res: git.rc GIT-VERSION-FILE
- $(QUIET_RC)$(RC) \
+ $(QUIET_RC)$(RC) $(RCFLAGS) \
$(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
diff --git a/config.mak.uname b/config.mak.uname
index f79c0e0..9f7037e 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -523,7 +523,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
- RC = windres -O coff
+ RCFLAGS += -O coff
NATIVE_CRLF = YesPlease
X = .exe
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
--
2.1.1
--
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:06 UTC
Permalink
Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
git-compat-util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index b338277..101c9d7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
#endif

#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))

#ifdef NO_PREAD
#define pread git_pread
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:22:44 UTC
Permalink
Post by Marat Radchenko
---
git-compat-util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b338277..101c9d7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
#endif
#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
large enough? Just checking.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 20:02:10 UTC
Permalink
Post by Junio C Hamano
Post by Marat Radchenko
---
git-compat-util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b338277..101c9d7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
#endif
#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
large enough? Just checking.
Heh, I was being silly. This gives the default value for a variable
whose type is size_t, so it would better fit. So please throw 13 in
the list of changes I found sensible in the other message.

Thanks.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-09 05:05:41 UTC
Permalink
Post by Junio C Hamano
Post by Junio C Hamano
Post by Marat Radchenko
---
git-compat-util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b338277..101c9d7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
#endif
#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
large enough? Just checking.
Heh, I was being silly. This gives the default value for a variable
whose type is size_t, so it would better fit. So please throw 13 in
the list of changes I found sensible in the other message.
Is it an Acked-by?
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-09 07:31:07 UTC
Permalink
Post by Marat Radchenko
Post by Junio C Hamano
Post by Junio C Hamano
Post by Marat Radchenko
---
git-compat-util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b338277..101c9d7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -474,7 +474,7 @@ extern int git_munmap(void *start, size_t length);
#endif
#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
large enough? Just checking.
Heh, I was being silly. This gives the default value for a variable
whose type is size_t, so it would better fit. So please throw 13 in
the list of changes I found sensible in the other message.
Is it an Acked-by?
Not really. It just shows that the change needs to be explained
well in the proposed log message.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 06:08:31 UTC
Permalink
Hi Junio,
Post by Junio C Hamano
Post by Marat Radchenko
#define DEFAULT_PACKED_GIT_LIMIT \
- ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
+ ((size_t)(1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
1024 * 1024 * 8192 overflows 32-bit unsigned, but is size_t always
large enough? Just checking.
The diff is a bit misleading as to what it *actually* changes. It *just*
casts the result to size_t. The arithmetic is performed with longs (thanks
to the "l" in 1024l) and it only overflows 32 bit iff the sizeof() test
verifies that we're at least on 64 bit -- this arithmetic operation is the
same as before the patch. I was fooled by the diff myself (adding another
parenthesis just to add the cast would probably have helped, though).

IMHO this is a good demonstration how a commit message that goes slightly
beyond the necessary can help tons of time by avoiding to let every
reviewer/reader go through the exact same steps of puzzlement.

Ciao,
Dscho
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:05 UTC
Permalink
This commit touches regcomp.c from Gnulib,
was fixed upstream in 3a4836d1.

This commit also touches poll.c from Gnulib,
was fixed upstream in d295f6c5.

This commit also touches regex_internal.h from Gnulib,
was fixed upstream in 8335a4d6.

Wrt ShellExecute in winansi.c, quoting [1]:

MSDN says you can cast the result to an integer and compare the result
against 32... You could cast in the other direction, comparing the return
value against (HINSTANCE)32... Or you could cast the result to an INT_PTR
and compare the result against 32.

We use the third option: cast HINSTANCE to intptr_t.

[1]: http://blogs.msdn.com/b/oldnewthing/archive/2006/11/08/1035971.aspx

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
compat/mingw.c | 8 ++++----
compat/poll/poll.c | 2 +-
compat/regex/regcomp.c | 4 ++--
compat/regex/regex_internal.h | 1 +
compat/win32/pthread.h | 2 +-
compat/winansi.c | 2 +-
pack-revindex.c | 2 +-
sha1_file.c | 8 ++++----
8 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index c5c37e5..27925d9 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -674,13 +674,13 @@ int pipe(int filedes[2])
errno = err_win_to_posix(GetLastError());
return -1;
}
- filedes[0] = _open_osfhandle((int)h[0], O_NOINHERIT);
+ filedes[0] = _open_osfhandle((intptr_t)h[0], O_NOINHERIT);
if (filedes[0] < 0) {
CloseHandle(h[0]);
CloseHandle(h[1]);
return -1;
}
- filedes[1] = _open_osfhandle((int)h[1], O_NOINHERIT);
+ filedes[1] = _open_osfhandle((intptr_t)h[1], O_NOINHERIT);
if (filedes[0] < 0) {
close(filedes[0]);
CloseHandle(h[1]);
@@ -1819,7 +1819,7 @@ void mingw_open_html(const char *unixpath)
const char *, const char *, const char *, INT);
T ShellExecute;
HMODULE shell32;
- int r;
+ intptr_t r;

shell32 = LoadLibrary("shell32.dll");
if (!shell32)
@@ -1829,7 +1829,7 @@ void mingw_open_html(const char *unixpath)
die("cannot run browser");

printf("Launching default browser to display HTML ...\n");
- r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL);
+ r = (intptr_t)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL);
FreeLibrary(shell32);
/* see the MSDN documentation referring to the result codes here */
if (r <= 32) {
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index a9b41d8..8941249 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -76,7 +76,7 @@

#ifdef WIN32_NATIVE

-#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
+#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)

static BOOL
IsSocketHandle (HANDLE h)
diff --git a/compat/regex/regcomp.c b/compat/regex/regcomp.c
index 06f3088..d8bde06 100644
--- a/compat/regex/regcomp.c
+++ b/compat/regex/regcomp.c
@@ -2577,7 +2577,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
old_tree = NULL;

if (elem->token.type == SUBEXP)
- postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
+ postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);

tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
if (BE (tree == NULL, 0))
@@ -3806,7 +3806,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
static reg_errcode_t
mark_opt_subexp (void *extra, bin_tree_t *node)
{
- int idx = (int) (long) extra;
+ int idx = (int) (intptr_t) extra;
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
node->token.opt_subexp = 1;

diff --git a/compat/regex/regex_internal.h b/compat/regex/regex_internal.h
index 4184d7f..da12670 100644
--- a/compat/regex/regex_internal.h
+++ b/compat/regex/regex_internal.h
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>

#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
# include <langinfo.h>
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index 8ad1873..6ccfb7b 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -77,7 +77,7 @@ extern pthread_t pthread_self(void);

static inline int pthread_exit(void *ret)
{
- ExitThread((DWORD)ret);
+ ExitThread((DWORD)(uintptr_t)ret);
}

typedef DWORD pthread_key_t;
diff --git a/compat/winansi.c b/compat/winansi.c
index 0ac3297..ca4c295 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -452,7 +452,7 @@ static HANDLE duplicate_handle(HANDLE hnd)
HANDLE hresult, hproc = GetCurrentProcess();
if (!DuplicateHandle(hproc, hnd, hproc, &hresult, 0, TRUE,
DUPLICATE_SAME_ACCESS))
- die_lasterr("DuplicateHandle(%li) failed", (long) hnd);
+ die_lasterr("DuplicateHandle(%p) failed", hnd);
return hresult;
}

diff --git a/pack-revindex.c b/pack-revindex.c
index 5c8376e..df02e9f 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;

static int pack_revindex_ix(struct packed_git *p)
{
- unsigned long ui = (unsigned long)p;
+ uintptr_t ui = (uintptr_t)p;
int i;

ui = ui ^ (ui >> 16); /* defeat structure alignment */
diff --git a/sha1_file.c b/sha1_file.c
index c08c0cb..a534fda 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1966,11 +1966,11 @@ static struct delta_base_cache_entry {
enum object_type type;
} delta_base_cache[MAX_DELTA_CACHE];

-static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)
+static uintptr_t pack_entry_hash(struct packed_git *p, off_t base_offset)
{
- unsigned long hash;
+ uintptr_t hash;

- hash = (unsigned long)p + (unsigned long)base_offset;
+ hash = (uintptr_t)p + base_offset;
hash += (hash >> 8) + (hash >> 16);
return hash % MAX_DELTA_CACHE;
}
@@ -1978,7 +1978,7 @@ static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)
static struct delta_base_cache_entry *
get_delta_base_cache_entry(struct packed_git *p, off_t base_offset)
{
- unsigned long hash = pack_entry_hash(p, base_offset);
+ uintptr_t hash = pack_entry_hash(p, base_offset);
return delta_base_cache + hash;
}
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-08 18:01:04 UTC
Permalink
1. Unlike MinGW, MinGW-W64 already provides _ReadWriteBarrier macro,
so don't try to redefine it.

2. MinGW-W64 has a strange definition FORCEINLINE as
extern __inline__ __attribute__((__always_inline__,__gnu_inline__))

'extern' doesn't work together with 'static', so #undef MinGW-W64
version of FORCEINLINE.

Signed-off-by: Marat Radchenko <***@slonopotamus.org>
---
compat/nedmalloc/malloc.c.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h
index f216a2a..a6c8cac 100644
--- a/compat/nedmalloc/malloc.c.h
+++ b/compat/nedmalloc/malloc.c.h
@@ -715,6 +715,10 @@ struct mallinfo {
#endif /* HAVE_USR_INCLUDE_MALLOC_H */
#endif /* NO_MALLINFO */

+#ifdef __MINGW64_VERSION_MAJOR
+ #undef FORCEINLINE
+#endif
+
/*
Try to persuade compilers to inline. The most critical functions for
inlining are defined as macros, so these aren't used for them.
@@ -1382,7 +1386,9 @@ LONG __cdecl _InterlockedExchange(LONG volatile *Target, LONG Value);

/*** Atomic operations ***/
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
- #define _ReadWriteBarrier() __sync_synchronize()
+ #ifndef _ReadWriteBarrier
+ #define _ReadWriteBarrier() __sync_synchronize()
+ #endif
#else
static __inline__ __attribute__((always_inline)) long __sync_lock_test_and_set(volatile long * const Target, const long Value)
{
--
2.1.1
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano
2014-10-08 19:23:30 UTC
Permalink
Post by Marat Radchenko
This patch series fixes building on modern MinGW and MinGW-W64 (including x86_64).
As Dscho explained in a sub-thread, I really do not want to bypass
msysgit folks when dealing with things that relate to Windows, for
at least two reasons:

* I can be a patch monkey and apply them to my tree but then I
would be pushing out changes that I didn't try out myself
otherwise. Granted, that is true for platforms other than
Windows that I do not regularly build and test on, but when I
know there are capable folks who have been working on Windows
issues for a long time, not asking for their help does not make
much sense.

* They still have other changes that are yet to be fed to my tree,
and I do not actively track and compare their tree. A patch
series prepared against my tree may collide with their ongoing
effort to make Git on Windows platform better and risk making
more work for them, not less.

The earlier part of your series (including the ones that were Acked
by EFL) looked sensible to me: 1-6, 9, 11, 12 (outside compat/ part
only).

I could take them directly to my tree, but that is still on "as long
as msysgit folks are OK with them" basis.

Thanks.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 10:11:01 UTC
Permalink
Hi all,
Post by Marat Radchenko
This patch series fixes building on modern MinGW and MinGW-W64
(including x86_64).
To make it more convenient to work on this patch series using Git, I
pushed this branch to

https://github.com/dscho/git/compare/git:master...w64-slonopotamus

I also added one patch I find highly convenient:

https://github.com/dscho/git/commit/29749c7d7b4638c63369d6cf067f5d524d0092f9

-- snipsnap --
Subject: [PATCH] MinGW-w64: Work around bug in MinGW-w64's winuser.h

This allows contributors to compile 64-bit Windows builds of Git without
forcing them to use an unstable version of MinGW-w64.

Signed-off-by: Johannes Schindelin <***@gmx.de>
---
compat/poll/poll.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index 8941249..dcbcbaf 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -76,6 +76,18 @@

#ifdef WIN32_NATIVE

+/*
+ * Work around https://sourceforge.net/p/mingw-w64/bugs/397. In short, some
+ * definitions were put into the GUI-only section of winuser.h by mistake
+ * in MinGW-w64 versions up to 3.1.0.
+ */
+#ifndef QS_ALLINPUT
+#define QS_ALLINPUT 0xff
+extern WINUSERAPI DWORD WINAPI MsgWaitForMultipleObjects(DWORD nCount,
+ CONST HANDLE *pHandles, WINBOOL fWaitAll, DWORD dwMilliseconds,
+ DWORD dwWakeMask);
+#endif
+
#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)

static BOOL
--
2.0.0.rc3.9669.g840d1f9
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marat Radchenko
2014-10-09 10:39:21 UTC
Permalink
Post by Johannes Schindelin
https://github.com/dscho/git/commit/29749c7d7b4638c63369d6cf067f5d524d0092f9
There already were two attempts to this issue:

1. http://www.spinics.net/lists/git/msg230028.html
2. http://www.spinics.net/lists/git/msg229822.html

Neither of them was accepted to git.git. I doubt your one will be.
--
--
*** 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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin
2014-10-09 10:59:28 UTC
Permalink
Hi Marat,
Post by Marat Radchenko
Post by Johannes Schindelin
https://github.com/dscho/git/commit/29749c7d7b4638c63369d6cf067f5d524d0092f9
1. http://www.spinics.net/lists/git/msg230028.html
2. http://www.spinics.net/lists/git/msg229822.html
Neither of them was accepted to git.git. I doubt your one will be.
I would guess that they were not accepted mostly because they were not
coordinated with the Windows developers on the msysGit mailing list.

Let's fix the rest of the issues, and then we can always carry this patch
in Git for Windows until MinGW-w64 3.1.1 (or 3.2.0) is released.

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 ***@googlegroups.com
To unsubscribe from this group, send email to
msysgit+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Search results for '[PATCH v5] MinGW(-W64) compilation' (Questions and Answers)
4
replies
Where do i found turbo c Compiler Free of cost?
started 2007-05-03 04:59:54 UTC
programming & design
Loading...