| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
libselinux is built in most distros, but it is seldomly needed at runtime (e.g.: it is not used by default on Debian/Ubuntu). In order to allow building small images from the same packages, switch it to runtime optional by using dlopen(), and gracefully fallback if the library is not found. If libsystemd headers are available at build time stamp the ELF binaries using the ELF dlopen metadata format as defined by: https://uapi-group.org/specifications/specs/elf_dlopen_metadata/ so that packaging tools for rpm/deb can automatically derive dependencies for it.
When building with -O0 md5_* helpers are unresolved, which pulls gnulib’s external md5 implementation into the link, which in turn calls OpenSSL directly and keeps -lcrypto around. Ensure md5 wrappers remain local, so that when dlopen is used sort is never linked against libcrypto.
If libsystemd headers are available at build time stamp the ELF binaries using the ELF dlopen metadata format as defined by: https://uapi-group.org/specifications/specs/elf_dlopen_metadata/ so that packaging tools for rpm/deb can automatically derive dependencies for it.
|
Interesting. |
Sorry, something went wrong.
That seems a bit annoying with many different variants. E.g., SUSE already has coreutils, coreutils-single, and coreutils-systemd. Unrelated to the commit, but I wonder why Gnulib doesn't define typeof in config.h so we can use that instead of __typeof__. Similar to how bool is defined by the bool module so programs can be written as if they had a decent C23 compiler. Maybe I will propose something on list. |
Sorry, something went wrong.
Yeah especially for features that are useful only in specific circumstances like selinux, where unless the system uses selinux it doesn't provide anything. But it still lets us have a single package. For example in a build chroot selinux is really not needed, so the library and its deps can be skipped. This is very important for central packages like coreutils, as it reduces the amount the amount of deps pulled in by default. |
Sorry, something went wrong.
|
btw I see gnulib has some selinux code too, would you like this new module to be added there instead perhaps? Would that make sense, or is it better here? |
Sorry, something went wrong.
I'm not sure. Let's work on this in coreutils for now |
Sorry, something went wrong.
|
I skimmed over the threads here [1] [2], and it sounds like an interesting idea to me. Have any other programs other than systemd itself started moving to dlopen with these notes? [1] https://mastodon.social/@pid_eins/112256363180973672 |
Sorry, something went wrong.
|
I know of at least 3: libsdl3, mimic, openal-soft, as these are using the same dlopen metadata spec. I have a PR open against util-linux to make libselinux dlopened in the same way as this one. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
libselinux is built in most distros, but it is seldomly needed at runtime (e.g.: it is not used by default on Debian/Ubuntu). In order to
allow building small images from the same packages, switch it to runtime optional by using dlopen(), and gracefully fallback if the
library is not found.
If libsystemd headers are available at build time stamp the ELF binaries using the ELF dlopen metadata format as defined by:
https://uapi-group.org/specifications/specs/elf_dlopen_metadata/
so that packaging tools for rpm/deb can automatically derive dependencies for it.
Also fix 'sort' dlopen when building with -O0.
I have already done the FSF copyright assignment paperwork some years back.