static linking lib order problem
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:
Makefile +1 -1
@@ -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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFYeapHZWg9mCTffwRAlgwAJ49jD1bmJyKqffOObvDYg0e1hnkLACfV68w D9AKge2mYnHp/uynRnqFMXE=
=kvpj
-----END PGP SIGNATURE-----