]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
unzip: Fix build with GCC 15
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 May 2025 10:16:02 +0000 (10:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 May 2025 14:32:43 +0000 (14:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/unzip
src/patches/unzip-gnu89-build.patch [new file with mode: 0644]

index 418ea74440286ccf616defc1c7bfa114b78de88c..87ff9a3c77fe99fb2906df9fdc7440a5df3f7a37 100644 (file)
--- a/lfs/unzip
+++ b/lfs/unzip
@@ -32,6 +32,9 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
+# Fix build with GCC 15
+CFLAGS += -std=gnu17
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -70,10 +73,11 @@ $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/unzip-gnu89-build.patch
        cd $(DIR_APP) && make -f unix/Makefile clean
-       cd $(DIR_APP)/unix && ./configure
+       cd $(DIR_APP)/unix && CFLAGS="$(CFLAGS)" ./configure
        # ARM/x86_64 cannot use the x86 32 bit assembly code.
-       cd $(DIR_APP) && make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux_noasm
+       cd $(DIR_APP) && make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 generic_gcc
        cd $(DIR_APP) && make prefix=/usr MANDIR=/usr/share/man/man1 -f unix/Makefile install
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/src/patches/unzip-gnu89-build.patch b/src/patches/unzip-gnu89-build.patch
new file mode 100644 (file)
index 0000000..706f125
--- /dev/null
@@ -0,0 +1,15 @@
+unzip uses C89-only features, so it needs to be built in C89 mode.
+
+diff --git a/unix/Makefile b/unix/Makefile
+index ab32270cf4b9b2cf..5eabbe13095e1f58 100644
+--- a/unix/Makefile
++++ b/unix/Makefile
+@@ -545,7 +545,7 @@ generic:   flags      # now try autoconfigure first
+ #     make $(MAKEF) unzips CF="${CF} `cat flags`"
+ generic_gcc:
+-      $(MAKE) $(MAKEF) generic CC=gcc IZ_BZIP2="$(IZ_BZIP2)"
++      $(MAKE) $(MAKEF) generic CC="gcc -std=gnu89" IZ_BZIP2="$(IZ_BZIP2)"
+ # extensions to perform SVR4 package-creation after compilation
+ generic_pkg:  generic svr4package