{"thread":{"id":"44835","subject":"[PATCH] Makefile: put LIBS after LDFLAGS for imap-send","startedAt":"2017-01-08T06:13:21Z","lastAt":"2017-01-09T14:31:49Z","messageCount":9,"participants":["Steven Penny","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"308951","messageId":"20170108061238.2604-1-svnpenn@gmail.com","threadId":"44835","inReplyTo":null,"subject":"[PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Steven Penny","fromEmail":"svnpenn@gmail.com","sentAt":"2017-01-08T06:12:38Z","receivedAt":"2017-01-08T06:13:21Z","isPatch":true,"sender":{"key":"svnpenn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/60531334?v=4"},"body":"This matches up with the targets git-%, git-http-fetch, git-http-push and\ngit-remote-testsvn. It must be done this way on Windows else lcrypto cannot find\nlgdi32 and lws2_32\n\nSigned-off-by: Steven Penny <svnpenn@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex d861bd9..f0f65ea 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2046,7 +2046,7 @@ git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n \n git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n-\t\t$(LIBS) $(IMAP_SEND_LDFLAGS)\n+\t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n \n git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n-- \n2.8.3\n\n"},{"id":"308961","messageId":"alpine.DEB.2.20.1701081250580.3469@virtualbox","threadId":"44835","inReplyTo":"20170108061238.2604-1-svnpenn@gmail.com","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-01-08T11:54:16Z","receivedAt":"2017-01-08T11:55:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Steven,\n\nOn Sun, 8 Jan 2017, Steven Penny wrote:\n\n> This matches up with the targets git-%, git-http-fetch, git-http-push\n> and git-remote-testsvn. It must be done this way on Windows else lcrypto\n> cannot find lgdi32 and lws2_32\n\nI am curious: how do you build Git? I ask because I build Git on Windows\nmany times a day, and I did not encounter any link problems. This hints at\na difference of build environment (I use the Git for Windows SDK) that\nneeds to be mentioned in the commit message.\n\nCiao,\nJohannes\n"},{"id":"308962","messageId":"CAAXzdLVXUdCAcJL6DratNwLFUSN4UAV+TmALSZe-zSSTAJcWWw@mail.gmail.com","threadId":"44835","inReplyTo":"alpine.DEB.2.20.1701081250580.3469@virtualbox","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Steven Penny","fromEmail":"svnpenn@gmail.com","sentAt":"2017-01-08T15:12:09Z","receivedAt":"2017-01-08T15:12:16Z","isPatch":true,"sender":{"key":"svnpenn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/60531334?v=4"},"body":"On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:\n> I am curious: how do you build Git? I ask because I build Git on Windows\n> many times a day, and I did not encounter any link problems.\n\nMy end goal is to build static native Windows Git via Cygwin and the\nmingw64-x86_64-gcc-core package. This is certainly possible but definitely not\nconsidered in the current Git codebase. I have a patch to config.mak.uname\ncoming as well.\n"},{"id":"308966","messageId":"alpine.DEB.2.20.1701081953330.3469@virtualbox","threadId":"44835","inReplyTo":"CAAXzdLVXUdCAcJL6DratNwLFUSN4UAV+TmALSZe-zSSTAJcWWw@mail.gmail.com","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-01-08T18:54:23Z","receivedAt":"2017-01-08T18:54:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Steven,\n\nOn Sun, 8 Jan 2017, Steven Penny wrote:\n\n> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:\n> > I am curious: how do you build Git? I ask because I build Git on Windows\n> > many times a day, and I did not encounter any link problems.\n> \n> My end goal is to build static native Windows Git via Cygwin and the\n> mingw64-x86_64-gcc-core package.\n\nThat is certainly a worthy goal, and I would highly recommend to mention\nthat particular cross-compiling setup in the commit message. It's not like\nthis is the easiest way to build native Git on Windows...\n\nCiao,\nJohannes\n"},{"id":"308979","messageId":"xmqqy3ylx75g.fsf@gitster.mtv.corp.google.com","threadId":"44835","inReplyTo":"alpine.DEB.2.20.1701081953330.3469@virtualbox","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-09T03:07:55Z","receivedAt":"2017-01-09T03:08:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Steven,\n>\n> On Sun, 8 Jan 2017, Steven Penny wrote:\n>\n>> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:\n>> > I am curious: how do you build Git? I ask because I build Git on Windows\n>> > many times a day, and I did not encounter any link problems.\n>> \n>> My end goal is to build static native Windows Git via Cygwin and the\n>> mingw64-x86_64-gcc-core package.\n>\n> That is certainly a worthy goal, and I would highly recommend to mention\n> that particular cross-compiling setup in the commit message. It's not like\n> this is the easiest way to build native Git on Windows...\n\nIn addition to the patch being explained well, I also care that it\ndoes not break existing builds.  I do not think it is the case for\nyou, and I do think the patch does the right thing, but just double\nchecking to see if you have objections to the change itself.\n\nThanks.\n"},{"id":"309018","messageId":"alpine.DEB.2.20.1701091127570.3469@virtualbox","threadId":"44835","inReplyTo":"xmqqy3ylx75g.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-01-09T10:49:37Z","receivedAt":"2017-01-09T10:51:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Sun, 8 Jan 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Sun, 8 Jan 2017, Steven Penny wrote:\n> >\n> >> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:\n> >> > I am curious: how do you build Git? I ask because I build Git on\n> >> > Windows many times a day, and I did not encounter any link\n> >> > problems.\n> >> \n> >> My end goal is to build static native Windows Git via Cygwin and the\n> >> mingw64-x86_64-gcc-core package.\n> >\n> > That is certainly a worthy goal, and I would highly recommend to\n> > mention that particular cross-compiling setup in the commit message.\n> > It's not like this is the easiest way to build native Git on\n> > Windows...\n> \n> In addition to the patch being explained well, I also care that it\n> does not break existing builds.  I do not think it is the case for\n> you, and I do think the patch does the right thing, but just double\n> checking to see if you have objections to the change itself.\n\nI just double-checked and it still builds fine on Git for Windows (as\nexpected).\n\nThe reason it seems to have worked before, too, is that somehow -lcrypto\ndoes not require gdi32.dll here. As a matter of fact, we do not link with\ngdi32 at all:\n\n$ printf 'include Makefile\\nprint:\\n\\t@%s\\n\\t@%s\\n\\t@%s\\n' \\\n\t'echo all: $(ALL_LDFLAGS)' \\\n\t'echo libs: $(LIBS)' \\\n\t'echo imap: $(IMAP_SEND_LDFLAGS)' |\n  make -f - print\n\nall: -Wl,--nxcompat -Wl,--dynamicbase -Wl,--pic-executable,-e,mainCRTStartup\nlibs: libgit.a xdiff/lib.a git.res -lws2_32 -lntdll -lpcre -lz -liconv -lintl -lcrypto\nimap: -lcurl -lssl -lcrypto -lcrypto\n\nIt is a bit curious that -lws2_32 *does* only show up in $(LIBS), but I\nguess it is simply the fact that we use a newer GCC (gcc.exe (Rev2, Built\nby MSYS2 project) 6.2.0) that allows Git for Windows to be built even\nwithout this patch.\n\nIn any case, it does not break things, and it helps Cygwin, so: ACK\n\nCiao,\nDscho\n\nP.S.: I pushed this to Git for Windows' `master`, too:\nhttps://github.com/git-for-windows/git/commit/f05a26948b\n"},{"id":"309032","messageId":"xmqqbmvgwbuq.fsf@gitster.mtv.corp.google.com","threadId":"44835","inReplyTo":"alpine.DEB.2.20.1701091127570.3469@virtualbox","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-09T14:23:57Z","receivedAt":"2017-01-09T14:24:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> ...\n> It is a bit curious that -lws2_32 *does* only show up in $(LIBS), but I\n> guess it is simply the fact that we use a newer GCC (gcc.exe (Rev2, Built\n> by MSYS2 project) 6.2.0) that allows Git for Windows to be built even\n> without this patch.\n>\n> In any case, it does not break things, and it helps Cygwin, so: ACK\n\nThanks, will queue on my side, too.\n"},{"id":"309034","messageId":"xmqq4m18wbo5.fsf@gitster.mtv.corp.google.com","threadId":"44835","inReplyTo":"alpine.DEB.2.20.1701091127570.3469@virtualbox","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-09T14:27:54Z","receivedAt":"2017-01-09T14:29:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> In any case, it does not break things, and it helps Cygwin, so: ACK\n>\n> Ciao,\n> Dscho\n>\n> P.S.: I pushed this to Git for Windows' `master`, too:\n> https://github.com/git-for-windows/git/commit/f05a26948b\n\nHmm, I peeked it hoping that you corrected the log message along the\nlines of your <alpine.DEB.2.20.1701081953330.3469@virtualbox>, but\nit appears that what you queued does not have any extra mention of\ncygwin or specifics of the buildchain on top of what Steven posted?\n\n"},{"id":"309035","messageId":"xmqqzij0uwxp.fsf@gitster.mtv.corp.google.com","threadId":"44835","inReplyTo":"xmqq4m18wbo5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-09T14:31:30Z","receivedAt":"2017-01-09T14:31:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> In any case, it does not break things, and it helps Cygwin, so: ACK\n>>\n>> Ciao,\n>> Dscho\n>>\n>> P.S.: I pushed this to Git for Windows' `master`, too:\n>> https://github.com/git-for-windows/git/commit/f05a26948b\n>\n> Hmm, I peeked it hoping that you corrected the log message along the\n> lines of your <alpine.DEB.2.20.1701081953330.3469@virtualbox>, but\n> it appears that what you queued does not have any extra mention of\n> cygwin or specifics of the buildchain on top of what Steven posted?\n\nAh, false alarm.  It does have s/Windows/Cygwin/; I trust your\njudgement that that change makes the context clear enough for those\ninvolved in Git for Windows, msysGit and Cygwin port.\n\nWill queue it together with the other one from Steven.\n\nThanks.\n"}]}