[Pkg-zsh-devel] Bug#1052441: zsh: FTBFS with glibc 2.38 on i386 due to missing fmod in libm.a

Steve Langasek steve.langasek at canonical.com
Fri Sep 22 06:11:03 BST 2023


Package: zsh
Version: 5.9-5
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear maintainers,

In Ubuntu, zsh was failing to build from source on i386 because Ubuntu has
glibc 2.38, and libm.a on i386 is failing to provide the fmod symbol,
causing an inability to link zsh-static.

This is ultimately a bug in glibc, filed in Ubuntu at
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2036283>.  However,
since i386 is a partial arch in Ubuntu and we don't actually need zsh-static
for anything (but "unfortunately" do need zsh/i386 as a build-dependency of
vlc), rather than spending time getting zsh-static to build again on i386,
and then possibly having to do so again later because i386 and math is a
fragile combination, I found it preferable to just disable the build of
zsh-static on Ubuntu i386.

I've uploaded the attached patch to Ubuntu.  It has been constructed in such
a way that it can be included in Debian without adversely affecting any
Debian builds, and would allow us to keep the zsh package in Ubuntu in sync
with that in Debian.

Please consider applying this patch.  If you don't want to carry this added
complexity in debian/rules that only benefits a downstream distribution,
however, please feel free to close the bug report.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru zsh-5.9/debian/rules zsh-5.9/debian/rules
--- zsh-5.9/debian/rules	2023-07-04 18:24:39.000000000 -0700
+++ zsh-5.9/debian/rules	2023-09-21 21:49:44.000000000 -0700
@@ -48,6 +48,10 @@
 CONFIGFLAGS += --enable-zsh-hash-debug
 endif
 
+ifeq ($(DEB_HOST_ARCH):$(VENDOR),i386:ubuntu)
+	PKGS=-Nzsh-static
+endif
+
 # We first need to check if the package is installed, otherwise the
 # resulting syntax might be invalid. Needed for packages which are
 # also provided by other packages like libncurses-dev and
@@ -55,13 +59,16 @@
 BUILT_USING=$(shell for pkg in libcap-dev libncurses-dev libpcre2-dev libc-dev-bin; do dpkg-query -f '$${status}' -W $$pkg 2>&1 | grep -Fq installed && dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W $$pkg; done)
 
 %:
-	dh $@
+	dh $@ $(PKGS)
 
 override_dh_auto_build-arch: build-dynamic build-static
 build-dynamic:
 	dh_auto_build -B obj
 build-static:
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	dh_auto_build -B obj-static
+endif
+	:
 
 override_dh_auto_build-indep:
 	dh_auto_build -B obj -- pdf
@@ -71,7 +78,9 @@
 	if dpkg-architecture -qDEB_BUILD_ARCH_OS | grep -qv hurd; then \
 		HOME="$(CURDIR)/obj/testhome" ZTST_verbose=1 dh_auto_test -B obj; \
 	fi
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	HOME="$(CURDIR)/obj-static/testhome" ZTST_verbose=1 dh_auto_test -B obj-static || true
+endif
 
 override_dh_auto_test-indep:
 
@@ -79,16 +88,24 @@
 	chmod 755 configure
 	mkdir -p obj/testhome obj-static/testhome
 	dh_auto_configure -B obj -- $(CONFIGFLAGS)
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	dh_auto_configure -B obj-static -- $(CONFIGFLAGS) $(STATICFLAGS)
+endif
 
 	sed -e 's/#define VENDOR "pc"/#define VENDOR "$(VENDOR)"/' \
-	    -i obj/config.h obj-static/config.h
+	    -i obj/config.h
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
+	sed -e 's/#define VENDOR "pc"/#define VENDOR "$(VENDOR)"/' \
+	    -i obj-static/config.h
 	sed -e 's/files.mdd link=no/files.mdd link=static/;s/stat.mdd link=no/stat.mdd link=static/' \
 	    -i obj-static/config.modules
+endif
 
 override_dh_auto_clean:
 	dh_auto_clean -B obj
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	dh_auto_clean -B obj-static
+endif
 
 override_dh_installdocs-indep:
 	dh_installdocs -pzsh-doc --link-doc=zsh-common --doc-main-package=zsh-common
@@ -148,12 +165,16 @@
 		-dRecommends debian/zsh/usr/lib/*/zsh/*/zsh/*.so
 
 execute_after_dh_installdocs-arch:
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	awk 'BEGIN { print "The following modules are statically-compiled into the static zsh binary:\n"; } /link=static/ { printf "%s (%s %s)\n", substr($$1,6), $$4, $$5; }' obj-static/config.modules >debian/zsh-static/usr/share/doc/zsh-static/README.Debian
+endif
 
 execute_after_dh_install-arch:
+ifneq (,$(filter zsh-static, $(shell dh_listpackages)))
 	mv debian/zsh-static/bin/zsh  debian/zsh-static/bin/zsh-static
 	mv debian/zsh-static/bin/zsh5 debian/zsh-static/bin/zsh5-static
 	sed -e 's:#!/bin/zsh:#!/bin/zsh-static:' -i debian/zsh-static/bin/zsh5-static
+endif
 
 	find debian/zsh-dev/usr/include/zsh -name '*.h' -o -name '*.mdh' | \
 	  xargs sed -e 's@\.\./config\.h at config.h@;s@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' -i


More information about the Pkg-zsh-devel mailing list