git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
@ 2017-01-08  6:12 Steven Penny
  2017-01-08 11:54 ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Penny @ 2017-01-08  6:12 UTC (permalink / raw)
  To: git; +Cc: 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 <svnpenn@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-08  6:12 [PATCH] Makefile: put LIBS after LDFLAGS for imap-send Steven Penny
@ 2017-01-08 11:54 ` Johannes Schindelin
  2017-01-08 15:12   ` Steven Penny
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2017-01-08 11:54 UTC (permalink / raw)
  To: Steven Penny; +Cc: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-08 11:54 ` Johannes Schindelin
@ 2017-01-08 15:12   ` Steven Penny
  2017-01-08 18:54     ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Penny @ 2017-01-08 15:12 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-08 15:12   ` Steven Penny
@ 2017-01-08 18:54     ` Johannes Schindelin
  2017-01-09  3:07       ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2017-01-08 18:54 UTC (permalink / raw)
  To: Steven Penny; +Cc: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-08 18:54     ` Johannes Schindelin
@ 2017-01-09  3:07       ` Junio C Hamano
  2017-01-09 10:49         ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2017-01-09  3:07 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steven Penny, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-09  3:07       ` Junio C Hamano
@ 2017-01-09 10:49         ` Johannes Schindelin
  2017-01-09 14:23           ` Junio C Hamano
  2017-01-09 14:27           ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Johannes Schindelin @ 2017-01-09 10:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Steven Penny, git

Hi Junio,

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

> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-09 10:49         ` Johannes Schindelin
@ 2017-01-09 14:23           ` Junio C Hamano
  2017-01-09 14:27           ` Junio C Hamano
  1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2017-01-09 14:23 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steven Penny, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-09 10:49         ` Johannes Schindelin
  2017-01-09 14:23           ` Junio C Hamano
@ 2017-01-09 14:27           ` Junio C Hamano
  2017-01-09 14:31             ` Junio C Hamano
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2017-01-09 14:27 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steven Penny, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> 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 <alpine.DEB.2.20.1701081953330.3469@virtualbox>, 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?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
  2017-01-09 14:27           ` Junio C Hamano
@ 2017-01-09 14:31             ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2017-01-09 14:31 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steven Penny, git

Junio C Hamano <gitster@pobox.com> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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 <alpine.DEB.2.20.1701081953330.3469@virtualbox>, 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-09 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-08  6:12 [PATCH] Makefile: put LIBS after LDFLAGS for imap-send Steven Penny
2017-01-08 11:54 ` Johannes Schindelin
2017-01-08 15:12   ` Steven Penny
2017-01-08 18:54     ` Johannes Schindelin
2017-01-09  3:07       ` Junio C Hamano
2017-01-09 10:49         ` Johannes Schindelin
2017-01-09 14:23           ` Junio C Hamano
2017-01-09 14:27           ` Junio C Hamano
2017-01-09 14:31             ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).