Re: [PATCH 3/3] readutmp: load libsystemd with dlopen instead of linking

Paul Eggert <[email protected]> Fri, 17 Jul 2026 23:55:38 -0700
Newsgroups gmane.comp.lib.gnulib.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
For this one, many of the same questions as for patch 2/3.

Also, for coreutils, we'll want to stick with the current way of using 
readutmp, in which everything is dynamically linked before 'main' starts 
up. I realize this runs afoul of some of Debian's static checking for 
library usage, but we routinely run afoul of static checking all the 
time with GCC, and simply install exceptions when GCC's static checking 
issues a false positive. There needs to be something similar for the 
library usage static checkers; that is better than altering the source 
code to deal with a checker gone awry.

Other packages may prefer using dlopen here, just as they may prefer the 
alternatives (1) (2) (3) of my previous email; but they should also be 
allowed to use alternative (0) which is to use before-main dynamic 
linking like coreutils does now.


> +#include "gettext.h"
> +#define _(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid)

Let's not do that. Instead, the functions should fail and their callers 
should issue diagnostics. These functions are too low-level to be put in 
charge of user diagnostics.