]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/curl-util: load libcurl via dlopen main
authorDaan De Meyer <daan@amutable.com>
Fri, 17 Apr 2026 14:06:23 +0000 (16:06 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Apr 2026 19:13:58 +0000 (21:13 +0200)
commitc99e93ce0a195eafe988b1769729c526ca68352b
tree25e5dfe7c894919d252d889d1527e193970f0b86
parent1b787f20cfb307d1848dc6a479643f6caadde24d
shared/curl-util: load libcurl via dlopen

Convert curl-util to the dlopen pattern used by other optional shared
libraries in libshared (libarchive, pcre2, idn, ...). Declare the curl
API entry points with DLSYM_PROTOTYPE, resolve them in a dlopen_curl()
helper, and call the sym_* wrappers from callers. curl_glue_new() now
loads the library on first use, so consumers going through CurlGlue
pick this up automatically; journal-upload and report-upload call
dlopen_curl() directly since they use curl without the glue layer.

With this in place curl-util can live in libshared itself, linked only
against libcurl's headers (via libcurl_cflags). The libcurlutil_static
convenience library and the libcurl link dependency on systemd-imdsd,
systemd-pull, systemd-journal-upload and systemd-report go away.

Also move the easy_setopt() helper macro next to the DLSYM declarations
so all consumers use a single sym-prefixed definition, and add a
dlopen_curl() check to test-dlopen-so.
13 files changed:
meson.build
src/imds/imdsd.c
src/imds/meson.build
src/import/meson.build
src/import/pull-job.c
src/journal-remote/journal-upload.c
src/journal-remote/meson.build
src/report/meson.build
src/report/report-upload.c
src/shared/curl-util.c
src/shared/curl-util.h
src/shared/meson.build
src/test/test-dlopen-so.c