]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: switch dlopen hooks over to DLSYM_PROTOTYPE()/DLSYM_FUNCTION()
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2024 09:12:48 +0000 (10:12 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 1 Mar 2024 15:51:24 +0000 (15:51 +0000)
commit9dbabd0a8b4dda28fd2c6dae0f75e763f26e8e05
tree27408fe3c3b238304d0a376840022f37d3c7c9e8
parent96069e57a0f9d0d080c2f2743a169eddcf41ea0e
tree-wide: switch dlopen hooks over to DLSYM_PROTOTYPE()/DLSYM_FUNCTION()

We have these pretty macros, let's use them everywhere (so far we mostly
used them for newer additions only).

This PR is mostly an excercise in "perl -p -i -e", but there are some
special cases:

* idn-util.c exposes a function whose prototype in the official library
  headers is marked with the "const" attribute, and this apparently does
  not propagate along typeof() correctly and then
  __builtin_types_compatible_p() fails later because it detects that
  prototype and original function don't match in prototype.

* libbpf removed some symbols in newer versions, hence we need to define
  some prototypes manually to still be able to build.

* libcryptsetup marked a symbol as deprecated we want to use (knowing it
  is deprecated). By using the macros this is detected by the compiler.
  We work around it via the usual warning off macros.

Note by using these macros we assume that all symbols are known during
build time. Which might not be the case. We might need to revert this
commit for some symbols if this trips up builds on older distros.
21 files changed:
src/locale/xkbcommon-util.c
src/locale/xkbcommon-util.h
src/shared/bpf-dlopen.c
src/shared/bpf-dlopen.h
src/shared/cryptsetup-util.c
src/shared/cryptsetup-util.h
src/shared/elf-util.c
src/shared/idn-util.c
src/shared/idn-util.h
src/shared/libfido2-util.c
src/shared/libfido2-util.h
src/shared/password-quality-util-passwdqc.c
src/shared/password-quality-util-passwdqc.h
src/shared/password-quality-util-pwquality.c
src/shared/password-quality-util-pwquality.h
src/shared/pcre2-util.c
src/shared/pcre2-util.h
src/shared/pkcs11-util.c
src/shared/pkcs11-util.h
src/shared/qrcode-util.c
src/shared/tpm2-util.c