From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.3 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id B796420756 for ; Mon, 9 Jan 2017 10:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965070AbdAIKuY (ORCPT ); Mon, 9 Jan 2017 05:50:24 -0500 Received: from mout.gmx.net ([212.227.17.22]:57407 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965056AbdAIKts (ORCPT ); Mon, 9 Jan 2017 05:49:48 -0500 Received: from virtualbox ([37.24.141.236]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MN748-1cOLfN3qMC-006c2a; Mon, 09 Jan 2017 11:49:38 +0100 Date: Mon, 9 Jan 2017 11:49:37 +0100 (CET) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Junio C Hamano cc: Steven Penny , git@vger.kernel.org Subject: Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send In-Reply-To: Message-ID: References: <20170108061238.2604-1-svnpenn@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:Uhqne6yW7PmVUQxbzzhRYXdoehpBjFYJSFilw3MQQKwuC7dWgIw mHiE02cftgkfIFGFN75PbV3HfX4BlRbkehk4MjT+Oa/BEcud+Pxi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rS+rInzsg3hLps46+WNBUzPhhXmjpBNUD WZ3wJq8YBrmPaehM1eQb+3Pf0cfpTbJNZU4WawC2/NHluq4/3CHZ2To3Yhmi5ERCRDoervwcz f4QPz7w0oDyZ+c6DukKEBQoR71omBqNJReYaDARzvmn4feSIzYo+CDXk7axc5jD9JQ== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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