void-linux / void-linux/void-packages

libcurl-devel should depend on libunistring-devel for static linking

Open
#50,980 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-testing
Dominant language
Shell
Stars
3.4k
Forks
2.8k
Avg merge
2d 5h
Merged PRs (30d)
299

Description

Is this a new report?

Yes

System Info

Void 6.6.35-2-lts x86_64-musl GenuineIntel uptodate rFF

Package(s) Affected

libcurl-devel-8.8.0_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

Linking against libcurl statically should work.

Actual behaviour

Linking against libcurl statically fails due to:

  • Missing libunistring-devel package dependency
  • Missing -lunistring from the Libs.private line in /usr/lib/pkgconfig/libcurl.pc
Libs.private: -lnghttp2 -lidn2 -lssh2 -lssh2 -lpsl -lssl -lcrypto -lssl -lcrypto -lzstd -lzstd -lz
Steps to reproduce

Example file t.c:

#include <curl/curl.h>

int main() {
  curl_version_info_data *curl_info = curl_version_info(CURLVERSION_NOW);
  return 0;
}

Build and link statically (after installing libunistring-devel):

% gcc -o t t.c --static `pkg-config --libs --static libcurl`
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libpsl.a(libpsl_la-psl.o): in function `psl_str_to_utf8lower':
(.text+0x13b4): undefined reference to `u8_strlen'
/usr/sbin/ld: (.text+0x13c9): undefined reference to `uninorm_nfkc'
/usr/sbin/ld: (.text+0x13d6): undefined reference to `u8_tolower'
/usr/sbin/ld: (.text+0x142f): undefined reference to `uninorm_nfkc'
/usr/sbin/ld: (.text+0x1434): undefined reference to `u8_tolower'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(lookup.o): in function `idn2_lookup_u8':
(.text+0x4e3): undefined reference to `u8_strlen'
/usr/sbin/ld: (.text+0x4f4): undefined reference to `u8_to_u32'
/usr/sbin/ld: (.text+0x613): undefined reference to `u32_to_u8'
/usr/sbin/ld: (.text+0x676): undefined reference to `u32_cmp'
/usr/sbin/ld: (.text+0x9c7): undefined reference to `u32_to_u8'
/usr/sbin/ld: (.text+0xa9a): undefined reference to `u32_to_u8'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(lookup.o): in function `idn2_to_ascii_4i2.part.0':
(.text+0xc25): undefined reference to `u32_cpy'
/usr/sbin/ld: (.text+0xc40): undefined reference to `u32_to_u8'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(lookup.o): in function `idn2_lookup_ul':
(.text+0xcef): undefined reference to `u8_strconv_from_encoding'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(lookup.o): in function `idn2_to_ascii_4z':
(.text+0xe2b): undefined reference to `u32_strlen'
/usr/sbin/ld: (.text+0xe3c): undefined reference to `u32_to_u8'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_8z4z':
(.text+0xae): undefined reference to `u8_to_u32'
/usr/sbin/ld: (.text+0xf1): undefined reference to `u32_cpy'
/usr/sbin/ld: (.text+0x127): undefined reference to `u32_cpy_alloc'
/usr/sbin/ld: (.text+0x1c1): undefined reference to `u32_cpy'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_4z4z.part.0':
(.text+0x271): undefined reference to `u32_strlen'
/usr/sbin/ld: (.text+0x284): undefined reference to `u32_to_u8'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_44i':
(.text+0x390): undefined reference to `u32_cpy'
/usr/sbin/ld: (.text+0x3c6): undefined reference to `u32_strlen'
/usr/sbin/ld: (.text+0x42a): undefined reference to `u32_cpy'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_8z8z':
(.text+0x49a): undefined reference to `u32_strlen'
/usr/sbin/ld: (.text+0x4ad): undefined reference to `u32_to_u8'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_8zlz':
(.text+0x563): undefined reference to `u8_strconv_to_encoding'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(decode.o): in function `idn2_to_unicode_lzlz':
(.text+0x5f0): undefined reference to `u8_strconv_from_encoding'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(libunistring_la-nfc.o):(.data.rel.ro+0x10): undefined reference to `uc_composition'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(libunistring_la-u32-normalize.o): in function `u32_normalize':
(.text+0x2f8): undefined reference to `u32_cpy'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(idna.o): in function `_idn2_u8_to_u32_nfc':
(.text+0x32): undefined reference to `u8_to_u32'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(idna.o): in function `_idn2_label_test':
(.text+0x3a0): undefined reference to `uc_is_general_category'
/usr/sbin/ld: /usr/lib64/gcc/x86_64-linux-musl/13.2.0/../../../../lib64/libidn2.a(libunistring_la-categ_of.o): in function `uc_general_category':
(.text+0x113): undefined reference to `_UC_CATEGORY_NONE'
collect2: error: ld returned 1 exit status

Add Missing -lunistring to Libs.private line in /usr/lib/pkgconfig/libcurl.pc

Libs.private: -lnghttp2 -lidn2 -lssh2 -lssh2 -lpsl -lssl -lcrypto -lssl -lcrypto -lzstd -lzstd -lz  -lunistring

Build and link statically again

% gcc -o t t.c --static `pkg-config --libs --static libcurl`

Success.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported /usr/lib/pkgconfig/libcurl.pc file and the t.c static-linking example, then inspect how the libcurl package supplies its development dependencies. Re-run gcc -o t t.c --static \pkg-config --libs --static libcurl`; done means the command succeeds with libunistring-devel installed and the generated private libraries include -lunistring`.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.