On Fri, 17 Jul 2026 at 00:39, Paul Eggert <[email protected]> wrote:
>
> On 2026-07-16 15:21, Bruno Haible via Gnulib discussion list wrote:
>
> > If I understand it correctly, this script adds a '.note.dlopen' section,
> > in the format documented in
> >    https://uapi-group.org/specifications/specs/elf_dlopen_metadata/
> > and already implemented in
> >    https://github.com/systemd/package-notes
>
> Yes, that looks right. I didn't know about package-notes.
>
> > AFAICS, Luca's preferred way to generate this section is via the
> > SD_ELF_NOTE_DLOPEN macro defined in <systemd/sd-dlopen.h>.
> >
> > The macro looks reasonable. But why is it in a systemd header??

Simply because we are the authors, so we ship it where we can, which
is in our public library. It can be copied if you wish to do so.

> > ...
> > I would view it as a general utility header.
> > Should we include a (standalone) copy of it in Gnulib?
>
> Something like that sounds reasonable. Presumably the Gnulib package
> would be LGPLv2.1+ given that sd-dlopen.h includes _sd-common.h which is
> LGPLv2.1+.

There's no need, I made that header intentionally MIT-0 so that it
could be copied anywhere without worry, and without affecting the
license of the adopting package. The included one is for one of the
additional macros that you don't need, so you can omit it (I'll fix it
anyway at the source to avoid this issue even for the other macro).

> I'm not entirely clear on how it'd be used, though. Would we keep
> sd-dlopen.h unchanged, and wrap it inside a Gnulib-named header (one
> with a better name perhaps), where the Gnulib-named header supplies
> no-ops on unsupported platforms? I guess to find that out we could (say)
> use the new module on Coreutils when it configures DLOPEN_LIBCRYPTO.
> Perhaps the new Gnulib module could take over some of the configury that
> coreutuils/configure.ac currently does for dlopen etc., so that other
> apps don't need to repeat that configury.

The way we use it elsewhere is that the macro DLOPEN_foo is wrapped in
"#ifdef foo" or so, that way if foo is enabled at build time, then the
binary is stamped with the note. If it's disabled, it's not.

I had already mentioned here
https://github.com/coreutils/coreutils/pull/317#issuecomment-4944632425
that I can send a patch for gnulib so that all of this is done in one
place, if you wish. Do you want me to do that?

Reply via email to