Come to think of it, that new use of AC_REQUIRE([AC_CANONICAL_HOST]) at gzip/configure.ac's is problematic. I guess it works because Gnulib has already called AC_CANONICAL_HOST by then, but we shouldn't assume that without checking. I worked around the issue by instead checking that Gnulib has called AC_CANONICAL_HOST, and by using AS_CASE rather than 'case' while I was in the neighborhood.

Attached is the output of "git diff -b 3d8a75cd2179bc387abae2c632507c127c7ad86d^..4db3180bb1ad1b1ee12cab9b7555b7f743f24604 configure.ac" to indicate all the recent changes made to configure.ac, sans whitespace changes, so that it's easy to review the combination of the recent flurry of patches in this area.

If there's an Alpine expert in the house I suppose we could even port that asm to Alpine. Low priority, though.
diff --git a/configure.ac b/configure.ac
index f319346..4f69098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,10 +248,16 @@ AC_OBJEXT
 AC_CACHE_CHECK([for an assembler syntax supported by this package],
   [gzip_cv_assembler],
   [gzip_cv_assembler=no
-   case $DEFS in
-   *NO_ASM*) ;;
-   *)
-     if cp $srcdir/lib/match.c _match.S &&
+   AS_CASE([$DEFS],
+     [*NO_ASM*], [],
+     [# 'host_os?' ensures Gnulib sets host_os as usual.
+      AS_CASE([${host_os?}],
+        [*-musl* | midipix*],
+          [Avoid a crash in musl libc's startup code,
+           # because musl doesn't support TEXTRELs.
+           # https://www.openwall.com/lists/musl/2020/09/25/1
+          ],
+        [if cp $srcdir/lib/match.c _match.S &&
             eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" &&
             eval "$ASCPPPOST < _match.i > match_.s"; then
            if test ! -s match_.s || grep error < match_.s > /dev/null; then
@@ -269,8 +275,7 @@ AC_CACHE_CHECK([for an assembler syntax supported by this package],
              fi
            fi
          fi
-     rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
-   esac])
+         rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT])])])
 if test "$gzip_cv_assembler" != no; then
   AC_DEFINE([ASMV], ,
     [Define if an assembler version of longest_match is available.])

Reply via email to