]> git.ipfire.org Git - thirdparty/elfutils.git/commit
debuginfod, libdwfl: Initialize libcurl and dlopen debuginfod-client lazily
authorMark Wielaard <mark@klomp.org>
Fri, 22 Apr 2022 21:36:30 +0000 (23:36 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 25 Apr 2022 14:09:41 +0000 (16:09 +0200)
commit62963dfc4835405a00463f24e79796c622cc2c84
tree3788a955b8586e897fd0b11adef618eca20c41a6
parent72823322be9a8f0143de21ccfb67a89696a9522f
debuginfod, libdwfl: Initialize libcurl and dlopen debuginfod-client lazily

We used to go out of our way to initialize libcurl early before any other
thread/code was running. But this meant that we might pay startup cost,
which under FIPS is significant, even for code that never uses libdebuginfod
or TLS libcurl connections. Although curl_global_init itself isn't thread-safe
we can use pthread_once to make sure we don't race against ourselves. This
still means we might race against any application code that might use
libcurl. But we can assume they will have called curl_global_init before
calling dwfl_begin or debuginfod_begin.

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/ChangeLog
debuginfod/Makefile.am
debuginfod/debuginfod-client.c
libdwfl/ChangeLog
libdwfl/debuginfod-client.c