Missing nghttp2 symbols when linking statically against libcurl
It is a proper issue to discuss about missing nghttp2
symbols when linking statically against libcurl
Even passing LDFLAGS="-static $(pkg-config --libs --static libcurl)"
doesn't solve the issue.
The only workaround I found is to compile curl
without nghttp2
.
I don't think the problem comes from the projects.
Trying to compile PHP
configure:24497: checking for curl_easy_perform in -lcurl
configure:24522: cc -o conftest -g -O2 -fvisibility=hidden -static -lcurl -lnghttp2 -lssl -l
crypto -lssl -lcrypto -lz -L/lib -lcurl conftest.c -lcurl -lbz2 -lz -lrt -lm -lxml2 -lz -l
m -lssl -lcrypto -lcurl >&5
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr
/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../lib/libcurl.a(libcurl_la-http2.o): in fun
ction `http2_disconnect':
http2.c:(.text+0x28): undefined reference to `nghttp2_session_del
Trying to compile Transmission
CCLD crypto-test
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../lib/libcurl.a(libcurl_la-http2.o): in function `http2_disconnect':
http2.c:(.text+0x28): undefined reference to `nghttp2_session_del'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../lib/libcurl.a(libcurl_la-http2.o): in function `h2_pri_spec':
http2.c:(.text+0x85): undefined reference to `nghttp2_priority_spec_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../lib/libcurl.a(libcurl_la-http2.o): in function `h2_session_send':
...
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: http2.c:(.text+0x27e6): undefined reference to `nghttp2_strerror'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: http2.c:(.text+0x2835): undefined reference to `nghttp2_strerror'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1068: bitfield-test] Error 1
make[1]: *** [Makefile:1080: crypto-test] Error 1
Related issues/PR:
- https://github.com/alpinelinux/aports/pull/6264
- https://github.com/alpinelinux/aports/pull/9925
- https://github.com/transmission/transmission/issues/983
Useful comments: