From 43da74f96a1342da31d28c815e6067550dc519b0 Mon Sep 17 00:00:00 2001 From: lichenggang Date: Wed, 18 Nov 2026 15:58:15 +0800 Subject: [PATCH] fix: restore CRYPT_LIBS in PROGRAM_LDADD for sw64 build support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add $(CRYPT_LIBS) to PROGRAM_LDADD in both Makefile.in and support/Makefile.in to fix build failures on sw64 architecture. All binaries link against libaprutil-1.so via PROGRAM_LDADD, but libcrypt.so.1.1 is not available on sw64, causing undefined reference to crypt_r@XCRYPT_2.0 for tools that do not explicitly link with -lcrypt. Only htpasswd and htdbm add $(CRYPT_LIBS) explicitly, so htdigest, httxt2dbm, htcacheclean, rotatelogs, logresolve, ab, checkgid and the main apache2 binary all fail at link time on sw64. The patch was originally added on 2.4.67 in commit 6e19d90 and was dropped by the automated 2.4.71 sync; this restores it and re-verifies that it still applies cleanly on 2.4.71. Log: Restored CRYPT_LIBS in PROGRAM_LDADD for sw64 build fix Influence: 1. Build apache2 on sw64 architecture should succeed 2. Verify all support tools and the main binary link correctly on sw64 3. Confirm the whole quilt series still applies cleanly on 2.4.71 4. Ensure no regression on other architectures (amd64, arm64, loongarch) fix: 恢复 PROGRAM_LDADD 中的 CRYPT_LIBS 以支持 sw64 构建 在 Makefile.in 和 support/Makefile.in 的 PROGRAM_LDADD 中添加 $(CRYPT_LIBS),修复 sw64 架构上的构建失败。所有二进制文件都通过 PROGRAM_LDADD 链接 libaprutil-1.so,但 sw64 上没有 libcrypt.so.1.1, 导致未显式链接 -lcrypt 的工具出现对 crypt_r@XCRYPT_2.0 的未定义引用。 当前只有 htpasswd 与 htdbm 显式加了 $(CRYPT_LIBS),因此 htdigest、 httxt2dbm、htcacheclean、rotatelogs、logresolve、ab、checkgid 以及 apache2 主程序在 sw64 上全部链接失败。 该补丁最初在 2.4.67 上以提交 6e19d90 引入,在自动同步 2.4.71 时被丢弃, 本次恢复并重新验证其在 2.4.71 上仍可干净应用。 Log: 恢复 PROGRAM_LDADD 中的 CRYPT_LIBS 以修复 sw64 构建 Influence: 1. 在 sw64 架构上构建 apache2 应该成功 2. 验证所有工具和主二进制文件在 sw64 上链接正确 3. 确认整个 quilt 序列在 2.4.71 上仍可干净应用 4. 确保其他架构(amd64、arm64、loongarch)无回归 repo: apache2 #master --- debian/changelog | 11 +++++++ debian/patches/htdigest-link-crypt.patch | 42 ++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 54 insertions(+) create mode 100644 debian/patches/htdigest-link-crypt.patch diff --git a/debian/changelog b/debian/changelog index 1a6f38b..6a22736 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +apache2 (2.4.71-1~deb13u1deepin1) unstable; urgency=medium + + * Fix build failure on sw64 architecture by adding $(CRYPT_LIBS) to PROGRAM_LDADD + - Add $(CRYPT_LIBS) to PROGRAM_LDADD in Makefile.in for the main apache2 binary + - Add $(CRYPT_LIBS) to PROGRAM_LDADD in support/Makefile.in for the support tools + - On sw64, libcrypt.so.1.1 is not available, causing undefined reference to + crypt_r@XCRYPT_2.0 for tools that do not explicitly link with -lcrypt + - Restore the patch that was dropped during the 2.4.71 sync + + -- lichenggang Wed, 18 Nov 2026 15:57:09 +0800 + apache2 (2.4.71-1~deb13u1) trixie-security; urgency=medium * New upstream release diff --git a/debian/patches/htdigest-link-crypt.patch b/debian/patches/htdigest-link-crypt.patch new file mode 100644 index 0000000..40c10f7 --- /dev/null +++ b/debian/patches/htdigest-link-crypt.patch @@ -0,0 +1,42 @@ +From: lichenggang +Date: Mon, 08 Jun 2026 10:58:00 +0800 +Subject: Fix build failure on sw64 by adding $(CRYPT_LIBS) to PROGRAM_LDADD + +On sw64 architecture, libcrypt.so.1.1 is not available, causing linker +failures for any tool linking against libaprutil-1.so which depends on +crypt_r. Unlike htpasswd and htdbm which explicitly link with $(CRYPT_LIBS), +other tools and the main apache2 binary only use $(PROGRAM_LDADD) which +does not include $(CRYPT_LIBS). + +Adding $(CRYPT_LIBS) to PROGRAM_LDADD in both Makefile.in and +support/Makefile.in ensures all binaries explicitly link against libcrypt, +resolving the undefined reference to crypt_r@XCRYPT_2.0 on sw64. + +Signed-off-by: lichenggang +--- +diff --git a/Makefile.in b/Makefile.in +index 11fbb20..9a3d786 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -4,7 +4,7 @@ CLEAN_SUBDIRS = test + + PROGRAM_NAME = $(progname) + PROGRAM_SOURCES = modules.c +-PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS) ++PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS) $(CRYPT_LIBS) + PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c + PROGRAM_DEPENDENCIES = \ + server/libmain.la \ +diff --git a/support/Makefile.in b/support/Makefile.in +index c7d7687..c1d8809 100644 +--- a/support/Makefile.in ++++ b/support/Makefile.in +@@ -7,7 +7,7 @@ bin_PROGRAMS = htpasswd htdigest htdbm ab logresolve httxt2dbm + sbin_PROGRAMS = htcacheclean rotatelogs $(NONPORTABLE_SUPPORT) + TARGETS = $(bin_PROGRAMS) $(sbin_PROGRAMS) + +-PROGRAM_LDADD = $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS) ++PROGRAM_LDADD = $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS) $(CRYPT_LIBS) + PROGRAM_DEPENDENCIES = + + include $(top_builddir)/build/rules.mk diff --git a/debian/patches/series b/debian/patches/series index 450653a..08e8a6e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ customize_apxs.patch build_suexec-custom.patch reproducible_builds.diff fix-macro.patch +htdigest-link-crypt.patch