[syslinux] [PATCH RESEND] tftp-hpa: Fix build error with GCC 10 due to multiple definition of `toplevel'

Salvatore Bonaccorso carnil at debian.org
Mon Sep 28 21:25:53 PDT 2020


Hi

When building with GCC 10, gcc is stricter in handling handling of
symbol clashes.

Fedora, has fixed this with a patch from Dominik Mierzejewski:
https://src.fedoraproject.org/rpms/tftp/c/5e2aa55b6802a52ef480d688b3ae4751220f20e0.patch

Attaching the corresponding patch for git am.

I'm sending the patch which was submitted a while ago to the list. Is
there something you wanted to be changed to be applied?

Regards,
Salvatore

>From 9e7641bf58df9dda3bc51f381f371fa7cbce47af Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil at debian.org>
Date: Tue, 16 Jun 2020 14:06:14 +0200
Subject: [PATCH] Fix build error with GCC 10 due to multiple definition of
 `toplevel'

GCC is stricter in handling of symbol clashes and throws:

	gcc-10  tftp.o main.o ../common/libcommon.a  /build/tftp-hpa/lib/libxtra.a  -o tftp
	/usr/bin/ld: main.o:/build/tftp-hpa/tftp/main.c:98: multiple definition of `toplevel'; tftp.o:/build/tftp-hpa/tftp/tftp.c:51: first defined here

CC: Dominik 'Rathann' Mierzejewski <dominik at greysector.net>
Link: https://bugs.debian.org/957875
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1800195
Signed-off-by: Salvatore Bonaccorso <carnil at debian.org>
---
 tftp/tftp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tftp/tftp.c b/tftp/tftp.c
index d15da2200ef8..d067f9699778 100644
--- a/tftp/tftp.c
+++ b/tftp/tftp.c
@@ -48,7 +48,7 @@ extern int maxtimeout;
 #define PKTSIZE    SEGSIZE+4
 char ackbuf[PKTSIZE];
 int timeout;
-sigjmp_buf toplevel;
+extern sigjmp_buf toplevel;
 sigjmp_buf timeoutbuf;
 
 static void nak(int, const char *);
-- 
2.20.1


More information about the Syslinux mailing list