Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-09 Thread Junio C Hamano
Junio C Hamano  writes:

> Johannes Schindelin  writes:
>
>> In any case, it does not break things, and it helps Cygwin, so: ACK
>>
>> Ciao,
>> Dscho
>>
>> P.S.: I pushed this to Git for Windows' `master`, too:
>> https://github.com/git-for-windows/git/commit/f05a26948b
>
> Hmm, I peeked it hoping that you corrected the log message along the
> lines of your , but
> it appears that what you queued does not have any extra mention of
> cygwin or specifics of the buildchain on top of what Steven posted?

Ah, false alarm.  It does have s/Windows/Cygwin/; I trust your
judgement that that change makes the context clear enough for those
involved in Git for Windows, msysGit and Cygwin port.

Will queue it together with the other one from Steven.

Thanks.


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-09 Thread Junio C Hamano
Johannes Schindelin  writes:

> In any case, it does not break things, and it helps Cygwin, so: ACK
>
> Ciao,
> Dscho
>
> P.S.: I pushed this to Git for Windows' `master`, too:
> https://github.com/git-for-windows/git/commit/f05a26948b

Hmm, I peeked it hoping that you corrected the log message along the
lines of your , but
it appears that what you queued does not have any extra mention of
cygwin or specifics of the buildchain on top of what Steven posted?



Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-09 Thread Junio C Hamano
Johannes Schindelin  writes:

> ...
> It is a bit curious that -lws2_32 *does* only show up in $(LIBS), but I
> guess it is simply the fact that we use a newer GCC (gcc.exe (Rev2, Built
> by MSYS2 project) 6.2.0) that allows Git for Windows to be built even
> without this patch.
>
> In any case, it does not break things, and it helps Cygwin, so: ACK

Thanks, will queue on my side, too.


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-09 Thread Johannes Schindelin
Hi Junio,

On Sun, 8 Jan 2017, Junio C Hamano wrote:

> Johannes Schindelin  writes:
> 
> > On Sun, 8 Jan 2017, Steven Penny wrote:
> >
> >> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
> >> > I am curious: how do you build Git? I ask because I build Git on
> >> > Windows many times a day, and I did not encounter any link
> >> > problems.
> >> 
> >> My end goal is to build static native Windows Git via Cygwin and the
> >> mingw64-x86_64-gcc-core package.
> >
> > That is certainly a worthy goal, and I would highly recommend to
> > mention that particular cross-compiling setup in the commit message.
> > It's not like this is the easiest way to build native Git on
> > Windows...
> 
> In addition to the patch being explained well, I also care that it
> does not break existing builds.  I do not think it is the case for
> you, and I do think the patch does the right thing, but just double
> checking to see if you have objections to the change itself.

I just double-checked and it still builds fine on Git for Windows (as
expected).

The reason it seems to have worked before, too, is that somehow -lcrypto
does not require gdi32.dll here. As a matter of fact, we do not link with
gdi32 at all:

$ printf 'include Makefile\nprint:\n\t@%s\n\t@%s\n\t@%s\n' \
'echo all: $(ALL_LDFLAGS)' \
'echo libs: $(LIBS)' \
'echo imap: $(IMAP_SEND_LDFLAGS)' |
  make -f - print

all: -Wl,--nxcompat -Wl,--dynamicbase -Wl,--pic-executable,-e,mainCRTStartup
libs: libgit.a xdiff/lib.a git.res -lws2_32 -lntdll -lpcre -lz -liconv -lintl 
-lcrypto
imap: -lcurl -lssl -lcrypto -lcrypto

It is a bit curious that -lws2_32 *does* only show up in $(LIBS), but I
guess it is simply the fact that we use a newer GCC (gcc.exe (Rev2, Built
by MSYS2 project) 6.2.0) that allows Git for Windows to be built even
without this patch.

In any case, it does not break things, and it helps Cygwin, so: ACK

Ciao,
Dscho

P.S.: I pushed this to Git for Windows' `master`, too:
https://github.com/git-for-windows/git/commit/f05a26948b


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-08 Thread Junio C Hamano
Johannes Schindelin  writes:

> Hi Steven,
>
> On Sun, 8 Jan 2017, Steven Penny wrote:
>
>> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
>> > I am curious: how do you build Git? I ask because I build Git on Windows
>> > many times a day, and I did not encounter any link problems.
>> 
>> My end goal is to build static native Windows Git via Cygwin and the
>> mingw64-x86_64-gcc-core package.
>
> That is certainly a worthy goal, and I would highly recommend to mention
> that particular cross-compiling setup in the commit message. It's not like
> this is the easiest way to build native Git on Windows...

In addition to the patch being explained well, I also care that it
does not break existing builds.  I do not think it is the case for
you, and I do think the patch does the right thing, but just double
checking to see if you have objections to the change itself.

Thanks.


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-08 Thread Johannes Schindelin
Hi Steven,

On Sun, 8 Jan 2017, Steven Penny wrote:

> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
> > I am curious: how do you build Git? I ask because I build Git on Windows
> > many times a day, and I did not encounter any link problems.
> 
> My end goal is to build static native Windows Git via Cygwin and the
> mingw64-x86_64-gcc-core package.

That is certainly a worthy goal, and I would highly recommend to mention
that particular cross-compiling setup in the commit message. It's not like
this is the easiest way to build native Git on Windows...

Ciao,
Johannes


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-08 Thread Steven Penny
On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
> I am curious: how do you build Git? I ask because I build Git on Windows
> many times a day, and I did not encounter any link problems.

My end goal is to build static native Windows Git via Cygwin and the
mingw64-x86_64-gcc-core package. This is certainly possible but definitely not
considered in the current Git codebase. I have a patch to config.mak.uname
coming as well.


Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-08 Thread Johannes Schindelin
Hi Steven,

On Sun, 8 Jan 2017, Steven Penny wrote:

> This matches up with the targets git-%, git-http-fetch, git-http-push
> and git-remote-testsvn. It must be done this way on Windows else lcrypto
> cannot find lgdi32 and lws2_32

I am curious: how do you build Git? I ask because I build Git on Windows
many times a day, and I did not encounter any link problems. This hints at
a difference of build environment (I use the Git for Windows SDK) that
needs to be mentioned in the commit message.

Ciao,
Johannes


[PATCH] Makefile: put LIBS after LDFLAGS for imap-send

2017-01-07 Thread Steven Penny
This matches up with the targets git-%, git-http-fetch, git-http-push and
git-remote-testsvn. It must be done this way on Windows else lcrypto cannot find
lgdi32 and lws2_32

Signed-off-by: Steven Penny 
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index d861bd9..f0f65ea 100644
--- a/Makefile
+++ b/Makefile
@@ -2046,7 +2046,7 @@ git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
 
 git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-   $(LIBS) $(IMAP_SEND_LDFLAGS)
+   $(IMAP_SEND_LDFLAGS) $(LIBS)
 
 git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- 
2.8.3