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

static linking lib order problem

From
BTBennett Todd <bet@rahul.net>
Date
Nov 20, 2006, 17:32 UTC
Message-ID
<20061120173225.GA16161@rahul.net>
I build git for Bent Linux, with
	make prefix=/usr NEEDS_LIBICONV=YesPlease
It develops compile and link lines that look like:
gcc -g -O2 -Wall  -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRLCPY -o git-http-fetch   fetch.o http.o http-fetch.o \
                libgit.a xdiff/lib.a -lz  -liconv  -lcrypto -lcurl -lexpat
which produce vast numbers of errors, which look like

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libcurl.a(ssluse.o)(.text.rand_enough+0x4): In function `rand_enough': : undefined reference to `RAND_status' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libcurl.a(ssluse.o)(.text.ossl_seed+0x2b): In function `ossl_seed': : undefined reference to `RAND_load_file' [...] /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libcurl.a(http_ntlm.o)(.text.Curl_output_ntlm+0x370): In function `Curl_output_ntlm': : undefined reference to `MD5_Update' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libcurl.a(http_ntlm.o)(.text.Curl_output_ntlm+0x37d): In function `Curl_output_ntlm': : undefined reference to `MD5_Final' collect2: ld returned 1 exit status make: *** [git-http-fetch] Error 1

I've been kludging around it with this patch:

diff -ru git-1.4.4.orig/Makefile git-1.4.4/Makefile --- git-1.4.4.orig/Makefile 2006-11-15 07:22:27.000000000 +0000 +++ git-1.4.4/Makefile 2006-11-15 20:49:26.000000000 +0000

@@ -439,7 +439,7 @@
 		BASIC_CFLAGS += -I$(CURLDIR)/include
 		CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
 	else
-		CURL_LIBCURL = -lcurl
+		CURL_LIBCURL = -lcurl -lssl -lcrypto
 	endif
 	PROGRAMS += git-http-fetch$X
 	curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)

just because I didn't take the time to understand the git build
process's library conf system.

-Bennett
Message 1 of 1 in “static linking lib order problem”
  1. Bennett ToddNov 20, 2006

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.