Source: php-horde-lz4
Version: 1.0.10-10
Severity: serious
Tags: ftbfs patch
Justification: fails to build from source (but built successfully in the past)
Control: block 1149581 by -1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

php-horde-lz4 fails to build in unstable with liblz4-dev 1.11.1-2:

  horde_lz4.c: In function 'zif_horde_lz4_compress':
  horde_lz4.c:102:22: error: implicit declaration of function 'LZ4_compressHC'; 
did you mean 'LZ4_compress_HC'? [-Wimplicit-function-declaration]
  horde_lz4.c:104:22: error: implicit declaration of function 'LZ4_compress'; 
did you mean 'LZ4_compress_HC'? [-Wimplicit-function-declaration]

lz4 1.11.0 removed the declarations of LZ4_compress() and
LZ4_compressHC(), deprecated since 1.7, from lz4.h and lz4hc.h.  The
library still exports the symbols, so the binary in the archive keeps
working.

The attached patch calls LZ4_compress_default() and LZ4_compress_HC()
instead, with the arguments the removed wrappers passed on to them, so
the compressed output does not change.  Both functions exist since lz4
1.7.0; the old calls are kept for older versions, which covers the lz4
1.2.0 bundled in lib/.

With the patch the package builds in an unstable sbuild chroot (php8.4
8.4.28-3, liblz4-dev 1.11.1-2).

I found this while test-building for the php8.6 transition (#1149581),
for which the package needs a rebuild.  With the patch it also builds
with php8.6 8.6.0-3 and php-defaults 108~exp2 from experimental; nothing
specific to PHP 8.6 is needed.  The build runs no tests, so I ran the
assertions of the upstream unit test against the module built for PHP
8.6: all 19 checks pass.

Upstream has made no release since 2016, so there is nowhere to send the
patch.

The autopkgtest fails for a different reason; I am filing that
separately.


- -- System Information:
Debian Release: 13.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.117+deb13-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEw2Gx4wKVQ+vGJel9g3Kkd++uWcIFAmsKoLFfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEMz
NjFCMUUzMDI5NTQzRUJDNjI1RTk3RDgzNzJBNDc3RUZBRTU5QzIACgkQg3Kkd++u
WcJyMw//SZpd4bId9KOjS3lRmVu3fcKiReO7lQg+9IQYQqCBHh8TmHJ+c+pgEEnZ
0l67BxnoULxfnw7GIkiCl3lofVaqENUDRujETptOKTELnx43tDWEk05khub+YPX9
yBaLGMxxfR4lpgjQtCszDo+RR1ca9hv5K0uw3kMKKwLvdmrwG7VmaLzyIicm3Mm5
+6UuMnWwrZGWo+xbUwvF3wcs31plSAtRsV1psRsYt5KNXLFZbIFWyLSOBrq+xjI7
BmxiDmLWy2kEH6ZwmzZ2L+MRfwL4Coqx7BESwrfeV5GeeQpdYmkrUn9hA1TkWRMU
1fuUPg4UFiu9vLdBXqjb5lhGBxHlPlczrdZnmz2XdbwyqdXBx6vzbDfMpyh5h20f
VavjQcflH/G2dcKmn6wsMxg77VZERUZROmQQvp6V0V8+GLauxh4RxguHF9m88/wY
A375UDdyOX7dfqWeVU00uPohYen9McxWsU8SDxAE0aA4UjEcBjBBJMclTvxYiCBT
6KrumR1pLZCwMpAzONJC/GLE5z/J4IjLrb1H3RX3fIk3IwDju8MsFI16F3zAaBM1
tKEgZWhYmSeNQX/hfAu3SH5JdkArozk8xE7fpU6fEKLliCNNZRzB2WDkqf11Cw9t
RTxakxhLUY4DIzuTAuUCcadD0M6ULmnsqO7SyQX6bCrnfc/kPJk=
=Qhs2
-----END PGP SIGNATURE-----
Description: Fix build with lz4 >= 1.11 (LZ4_compress() and LZ4_compressHC() 
are gone)
 lz4 1.11.0 removed the declarations of the long-deprecated LZ4_compress()
 and LZ4_compressHC() from its headers (the library still exports the
 symbols for already linked programs), so the build fails with:
 .
   horde_lz4.c:102:22: error: implicit declaration of function 
'LZ4_compressHC'; did you mean 'LZ4_compress_HC'?
   horde_lz4.c:104:22: error: implicit declaration of function 'LZ4_compress'; 
did you mean 'LZ4_compress_HC'?
 .
 Call LZ4_compress_default() and LZ4_compress_HC() instead, with exactly the
 arguments the removed wrappers passed to them, so the output does not
 change.  Both functions exist since lz4 1.7.0 (r129); the old calls are kept
 for older versions, which includes the lz4 1.2.0 bundled in lib/.
 .
 This failure does not depend on the PHP version, but it has to be fixed
 before the package can be rebuilt for PHP 8.6.
Author: Ondřej Surý <[email protected]>
Forwarded: no
Last-Update: 2026-11-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/horde_lz4-1.0.10/horde_lz4.c
+++ b/horde_lz4-1.0.10/horde_lz4.c
@@ -98,11 +98,21 @@
     output[0] = horde_lz4_headerid;
     memcpy(output + sizeof(horde_lz4_headerid), &data_len, sizeof(data_len));
 
+#if defined(LZ4_VERSION_NUMBER) && LZ4_VERSION_NUMBER >= 10700
+    /* LZ4_compress() and LZ4_compressHC() are deprecated since lz4 1.7.0 and
+     * no longer declared by lz4 >= 1.11.0; this is what they expand to. */
+    if (high) {
+        output_len = LZ4_compress_HC(Z_STRVAL_P(data), output + header_offset, 
data_len, LZ4_compressBound(data_len), 0);
+    } else {
+        output_len = LZ4_compress_default(Z_STRVAL_P(data), output + 
header_offset, data_len, LZ4_compressBound(data_len));
+    }
+#else
     if (high) {
         output_len = LZ4_compressHC(Z_STRVAL_P(data), output + header_offset, 
data_len);
     } else {
         output_len = LZ4_compress(Z_STRVAL_P(data), output + header_offset, 
data_len);
     }
+#endif
 
     if (output_len <= 0) {
         RETVAL_FALSE;

Reply via email to