* [PATCH v4 1/1] Makefile: link libcurl before zlib
@ 2015-10-21 17:01 Remi Pommarel
2015-10-21 19:35 ` Jonathan Nieder
0 siblings, 1 reply; 2+ messages in thread
From: Remi Pommarel @ 2015-10-21 17:01 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Brandon Casey, Jeff King, Jonathan Nieder,
Remi Pommarel
For static linking especially library order while linking is important. For
example, libcurl wants symbols from zlib when building http-push, http-fetch
and remote-curl. So for these programs libcurl has to be linked before zlib.
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
Changes to v3:
- Initialize IMAP_SEND_LDFLAGS so that no environment leak could occur
- Rephrase the description to use zlib example instead of libcurl
Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 04c2231..8f1fa6c 100644
--- a/Makefile
+++ b/Makefile
@@ -1036,7 +1036,7 @@ ifdef HAVE_ALLOCA_H
endif
IMAP_SEND_BUILDDEPS =
-IMAP_SEND_LDFLAGS = $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
+IMAP_SEND_LDFLAGS =
ifdef NO_CURL
BASIC_CFLAGS += -DNO_CURL
@@ -1093,6 +1093,7 @@ else
endif
endif
endif
+IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
ifdef ZLIB_PATH
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
@@ -1978,10 +1979,10 @@ git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
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,$^) \
- $(LIBS) $(CURL_LIBCURL)
+ $(CURL_LIBCURL) $(LIBS)
git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
- $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
+ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
@@ -1995,7 +1996,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
- $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
+ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
--
2.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4 1/1] Makefile: link libcurl before zlib
2015-10-21 17:01 [PATCH v4 1/1] Makefile: link libcurl before zlib Remi Pommarel
@ 2015-10-21 19:35 ` Jonathan Nieder
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2015-10-21 19:35 UTC (permalink / raw)
To: Remi Pommarel; +Cc: git, Junio C Hamano, Brandon Casey, Jeff King
Remi Pommarel wrote:
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-21 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 17:01 [PATCH v4 1/1] Makefile: link libcurl before zlib Remi Pommarel
2015-10-21 19:35 ` Jonathan Nieder
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 NNTP newsgroup(s).