diff options
author | Gaël PORTAY <gael.portay@collabora.com> | 2020-12-18 12:12:54 -0500 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-03-23 10:51:31 +0100 |
commit | bd273d2703dc8b862269ee700a83571730c25d3d (patch) | |
tree | ba46f9570663634ace1926fa53595630d254f425 | |
parent | a2dcb19d8d431dc7b5b1f7e52f238a41d1ecdeff (diff) |
two-step: Links against libintl.so if LNS
The plugin two-step cannot be loaded on a system based on the musl libc
library.
01:25:00.427 ply-utils.c:536:ply_open_module : Could not load module "/usr/lib/plymouth/two-step.so": Error relocating /usr/lib/plymouth/two-step.so: libintl_dgettext: symbol not found
The utilities ldd and objdump reports the missing symbol:
# ldd /usr/lib/plymouth/two-step.so
/lib/ld-musl-aarch64.so.1 (0x7fad6c0000)
libply-splash-graphics.so.5 => /usr/lib/libply-splash-graphics.so.5 (0x7fad683000)
libply-splash-core.so.5 => /lib/libply-splash-core.so.5 (0x7fad654000)
libply.so.5 => /lib/libply.so.5 (0x7fad629000)
libc.musl-aarch64.so.1 => /lib/ld-musl-aarch64.so.1 (0x7fad6c0000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7fad5ea000)
libudev.so.1 => /lib/libudev.so.1 (0x7fad5b7000)
libz.so.1 => /lib/libz.so.1 (0x7fad590000)
Error relocating /usr/lib/plymouth/two-step.so: libintl_dgettext: symbol not found
# objdump -T /usr/lib/plymouth/two-step.so | grep gettext
0000000000000000 D *UND* 0000000000000000 libintl_dgettext
The missing symbol is archived to the library libintl.so (running
plymouthd with the environment LD_PRELOAD=/usr/lib/libintl.so fixes the
issue).
# objdump -T /usr/lib/libintl.so | grep gettext
0000000000005aa0 g DF .text 0000000000000008 libintl_dngettext
0000000000007134 g DF .text 0000000000000004 dgettext
0000000000002300 g DF .text 0000000000000014 libintl_dcgettext
0000000000005aa8 g DF .text 0000000000000018 libintl_ngettext
0000000000007130 g DF .text 0000000000000004 gettext
0000000000007140 g DF .text 0000000000000004 dngettext
0000000000002314 g DF .text 0000000000000008 libintl_dgettext
000000000000231c g DF .text 0000000000000010 libintl_gettext
0000000000007138 g DF .text 0000000000000004 dcgettext
000000000000713c g DF .text 0000000000000004 ngettext
0000000000005a90 g DF .text 0000000000000010 libintl_dcngettext
0000000000007144 g DF .text 0000000000000004 dcngettext
The story is much complicated, however, the autotools does the magic.
The GNU gettext FAQ[1] says explicitly that if the program's final link
command does not contain the option -lintl...
> In this case it's likely a bug in the package you are building: The
package's Makefiles should make sure that “-lintl” is used where needed.
Autoconf sets both variables LIBINTL and LTLIBINTL with the appropriate
link options if NLS is being used. These variables are left empty if the
option --disable-nls is set at the configure step.
LIBINTL = /usr/lib/libintl.so
LTLIBINTL = -L/usr/lib -lintl
This links the plugin two-step to libintl by adding the libtool variable
LTLIBINTL to the list of the plugin's libraries to link with.
Note: The plugin two-step loads fine on a system based on the glibc
library (without this commit). The plugin uses the intermediate symbol
dcgettext which is implemented by the glibc instead of the remapped
symbol libintl_gettext which is implemented by gettext in libintl.
On glibc:
# objdump -T /usr/lib/plymouth/two-step.so | grep gettext
0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dcgettext
$ objdump -T /usr/lib/libc.so.6 | grep gettext
0000000000037ec0 w DF .text 0000000000000014 GLIBC_2.2.5 dcngettext
0000000000036630 w DF .text 0000000000000013 GLIBC_2.2.5 dcgettext
0000000000037ef0 w DF .text 000000000000001a GLIBC_2.2.5 ngettext
0000000000036660 w DF .text 0000000000000013 GLIBC_2.2.5 gettext
0000000000036630 g DF .text 0000000000000013 GLIBC_2.2.5 __dcgettext
0000000000036650 w DF .text 000000000000000e GLIBC_2.2.5 dgettext
0000000000036650 g DF .text 000000000000000e GLIBC_2.2.5 __dgettext
0000000000037ee0 w DF .text 000000000000000f GLIBC_2.2.5 dngettext
On musl:
# objdump -T /usr/lib/plymouth/two-step.so | grep gettext
0000000000000000 D *UND* 0000000000000000 libintl_dgettext
# objdump -T /lib/libc.musl-aarch64.so.1 | grep gettext
0000000000025724 g DF .text 0000000000000010 dcgettext
0000000000027828 g DF .text 0000000000000014 ngettext
0000000000025734 g DF .text 0000000000000008 dngettext
000000000002573c g DF .text 0000000000000010 dgettext
000000000002781c g DF .text 000000000000000c gettext
0000000000025294 g DF .text 0000000000000490 dcngettext
# objdump -T /usr/lib/libintl.so | grep libintl_dgettext
0000000000002314 g DF .text 0000000000000008 libintl_dgettext
However, this commit changes nothing for system based on glibc as the
magic of the Autoconf leaves the LIBINTL and LTLIBINTL empty even if the
NLS is being used.
[1]: https://www.gnu.org/software/gettext/FAQ.html#integrating_undefined
Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
-rw-r--r-- | src/plugins/splash/two-step/Makefile.am | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/splash/two-step/Makefile.am b/src/plugins/splash/two-step/Makefile.am index f3a6aaa9..c7dbb5b6 100644 --- a/src/plugins/splash/two-step/Makefile.am +++ b/src/plugins/splash/two-step/Makefile.am @@ -17,7 +17,7 @@ two_step_la_CFLAGS = $(PLYMOUTH_CFLAGS) \ -DPLYMOUTH_BACKGROUND_END_COLOR=$(background_end_color) \ -DPLYMOUTH_BACKGROUND_START_COLOR=$(background_start_color) two_step_la_LDFLAGS = -module -avoid-version -export-dynamic -two_step_la_LIBADD = $(PLYMOUTH_LIBS) \ +two_step_la_LIBADD = $(PLYMOUTH_LIBS) $(LTLIBINTL) \ ../../../libply/libply.la \ ../../../libply-splash-core/libply-splash-core.la \ ../../../libply-splash-graphics/libply-splash-graphics.la |