git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 9, 2017, 10:49 UTC
Message-ID
<alpine.DEB.2.20.1701091127570.3469@virtualbox>
In-Reply-To
<xmqqy3ylx75g.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Sun, 8 Jan 2017, Junio C Hamano wrote:
Show 21 quoted lines
> 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

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 9 in “Makefile: put LIBS after LDFLAGS for imap-send”
  1. Makefile: put LIBS after LDFLAGS for imap-sendSteven Penny, Jan 8, 2017
  2. Johannes SchindelinJan 8, 2017
  3. Steven PennyJan 8, 2017
  4. Johannes SchindelinJan 8, 2017
  5. Junio C HamanoJan 9, 2017
  6. Johannes SchindelinJan 9, 2017
  7. Junio C HamanoJan 9, 2017
  8. Junio C HamanoJan 9, 2017
  9. Junio C HamanoJan 9, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.