From patchwork Fri May 2 10:16:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8665 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Zpn0W02xnz3x4T for ; Fri, 2 May 2025 10:17:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E5" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Zpn0V1zP5z6Gf for ; Fri, 2 May 2025 10:17:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Zpn094fxgz37X4 for ; Fri, 2 May 2025 10:16:57 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Zpmzy5Wnqz33j0 for ; Fri, 2 May 2025 10:16:46 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Zpmzy2CCLzlg; Fri, 2 May 2025 10:16:46 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Zpmzx39Y1zV5vT; Fri, 2 May 2025 10:16:45 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Cc: Michael Tremer Subject: [PATCH 12/42] unzip: Fix build with GCC 15 Date: Fri, 2 May 2025 10:16:02 +0000 Message-Id: <20250502101632.1082010-12-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250502101632.1082010-1-michael.tremer@ipfire.org> References: <20250502101632.1082010-1-michael.tremer@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Signed-off-by: Michael Tremer --- lfs/unzip | 8 ++++++-- src/patches/unzip-gnu89-build.patch | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/patches/unzip-gnu89-build.patch diff --git a/lfs/unzip b/lfs/unzip index 418ea7444..87ff9a3c7 100644 --- 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 index 000000000..706f12531 --- /dev/null +++ b/src/patches/unzip-gnu89-build.patch @@ -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