diff options
author | Teague Sterling <teaguesterling@users.noreply.github.com> | 2024-07-15 10:42:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 19:42:41 +0200 |
commit | 2afaeba292bc2298cc7754d2ad2d7601be1d8306 (patch) | |
tree | 14dc9f6364b598d03c77bc5299fc5d5771c3e668 | |
parent | a14e76b98d62ac8e3b9788cf732e13ce84f7198d (diff) | |
download | spack-2afaeba292bc2298cc7754d2ad2d7601be1d8306.tar.gz spack-2afaeba292bc2298cc7754d2ad2d7601be1d8306.tar.bz2 spack-2afaeba292bc2298cc7754d2ad2d7601be1d8306.tar.xz spack-2afaeba292bc2298cc7754d2ad2d7601be1d8306.zip |
zip: add patch for gcc@14: (#45006)
3 files changed, 102 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/zip/11-typo-it-is-ambiguities-not-amgibuities.patch b/var/spack/repos/builtin/packages/zip/11-typo-it-is-ambiguities-not-amgibuities.patch new file mode 100644 index 0000000000..aa61ba5fc5 --- /dev/null +++ b/var/spack/repos/builtin/packages/zip/11-typo-it-is-ambiguities-not-amgibuities.patch @@ -0,0 +1,26 @@ +From: Santiago Vila <sanvila@debian.org> +Subject: manpage typo: amgibuities -> ambiguities +X-Debian-version: 3.0-12 + +--- a/man/zip.1 ++++ b/man/zip.1 +@@ -297,7 +297,7 @@ + If Zip64 support for large files and archives is enabled and + \fIzip\fR is used as a filter, \fIzip\fR creates a Zip64 archive + that requires a PKZIP 4.5 or later compatible unzip to read it. This is +-to avoid amgibuities in the zip file structure as defined in the current ++to avoid ambiguities in the zip file structure as defined in the current + zip standard (PKWARE AppNote) where the decision to use Zip64 needs to + be made before data is written for the entry, but for a stream the size + of the data is not known at that point. If the data is known to be smaller +--- a/zip.txt ++++ b/zip.txt +@@ -184,7 +184,7 @@ + + If Zip64 support for large files and archives is enabled and zip is + used as a filter, zip creates a Zip64 archive that requires a PKZIP 4.5 +- or later compatible unzip to read it. This is to avoid amgibuities in ++ or later compatible unzip to read it. This is to avoid ambiguities in + the zip file structure as defined in the current zip standard (PKWARE + AppNote) where the decision to use Zip64 needs to be made before data + is written for the entry, but for a stream the size of the data is not diff --git a/var/spack/repos/builtin/packages/zip/12-gcc14-no-implicit-declarations-fix.patch b/var/spack/repos/builtin/packages/zip/12-gcc14-no-implicit-declarations-fix.patch new file mode 100644 index 0000000000..2f2f7c164b --- /dev/null +++ b/var/spack/repos/builtin/packages/zip/12-gcc14-no-implicit-declarations-fix.patch @@ -0,0 +1,71 @@ +diff --git a/unix/configure b/unix/configure +index 6a3d1d9..148a6d6 100644 +--- a/unix/configure ++++ b/unix/configure +@@ -509,17 +509,32 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null + # Check for missing functions + # add NO_'function_name' to flags if missing + +-for func in rmdir strchr strrchr rename mktemp mktime mkstemp ++for func_hdr in unistd/rmdir string/strchr string/strrchr stdio/renaae \ ++ stdlib/mktemp time/mktime stdlib/mkstemp + do +- echo Check for $func ++ hdr=${func_hdr%/*} ++ func=${func_hdr#*/} ++ echo -n Check for $func + echo "int main(){ $func(); return 0; }" > conftest.c + $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null +- [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" +-done ++ if [ $? -ne 0 ] ; then ++ echo " ... in $hdr" ++ cat > conftest.c << _EOF_ ++#include <$hdr.h> ++int main(){ $func(); return 0; } ++_EOF_ ++ [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" ++ else ++ echo ++ fi ++ done + + + echo Check for memset +-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c ++cat > conftest.c << _EOF_ ++#include <string.h> ++int main(){ char k; memset(&k,0,0); return 0; } ++_EOF_ + $CC -o conftest conftest.c >/dev/null 2>/dev/null + [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" + +@@ -544,7 +559,7 @@ $CC -o conftest conftest.c >/dev/null 2>/dev/null + echo Check for errno declaration + cat > conftest.c << _EOF_ + #include <errno.h> +-main() ++int main() + { + errno = 0; + return 0; +@@ -556,6 +571,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null + + echo Check for directory libraries + cat > conftest.c << _EOF_ ++#include <dirent.h> + int main() { return closedir(opendir(".")); } + _EOF_ + +diff --git a/timezone.c b/timezone.c +index 485ec02..325fd5a 100644 +--- a/timezone.c ++++ b/timezone.c +@@ -39,6 +39,7 @@ + + #include "zip.h" + #include "timezone.h" ++#include <time.h> + #include <ctype.h> + #include <errno.h> + diff --git a/var/spack/repos/builtin/packages/zip/package.py b/var/spack/repos/builtin/packages/zip/package.py index 67875af482..1ae7a6dde3 100644 --- a/var/spack/repos/builtin/packages/zip/package.py +++ b/var/spack/repos/builtin/packages/zip/package.py @@ -32,6 +32,11 @@ class Zip(MakefilePackage): patch("08-hardening-build-fix-1.patch") patch("09-hardening-build-fix-2.patch") patch("10-remove-build-date.patch") + patch("11-typo-it-is-ambiguities-not-amgibuities.patch") + + # Configure and header changes needed for comatibility with strict gcc14+ + # these are not from the debian branch + patch("12-gcc14-no-implicit-declarations-fix.patch", when="%gcc@14:") executables = ["^zip$"] |