From patchwork Mon Aug 19 10:06:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8026 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 "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4WnSt90wfNz3x41 for ; Mon, 19 Aug 2024 10:06:25 +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 4WnSt750PHz5sG; Mon, 19 Aug 2024 10:06:23 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4WnSt74Sg4z341Y; Mon, 19 Aug 2024 10:06:23 +0000 (UTC) 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 "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4WnSst6JH9z345F for ; Mon, 19 Aug 2024 10:06:10 +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) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "michael.haj.ipfire.org", Issuer "E5" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4WnSst5TDxz3l8; Mon, 19 Aug 2024 10:06:10 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4WnSst07frzTtmx; Mon, 19 Aug 2024 10:06:10 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 16/19] tftpd: Fix build with GCC 14 Date: Mon, 19 Aug 2024 10:06:05 +0000 Message-Id: <20240819100608.991138-17-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240819100608.991138-1-michael.tremer@ipfire.org> References: <20240819100608.991138-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: SLL2KXZESOXQIRMYCMYT5MNGWHLUEKD6 X-Message-ID-Hash: SLL2KXZESOXQIRMYCMYT5MNGWHLUEKD6 X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Michael Tremer --- lfs/tftpd | 3 ++- src/patches/tftp-c99.patch | 50 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/patches/tftp-c99.patch diff --git a/lfs/tftpd b/lfs/tftpd index 8a3e7bd31..ebd8fee85 100644 --- a/lfs/tftpd +++ b/lfs/tftpd @@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = tftpd -PAK_VER = 4 +PAK_VER = 5 DEPS = @@ -83,6 +83,7 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/tftp-c99.patch cd $(DIR_APP) && ./configure --prefix=/usr --without-tcpwrappers cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install diff --git a/src/patches/tftp-c99.patch b/src/patches/tftp-c99.patch new file mode 100644 index 000000000..40bb4ddd6 --- /dev/null +++ b/src/patches/tftp-c99.patch @@ -0,0 +1,50 @@ +The glibc headers do not declare bsd_signal by default. Call signal +instead, which is the same function as bsd_signal in current glibc. + +This fixes implicit function declarations and avoids build issues with +future compilers. + +diff --git a/tftp/main.c b/tftp/main.c +index fcf5a25ac654954b..7e399d414ca0dd2b 100644 +--- a/tftp/main.c ++++ b/tftp/main.c +@@ -310,7 +310,7 @@ int main(int argc, char *argv[]) + sp->s_proto = (char *)"udp"; + } + +- bsd_signal(SIGINT, intr); ++ signal(SIGINT, intr); + + if (peerargc) { + /* Set peer */ +@@ -791,7 +791,7 @@ void intr(int sig) + { + (void)sig; /* Quiet unused warning */ + +- bsd_signal(SIGALRM, SIG_IGN); ++ signal(SIGALRM, SIG_IGN); + alarm(0); + siglongjmp(toplevel, -1); + } +diff --git a/tftp/tftp.c b/tftp/tftp.c +index 109848c4f9a5ad4e..d31553be5b76e305 100644 +--- a/tftp/tftp.c ++++ b/tftp/tftp.c +@@ -85,7 +85,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode) + is_request = 1; /* First packet is the actual WRQ */ + amount = 0; + +- bsd_signal(SIGALRM, timer); ++ signal(SIGALRM, timer); + do { + if (is_request) { + size = makerequest(WRQ, name, dp, mode) - 4; +@@ -191,7 +191,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode) + firsttrip = 1; + amount = 0; + +- bsd_signal(SIGALRM, timer); ++ signal(SIGALRM, timer); + do { + if (firsttrip) { + size = makerequest(RRQ, name, ap, mode);