Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main/curl: fix missing static library symbols #6264

Closed

Conversation

j8r
Copy link
Contributor

@j8r j8r commented Feb 8, 2019

Linking to libcurl.a results of missing symbols.
There is the same problem with libssh2.a.

@brentp
Copy link

brentp commented Feb 28, 2019

I am getting errors like "undefined reference to `nghttp2_http2_strerror'" for anything related to nghttp2 when trying to statically link to libcurl.a. Does this resolve that too? I see there is no static lib built for nghttp2 in current package, only the shared lib.

@j8r
Copy link
Contributor Author

j8r commented Feb 28, 2019

I'm also facing this issue. This is a first step, this doesn't solve the missing .a archive for the nghttp2 package.

@j8r
Copy link
Contributor Author

j8r commented Mar 12, 2019

Do we want a new curl-static, or is it fine to keep the libcurl.a archive inside curl-dev?

@CosmicToast
Copy link
Contributor

@j8r this has been recently mentioned in irc.
@ncopa seems to want to have an automatic -static subpackage, likely with an install_if somewhere (ala current -openrc).

On that basis, I'd recommend making a new curl-static in the interim (I don't know if and when the automatic package will be made).

@j8r j8r force-pushed the fix-missing-libcurl-static-symbols branch from d531ead to a3b5142 Compare April 28, 2019 18:11
@probot-autolabeler probot-autolabeler bot added the R-main Main repository label Apr 28, 2019
@tcely
Copy link
Collaborator

tcely commented May 3, 2019

Do we want to remove the static function now that abuild handles this?

@CosmicToast
Copy link
Contributor

This is in main/ and I don't know if this apkbuild could get backported.
If we don't expect anything of the sort, that would probably be ok.

@@ -82,7 +82,7 @@ builddir="$srcdir/$pkgname-$pkgver"
build() {
cd "$builddir"
autoreconf -vif
./configure \
./configure LDFLAGS=-static PKG_CONFIG='pkg-config --static' \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this will enforce static linking of curl itself. I don't mind that we ship a static library of curl in a subpackage, but we will not build curl static for all of our users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No? I got:

ldd usr/bin/curl
        /lib/ld-musl-x86_64.so.1 (0x7f9c22c9d000)
        libssl.so.1.1 => /lib/libssl.so.1.1 (0x7f9c22b70000)
        libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7f9c228f2000)
        libz.so.1 => /lib/libz.so.1 (0x7f9c226db000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f9c22c9d000)

@j8r j8r closed this May 6, 2019
@j8r j8r deleted the fix-missing-libcurl-static-symbols branch May 6, 2019 16:05
@j8r
Copy link
Contributor Author

j8r commented May 6, 2019

After testing it again, the static linking already works by changing --with-nghttp2 to --without-nghttp2 and linking against an application.
I will rather works on a fix for nghttp2-static then.
Sorry for the annoyance.

@j8r
Copy link
Contributor Author

j8r commented May 7, 2019

I got this information curl/curl#2516 (comment).

  • if you dont define NGHTTP2_STATICLIB when building libcurl, then a shared
    libcurl is built, and static libcurl is built that relies on shared nghttp2
  • if you do define NGHTTP2_STATICLIB when building libcurl, then a shared
    libcurl is built that relies on static nghttp, and static libcurl is built

That's why @brentp and me have this undefined reference when trying to static link - static libcurl depends on shared nghttp2.
@ncopa I am not very sure what to do, I guess we need to compile curl twice - one with -DNGHTTP2_STATICLIB for curl-static and one without for curl-dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R-main Main repository
Projects
None yet
5 participants