From 5c25c1f5837d29dd9250c296ea3a9c9537d278e3 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Sat, 9 May 2020 20:12:06 +0200 Subject: games/neverball: Patch for gcc >= 10.x. Signed-off-by: Matteo Bernardini --- games/neverball/gcc10.patch | 41 ++++++++++++++++++++++++++++++++++++ games/neverball/neverball.SlackBuild | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 games/neverball/gcc10.patch (limited to 'games') diff --git a/games/neverball/gcc10.patch b/games/neverball/gcc10.patch new file mode 100644 index 0000000000..83e0a3a356 --- /dev/null +++ b/games/neverball/gcc10.patch @@ -0,0 +1,41 @@ +From a42492b8db06934c7a794630db92e3ff6ebaadaa Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 3 Feb 2020 20:25:57 +0000 +Subject: [PATCH] share/text.h: fix build failure against gcc-10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On gcc-10 (and gcc-9 -fno-common) build fails as: + +``` +cc .. -o neverball ... +ld: ball/st_save.o:(.bss+0x0): + multiple definition of `text_input'; share/text.o:(.bss+0x0): first defined here +``` + +gcc-10 will change the default from -fcommon to fno-common: +https://gcc.gnu.org/PR85678. + +The error also happens if CFLAGS=-fno-common passed explicitly. + +Reported-by: Toralf Förster +Bug: https://bugs.gentoo.org/708050 +Signed-off-by: Sergei Trofimovich +--- + share/text.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/share/text.h b/share/text.h +index baee7921a..8a2d6f591 100644 +--- a/share/text.h ++++ b/share/text.h +@@ -15,7 +15,7 @@ int text_length(const char *); + + /*---------------------------------------------------------------------------*/ + +-char text_input[MAXSTR]; ++extern char text_input[MAXSTR]; + + void text_input_start(void (*cb)(int typing)); + void text_input_stop(void); diff --git a/games/neverball/neverball.SlackBuild b/games/neverball/neverball.SlackBuild index c6bb39b7f9..38ecd9d032 100644 --- a/games/neverball/neverball.SlackBuild +++ b/games/neverball/neverball.SlackBuild @@ -72,6 +72,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +patch -p1 < $CWD/gcc10.patch + # Patch Makefile to change data directory and to make it compile # with appropriate flags patch -p1 < $CWD/Makefile.diff || exit 1 -- cgit v1.2.3