-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
I did this
I am building a static binary version of curl that tries to be as small as possible with only http required.
For that I am using debian:stable-slim as Contianer image with these packages installed:
build-essential clang perl gcc musl-dev libwolfssl-dev cmake autoconf automake libtool curl tar
Build command:
export CC=clang
autoreconf -fi
CPPFLAGS="-DHAVE_CURL" LDFLAGS="-static" PKG_CONFIG="pkg-config --static" ./configure \
--disable-shared \
--disable-libcurl-option \
--disable-threaded-resolver \
--disable-cookies \
--disable-crypto-auth \
--disable-dict \
--disable-file \
--disable-ftp \
--disable-gopher \
--disable-imap \
--disable-ldap \
--disable-ldaps \
--without-ldap-lib \
--without-lber-lib \
--disable-mqtt \
--disable-pop3 \
--disable-proxy \
--disable-rtmp \
--disable-rtsp \
--disable-scp \
--disable-sftp \
--disable-smtp \
--disable-smb \
--without-ngtcp2 \
--disable-ntlm-wb \
--disable-telnet \
--disable-tftp \
--disable-alt-svc \
--disable-unix-sockets \
--disable-verbose \
--disable-versioned-symbols \
--disable-http-auth \
--disable-doh \
--disable-mime \
--disable-dateparse \
--disable-netrc \
--disable-dnsshuffle \
--disable-ares \
--disable-progress-meter \
--disable-headers-api \
--disable-hsts \
--enable-maintainer-mode \
--enable-werror \
--without-brotli \
--without-gssapi \
--without-gsasl \
--without-libidn2 \
--without-libpsl \
--without-librtmp \
--without-libssh \
--without-libssh2 \
--without-nghttp2 \
--without-nghttp3 \
--without-quiche \
--without-ntlm-auth \
--without-zlib \
--without-zstd \
--without-ssl \
--without-openssl-quic \
--without-msh3 \
--disable-tls-srp \
--disable-ipv6 \
--enable-static \
--disable-docs \
--disable-manual
make -j4 V=1 LDFLAGS="-static -all-static" CFLAGS="-Os"
I expected the following
A static binary should be build.
Instead it failes with:
+ make -j4 V=1 LDFLAGS=-static -all-static CFLAGS=-Os
Making all in lib
make[1]: Entering directory '/build/curl_without_ssl/curl-8.12.0/lib'
make all-am
make[2]: Entering directory '/build/curl_without_ssl/curl-8.12.0/lib'
make[2]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/lib'
make[1]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/lib'
Making all in docs
make[1]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs'
Making all in .
make[2]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs'
Making all in cmdline-opts
make[2]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs/cmdline-opts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs/cmdline-opts'
Making all in libcurl
make[2]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl'
Making all in opts
make[3]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl/opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl/opts'
make[3]: Entering directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl'
make[2]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs/libcurl'
make[1]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/docs'
Making all in src
make[1]: Entering directory '/build/curl_without_ssl/curl-8.12.0/src'
/bin/bash ../libtool --tag=CC --mode=link clang -Os -static -all-static -o curl curl-slist_wc.o curl-terminal.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_soc.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_filetime.o curl-tool_findfile.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o curl-tool_ipfs.o curl-tool_libinfo.o curl-tool_listhelp.o curl-tool_main.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_progress.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_ssls.o curl-tool_stderr.o curl-tool_strdup.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_writeout_json.o curl-tool_xattr.o curl-var.o ../lib/curl-base64.o ../lib/curl-curl_get_line.o ../lib/curl-curl_multibyte.o ../lib/curl-dynbuf.o ../lib/curl-nonblock.o ../lib/curl-strtoofft.o ../lib/curl-timediff.o ../lib/curl-version_win32.o ../lib/curl-warnless.o curl-tool_hugehelp.o curl-tool_ca_embed.o ../lib/libcurl.la
libtool: link: clang -Os -static -o curl curl-slist_wc.o curl-terminal.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_soc.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_filetime.o curl-tool_findfile.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o curl-tool_ipfs.o curl-tool_libinfo.o curl-tool_listhelp.o curl-tool_main.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_progress.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_ssls.o curl-tool_stderr.o curl-tool_strdup.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_writeout_json.o curl-tool_xattr.o curl-var.o ../lib/curl-base64.o ../lib/curl-curl_get_line.o ../lib/curl-curl_multibyte.o ../lib/curl-dynbuf.o ../lib/curl-nonblock.o ../lib/curl-strtoofft.o ../lib/curl-timediff.o ../lib/curl-version_win32.o ../lib/curl-warnless.o curl-tool_hugehelp.o curl-tool_ca_embed.o ../lib/.libs/libcurl.a
/usr/bin/ld: curl-tool_findfile.o: in function `findfile':
tool_findfile.c:(.text+0xe7): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: ../lib/.libs/libcurl.a(libcurl_la-curl_addrinfo.o): in function `Curl_getaddrinfo_ex':
curl_addrinfo.c:(.text+0x40): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: curl-tool_ssls.o: in function `tool_ssls_load':
tool_ssls.c:(.text+0x80): undefined reference to `curlx_get_line'
/usr/bin/ld: tool_ssls.c:(.text+0x1c0): undefined reference to `curlx_get_line'
/usr/bin/ld: tool_ssls.c:(.text+0x216): undefined reference to `curlx_get_line'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: Leaving directory '/build/curl_without_ssl/curl-8.12.0/src'
make[1]: *** [Makefile:1016: curl] Error 1
make: *** [Makefile:624: all-recursive] Error 1
For curl Versions 8.8.0 until 8.11.1 it worked just fine.
curl/libcurl version
curl 8.12.0
operating system
debian:stable-slim
Metadata
Metadata
Assignees
Labels
No labels