🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4139

Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6

#4139
From: Andreas Tille
Date: Wed, 11 Nov 2026 13:40
130 lines
7624 bytes
Source: r-base
Version: 4.6.2-1
Severity: important
X-Debbugs-Cc: 1153729@bugs.debian.org, r-pkg-team@alioth-lists.debian.net

Hi,

This bug report is a consequence from #1153729 which was basically
caused by the issue described below.  I was able to work around by an
explicit Depends: r-mathlib but this was not needed before and could be
unnecessary if you follow the suggested approach.

Since the R 4.6.x packages, the standalone Rmath shared library shipped in
r-mathlib has NO embedded SONAME.  This is a regression against r-base
4.5.0-3, whose libRmath.so.1.0.0 carries `SONAME libRmath.so.1`.

Concrete consequence: downstream packages that link with -lRmath get the
*unversioned* filename `libRmath.so` as their DT_NEEDED entry instead of
`libRmath.so.1`.  dpkg-shlibdeps cannot map that name to a package
(r-mathlib only ships shlibs data under the libRmath.so.1 soname), so the
generated r-mathlib dependency silently disappears.  This is exactly the
failure reported in fastqtl's autopkgtest regression (Bug#1153729):
fastQTL then starts without r-mathlib installed and dies with

    fastQTL: error while loading shared libraries: libRmath.so:
    cannot open shared object file: No such file or directory

Evidence
--------

1. SONAME delta in the shipped binaries (readelf):

   r-mathlib 4.5.0-3 (trixie):  0x0e (SONAME) Library soname: [libRmath.so.1]
   r-mathlib 4.6.1-9 (forky):   (no SONAME entry)
   r-mathlib 4.6.2-1 (sid):     (no SONAME entry)

2. The soname flag IS still passed by debian/rules to the standalone make
   (identical in 4.5.0-3 and 4.6.x, e.g. current rules line 387):

       libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \
       shared static)

   and the upstream build files are unchanged: src/nmath/standalone/Makefile.in
   is byte-identical between 4.5.0-3 and 4.6.1-9 (same sha256 a476b184...),
   and etc/Makeconf.in only differs by the removal of the CXX11/CXX14 blocks
   (DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS) unchanged).

3. Buildd logs show the flag reaching the link in 4.5.0-3 but NOT in 4.6.1-9:

   r-base_4.5.0-3 amd64 build log, line 4911 (the link command):
       gcc -shared -fopenmp -Wl,-z,relro -o libRmath.so
           -Wl,-soname,libRmath.so.1 mlutils.lo ... std_unif.lo -lm

   r-base_4.6.1-9 amd64 build log, line 5257 (the link command):
       x86_64-linux-gnu-gcc -shared -fopenmp -Wl,-z,relro -o libRmath.so
           mlutils.lo ... std_unif.lo

   (logs: https://buildd.debian.org/fetch.php?pkg=r-base&arch=amd64&ver=4.5.0-3&stamp=1745967329&raw=1
         https://buildd.debian.org/fetch.php?pkg=r-base&arch=amd64&ver=4.6.1-9&stamp=1792175046&raw=1 )

   In 4.6.1-9 the `-Wl,-soname,libRmath.so.1` argument is gone AND `$(LIBM)`
   (i.e. -lm) is gone too, even though both are on the same link recipe as in
   4.5.0-3.  So the recipe ran with libRmath_la_LDFLAGS and LIBM both empty.

Analysis / what changed
-----------------------

The 4.6.x debian/rules started passing `MAKEFLAGS="$(makeflags)"` (=-j6 on
the buildds) into every make invocation, including the standalone one; this
is absent in 4.5.0-3 (its build log contains no MAKEFLAGS at all):

   r-base_4.6.1-9 build log lines 4878-4879 (the standalone invocation):
       MAKEFLAGS="-j6"                \
       libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.1 \
       shared static )

Overriding MAKEFLAGS wholesale replaces the MAKEFLAGS that GNU make would
otherwise export to the nested `$(MAKE)` runs inside src/nmath/standalone
(the `shared` target runs `$(MAKE) libRmath.so`), and command-line variable
definitions are forwarded to sub-makes *through* MAKEFLAGS.  With MAKEFLAGS
forced to a bare "-j6" the libRmath_la_LDFLAGS assignment no longer reaches
the make instance that executes the `$(libRmath_la)` link recipe, so the
library is linked without a soname.

(A minimal GNU make 4.4.1 replica of that packaging idiom does propagate the
variable, so the loss happens specifically inside R's parallel -j6 build
topology; the two buildd logs above pinpoint it empirically.)

Suggested fix (make the soname independent of make variable forwarding)
----------------------------------------------------------------------

Best: set the soname in the makefile itself rather than injecting it as a
fragile command-line override.  In src/nmath/standalone/Makefile.in, replace
the empty definition with the real value:

    -libRmath_la_LDFLAGS =
    +libRmath_la_LDFLAGS = -Wl,-soname,libRmath.so

(or hard-code the full `-Wl,-soname,libRmath.so.1`; the major number is
already managed by debian/rules' $(somaj) for the installed symlink names).
This matches the existing packaged file names (libRmath.so.1.0.0 /
libRmath.so.1 / libRmath.so) and is robust regardless of MAKEFLAGS handling.
It can be applied as a Debian patch or forwarded upstream.

Alternatively stop setting MAKEFLAGS for the standalone make call so GNU
make's automatic command-line-variable forwarding keeps working, or pass
the soname flag through a location that is not a make command-line
variable (it must survive into the nested `make libRmath.so`).

Once the SONAME is back on libRmath.so.1.0.0, the normal shlibs handling
ships r-mathlib as a dependency of -lRmath consumers again (as it did with
4.5.0-3) and the fastqtl autopkgtest regression (Bug#1153729) is resolved at
the root.

Thanks for maintaining r-base
     Andreas.


-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (501, 'testing'), (50, 'buildd-unstable'), (50, 'unstable'), (5, 'experimental'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 7.2.9+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:de
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Technical Details
Message-ID: <NYgIp-besA-15@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Andreas Tille <tille@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6
Date: Wed, 11 Nov 2026 14:40:01 +0100
Message-ID: <NYgIp-besA-15@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov 11 13:35:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Andreas Tille <tille@debian.org>, 1153736@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: 1153729@bugs.debian.org, r-pkg-team@alioth-lists.debian.net, edd@debian.org
X-Debian-Pr-Message: report 1153736
X-Debian-Pr-Package: src:r-base
X-Debian-Pr-Source: r-base
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0+nmu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002034
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 130
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 11 Nov 2026 14:34:16 +0100
X-Original-Message-ID: <179440405644.324070.16967485774907607366.reportbug@energija.fam-tille.de>