curl-library
curl fails to build with my custom openssl build on Mac OSX Tiger PPC
Date: Thu, 9 Feb 2017 00:46:20 -0700
I've spent the last two days trying to get curl-7.52.1 to build on Mac
OS X Tiger 10.4.11 using a custom compiled version of OpenSSL (1.0.2k)
in /usr/local/ssl. I know that this should work, as I have a PPC G5
system, running 10.5.8 on Macports with both OpenSSL 1.0.2k and Curl
7.52.1 built and working.
I did not build OpenSSL with dynamic libs, on purpose. Originally, I
was interested in only building curl's static libs only and linking it
against my static libssl.a/libcrypto.a. I know my custom openssl works
as I've built the latest Nmap linked to it, by editing the Makefile
and changing the "LIBS=" to include "libssl.a libcrypto.a" instead of
"-lssl -lcrypto". Curl dosen't care does it?
1) Static build fails
When building curl only statically (--disable-shared), it errors out
while linking complaining of undefined symbols related to SHA-256,
which leads me to believe it is trying to link against the Apple
supplied version (0.9.7), which dosen't support SHA-256:
libtool: link: gcc -Os -pipe -mmacosx-version-min=10.4 -arch ppc
-Wno-system-headers -arch ppc -o curl curl-slist_wc.o
curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o
curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o
curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o
curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o
curl-tool_easysrc.o curl-tool_formparse.o curl-tool_getparam.o
curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o
curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o
curl-tool_main.o curl-tool_metalink.o curl-tool_mfiles.o
curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o
curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o
curl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o
curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o
curl-tool_writeenv.o curl-tool_writeout.o curl-tool_xattr.o
../lib/curl-strtoofft.o ../lib/curl-nonblock.o ../lib/curl-warnless.o
-L/usr/local/ssl/lib ../lib/.libs/libcurl.a -lssl -lcrypto -lldap -lz
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_ERR_remove_thread_state
_SHA256_Final
_SHA256_Init
_SHA256_Update
_SSL_COMP_free_compression_methods
_SSL_CTX_set_alpn_protos
_SSL_CTX_set_next_proto_select_cb
_SSL_get0_alpn_selected
collect2: ld returned 1 exit status
make[2]: *** [curl] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
To try and make this succeed, I tried editing the Makefile by hand and
rebuilding after a "make clean". I tried changing LIBCURL_LIBS and
LIBS from: -lssl -lcrypto -lssl -lcrypto -lldap -lz
to: libssl.a libcrypto.a -lldap -lz
but mysteriously a "make" shows the exact same error above, and
appears to completely ignore my hand edits of Makefile. I gave up on
this.
2) Let's build shared and static libs, and see what happens
When building curl with shared and static libs enabled, it succeeds. Glorious!
However, "otool -L ./src/.libs/curl" shows that it has linked to the
Apple supplied version's .dylibs! Yuck!
[rees_at_xserve-brains]:~/src/curl-7.52.1> otool -L src/.libs/curl
src/.libs/curl:
/usr/local/lib/libcurl.4.dylib (compatibility version 9.0.0,
current version 9.0.0)
/usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current
version 0.9.7)
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7,
current version 0.9.7)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
(compatibility version 1.0.0, current version 2.2.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.1.12)
Here are the ./configure options I've used:
1) static only:
env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure
CFLAGS="-Os -pipe -mmacosx-version-min=10.4 -arch ppc"
LDFLAGS="-L/usr/local/ssl/lib -arch ppc"
CPPFLAGS="-I/usr/local/ssl/include -isystem /usr/local/ssl/include"
--without-cyassl --without-gnutls --without-gssapi --without-libidn
--without-libmetalink --without-librtmp --without-libssh2
--without-nghttp2 --without-nss --without-polarssl --without-spnego
--with-ssl --without-darwinssl --disable-ares --disable-ldaps
--with-ca-bundle=/Users/rees/src/curl-ca-bundle.crt --disable-gopher
--disable-imap --disable-imaps --disable-pop3 --disable-pop3s
--disable-rtsp --disable-smtp --disable-smtps --disable-dict
--disable-silent-rules --disable-shared
2) shared:
env PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure
CFLAGS="-Os -pipe -mmacosx-version-min=10.4 -arch ppc"
LDFLAGS="-L/usr/local/ssl/lib -arch ppc"
CPPFLAGS="-I/usr/local/ssl/include -isystem /usr/local/ssl/include"
--without-cyassl --without-gnutls --without-gssapi --without-libidn
--without-libmetalink --without-librtmp --without-libssh2
--without-nghttp2 --without-nss --without-polarssl --without-spnego
--with-ssl --without-darwinssl --disable-ares --disable-ldaps
--with-ca-bundle=/Users/rees/src/curl-ca-bundle.crt --disable-gopher
--disable-imap --disable-imaps --disable-pop3 --disable-pop3s
--disable-rtsp --disable-smtp --disable-smtps --disable-dict
--disable-silent-rules
Would anybody on the mailinglist care to help a guy with too much time
and and affinity for vintage PowerPC systems?
Rees
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-02-09