Re: [NOT_A_PATCH] A naive attempt to cross-build Linux-mingw64 Git

2014-04-22 Thread Johannes Schindelin
Hi Marat,

On Tue, 22 Apr 2014, Marat Radchenko wrote:

 Johannes says building mingw64 Git is dirt-easy.

Marat, please let's stop misquoting me, okay?

What I said was more along the lines that there had been some start of a
work on getting things to compile for 64-bit Windows, but that the test
suite did not pass.

Even cutting out the part about the test suite from quoting me leaves out
the main point of what I said.

And for the record: I just had a look; the beginnings of W64 support are
in https://github.com/msysgit/git/compare/7f37564...work/w64.

And again for the record: at least from my side, there is more than just
willingness to cooperate. We'd just need to start a conversation in the
second person (as opposed to the third person).

Ciao,
Johannes
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NOT_A_PATCH] A naive attempt to cross-build Linux-mingw64 Git

2014-04-22 Thread Felipe Contreras
Marat Radchenko wrote:
 On Mon, Apr 21, 2014 at 07:06:24PM -0500, Felipe Contreras wrote:
  I managed to fix all the errors, some apply to newer mingw, regardless of 
  32 or
  64, others are specific to 64-bit. It's all hacky and I haven't checked if 
  it
  runs, but at least it compiles (mostly).
 
 Do you plan to evolve it into something mergeable?

I might, but that would requiere a lot of effort to investigate the changes in
mingw, and I'm not sure if there's enough interest on this.

After fixing all the issues so that we can cross-compile, I would like to see a
real effort to move away from shell and perl scripts, so that we not only could
run the important commands, but properly test Git without bash, otherwise I
feel Windows will always be a second class citizen.

 P.S. besides CC/LD, I also had to define AR and fix `windres` executable name 
 in `config.mak.uname`.

That's why we should have a CROSS_COMPILE variable which is standard in other 
projects.

This is what the Linux kernel has:

  AS= $(CROSS_COMPILE)as
  LD= $(CROSS_COMPILE)ld
  CC= $(CROSS_COMPILE)gcc
  AR= $(CROSS_COMPILE)ar
  NM= $(CROSS_COMPILE)nm
  STRIP = $(CROSS_COMPILE)strip
  OBJCOPY   = $(CROSS_COMPILE)objcopy
  OBJDUMP   = $(CROSS_COMPILE)objdump

I had patches for this, but I gave them up =/

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NOT_A_PATCH] A naive attempt to cross-build Linux-mingw64 Git

2014-04-21 Thread Marat Radchenko
config.mak.uname: provide a way to explicitely request MinGW build.
This is required to perform Linux-MinGW crosscompilation.
---

 Personally I don't see why ideally I shouldn't be able to build upstream Git
 for Windows with mingw without leaving my Linux system.

One day you might be able, but as of today...

1. Obtain x86_64-w64-mingw32 compiler for your *nix distro
 * [Gentoo] emerge crossdev  crossdev -t x86_64-w64-mingw32
 * [Debian/Ubuntu] apt-get install mingw-w64
2. Apply patch from this email to Git sources (git/git or msysgit/git - doesn't 
matter)
3. `make CC=x86_64-w64-mingw32-gcc MINGW=1`
4. Observe errors [1]

I would be happy to find out I'm doing something wrong -- Johannes says building
mingw64 Git is dirt-easy.

[1]:
In file included from /usr/x86_64-w64-mingw32/usr/include/windows.h:9:0,
 from /usr/x86_64-w64-mingw32/usr/include/winsock2.h:23,
 from git-compat-util.h:93,
 from cache.h:4,
 from credential-store.c:1:
/usr/x86_64-w64-mingw32/usr/include/_mingw.h:456:2: error: #error You cannot 
use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
  ^
In file included from git-compat-util.h:134:0,
 from cache.h:4,
 from credential-store.c:1:
compat/mingw.h:8:13: error: conflicting types for 'pid_t'
 typedef int pid_t;
 ^
In file included from /usr/x86_64-w64-mingw32/usr/include/process.h:12:0,
 from /usr/x86_64-w64-mingw32/usr/include/unistd.h:11,
 from git-compat-util.h:98,
 from cache.h:4,
 from credential-store.c:1:
/usr/x86_64-w64-mingw32/usr/include/sys/types.h:68:16: note: previous 
declaration of 'pid_t' was here
 typedef _pid_t pid_t;
^

 config.mak.uname | 5 +
 1 file changed, 5 insertions(+)

diff --git a/config.mak.uname b/config.mak.uname
index 82b8dff..4f4d84f 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -13,6 +13,11 @@ ifdef MSVC
uname_O := Windows
 endif
 
+ifdef MINGW
+   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...
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [NOT_A_PATCH] A naive attempt to cross-build Linux-mingw64 Git

2014-04-21 Thread Felipe Contreras
Marat Radchenko wrote:
 config.mak.uname: provide a way to explicitely request MinGW build.
 This is required to perform Linux-MinGW crosscompilation.
 ---
 
  Personally I don't see why ideally I shouldn't be able to build upstream Git
  for Windows with mingw without leaving my Linux system.
 
 One day you might be able, but as of today...
 
 1. Obtain x86_64-w64-mingw32 compiler for your *nix distro
  * [Gentoo] emerge crossdev  crossdev -t x86_64-w64-mingw32
  * [Debian/Ubuntu] apt-get install mingw-w64

Note that I didn't say 64-bit. Baby steps, first the tried-and-true 32-bit 
compiler.

 2. Apply patch from this email to Git sources (git/git or msysgit/git - 
 doesn't matter)

Funny I came with almost exactly the same patch.

 3. `make CC=x86_64-w64-mingw32-gcc MINGW=1`

I did:

% make CC=i486-mingw32-gcc NO_OPENSSL=1 NO_GETTEXT=1

But ideally it should be:

% make CROSS_COMPILE=i486-mingw32-

(or whatever the name of the suite)

 4. Observe errors [1]

I see those errors with a 64-bit compiler, but not with the old 32-bit one.

 I would be happy to find out I'm doing something wrong -- Johannes says 
 building
 mingw64 Git is dirt-easy.

I get the same error. I've been cross-compiling since basically all my
professional life, so I don't think you are doing something wrong, it just
doesn't work.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html