Score:0

Ubuntu 22.04: perl ExtUtils::Embed is broken for ldopts

td flag

Running perl -MExtUtils::Embed -e ldopts results in unusable output:

-Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.34/CORE -lperl -ldl -lm -lpthread -lc -lcrypt

There is, in fact no libperl.so anywhere in the system. There are, however, /usr/lib/x86_64-linux-gnu/libperl.so.5.34 and /usr/lib/x86_64-linux-gnu/libperl.so.5.34.0 in /usr/lib/x86_64-linux-gnu. Not only is this directory missing from the output above, but libperl.so as a symlink there to libperl.so.5.34 or libperl.so.5.34.0 is also missing.

Note that Makefiles usually use the output of -e ccopts and -e ldopts to set arguments correctly with respect to the environment rather than hardcoding them. Now, with the ExtUtils::Embed module broken, reliable and portable builds are impossible. (Think, e.g. dockerized apps).

How did this get so royally fubar-ed? How can this be fixed?

EDIT/UPDATE: As suggested in the comments, thelibperl-dev package is installed. (apt-get says so).

UPDATE 2: The easiest fix may be in the libperl-dev package, which can install a libperl.so symlink in the original location of the libraries (/usr/local/lib?) as well. Then Embed.pm wouldn't need to change, as its output would work, thus preserving the dynamic settings in Makefiles too.

hr flag
AFAIK the symlink should be provided by the `libperl-dev` package - have you installed it?
Steffen Ullrich avatar
in flag
*"How did this get so royally fubar-ed?"* - simply by you not installing all requirements. Everything is provided by libperl-dev - see https://packages.ubuntu.com/it/jammy/amd64/libperl-dev/filelist
arayq2 avatar
td flag
@steeldriver, according to apt-get, yes.
hr flag
if the symlink was deleted, then reinstalling the package should be sufficient to re-create it
arayq2 avatar
td flag
@steeldriver, I tried that after posting. Result: `libperl.a` and `libperl.so` (a symlink) were properly installed in `/usr/lib/x86_64-linux-gnu` (how?!), but `Embed -e ldopts` stayed broken. I suspect the Ubuntu builders _moved_ the libraries from their original location (probably the CORE directory) to a "standard" location. If so, they forgot to adjust `Embed.pm`.
arayq2 avatar
td flag
On second thought, the how is easily explained under the hypothesis that the libraries were moved. Now, the install script for the `libperl-dev` package can simply _assume_ the libraries are in the "right" place and go straight there.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.