Thread View: linux.debian.bugs.dist
4 messages
4 total messages
Started by Andreas Tille
Wed, 11 Nov 2026 13:40
Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6
Author: Andreas Tille
Date: Wed, 11 Nov 2026 13:40
Date: Wed, 11 Nov 2026 13:40
130 lines
7624 bytes
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
Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6
Author: Dirk Eddelbuettel
Date: Wed, 11 Nov 2026 15:20
Date: Wed, 11 Nov 2026 15:20
188 lines
10151 bytes
10151 bytes
On 11 November 2026 at 14:34, Andreas Tille wrote:
| 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.
Regressions are not good.
| 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`.
Yes, can confirm starting quickly from a debian:stable container. Hm.
I have no change whatsoever in debian/changelog or comments in debian/rules.
What we did was always 'after the fact' as upstream sets nothing here as far
as I can remember. It has always been us -- see the $(somaj) business in
debian/rules.
And I do not recall changing this on purpose.
| 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
As it is just one package we could in fact do what you did and (for once)
explicitly add the Depends:. That is defensible given the usage pattern.
| 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)
Yes. And we ever only set somaj to 1.
| 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.
Nice analysis.
| 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.
Nice work. That is plausible.
I added this around that time, having realized I could parallelize
debian/rules, currently at lines 216 and 217.
## edd 17 Apr 2026 use DEB_BUILD_OPTION_PARALLEL if set
makeflags = $(addprefix -j,$(DEB_BUILD_OPTION_PARALLEL))
and then pass that down.
| (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.
I like that because it only relies on the underlying libRmath.so and all
'business' with $(somaj) remains in debian/rules outside of a patch.
It's also something I could then send upstream but it would probably need the
somaj business too.
| 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`).
That would work, but presumably be once again a little slower in building.
| 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
Thanks for an extremely detailed bug report!
I had actually run more than half a dozen local builds recently to get the
.pc files for R and Rmathlib out of /usr/lib/pkgconfig into
/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig (and even got upstream involved but
we could not find a way to let autoconf do that; I am setting
--build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) \
but no (upstream) Makefiles get the new directory :-/. So with that I have
another local half-reason for a new version so will apply this patch idea.
Dirk
| 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
--
dirk.eddelbuettel.com | @eddelbuettel | edd@debian.org
Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6
Author: Dirk Eddelbuettel
Date: Wed, 11 Nov 2026 16:00
Date: Wed, 11 Nov 2026 16:00
30 lines
2955 bytes
2955 bytes
Your PR proposal worked fine, thanks again for the idea: root@c606e5daf0a8:/work# dpkg -s r-mathlib | grep Version Version: 4.6.2-1 root@c606e5daf0a8:/work# readelf -d /usr/lib/libRmath.so | grep SONAME root@c606e5daf0a8:/work# root@c606e5daf0a8:/work# dpkg -i ./r-mathlib_4.6.2-2_amd64.deb (Reading database… 19722 files and directories currently installed.) Preparing to unpack ./r-mathlib_4.6.2-2_amd64.deb… Unpacking r-mathlib (4.6.2-2) over (4.6.2-1)… Setting up r-mathlib (4.6.2-2)… root@c606e5daf0a8:/work# readelf -d /usr/lib/libRmath.so | grep SONAME 0x000000000000000e (SONAME) Library soname: [libRmath.so] root@c606e5daf0a8:/work# No soname in 4.6.2-1 (current) but soname in upcoming -2 release. Rebuilding as I forgot a newline at the end of debian/patches/series, then uploading. Dirk -- dirk.eddelbuettel.com | @eddelbuettel | edd@debian.org
Bug#1153736: r-mathlib: libRmath.so.1.0.0 is shipped without a SONAME since R 4.6
Author: Andreas Tille
Date: Wed, 11 Nov 2026 16:20
Date: Wed, 11 Nov 2026 16:20
34 lines
3176 bytes
3176 bytes
Hi Dirk,
Am Wed, Nov 11, 2026 at 09:52:36AM -0600 schrieb Dirk Eddelbuettel:
>
> Your PR proposal worked fine, thanks again for the idea:
>
> root@c606e5daf0a8:/work# dpkg -s r-mathlib | grep Version
> Version: 4.6.2-1
> root@c606e5daf0a8:/work# readelf -d /usr/lib/libRmath.so | grep SONAME
> root@c606e5daf0a8:/work#
> root@c606e5daf0a8:/work# dpkg -i ./r-mathlib_4.6.2-2_amd64.deb
> (Reading database… 19722 files and directories currently installed.)
> Preparing to unpack ./r-mathlib_4.6.2-2_amd64.deb…
> Unpacking r-mathlib (4.6.2-2) over (4.6.2-1)…
> Setting up r-mathlib (4.6.2-2)…
> root@c606e5daf0a8:/work# readelf -d /usr/lib/libRmath.so | grep SONAME
> 0x000000000000000e (SONAME) Library soname: [libRmath.so]
> root@c606e5daf0a8:/work#
>
> No soname in 4.6.2-1 (current) but soname in upcoming -2 release.
Cool. Thanks a lot.
> Rebuilding as I forgot a newline at the end of debian/patches/series, then
> uploading.
Just take your time.
Thanks a lot for your cooperation
Andreas.
--
https://fam-tille.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads