From a658537fcbd8cc8c7dafcc9dec09ce5a1b7e829f Mon Sep 17 00:00:00 2001 From: Lin Jiaxin Date: Tue, 3 Aug 2021 21:02:26 +0800 Subject: [PATCH] fix build error dur to gcc 10 error: /usr/bin/ld: xactions.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/x3270/../../../x3270/xscreen.h:166: multiple definition of `font_list'; about.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/x3270/../../../x3270/xscreen.h:166: first defined here /usr/bin/ld: xkybd.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/x3270/../../../x3270/xscreen.h:167: multiple definition of `font_count'; about.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/x3270/../../../x3270/xscreen.h:167: first defined here /usr/bin/ld: help.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/c3270/../../../include/glue.h:53: multiple definition of `Warning_redirect'; c3270.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/c3270/../../../include/glue.h:53: first defined here /usr/bin/ld: help.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/c3270/../../../include/glue.h:52: multiple definition of `Error_redirect'; c3270.o:/home/abuild/rpmbuild/BUILD/suite3270-3.6/obj/aarch64-openEuler-linux-gnu/c3270/../../../include/glue.h:52: first defined here --- gcc-10.patch | 20 ++++++++++++++++++++ x3270.spec | 8 ++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gcc-10.patch diff --git a/gcc-10.patch b/gcc-10.patch new file mode 100644 index 0000000..6ed5a31 --- /dev/null +++ b/gcc-10.patch @@ -0,0 +1,20 @@ +--- a/x3270/xscreen.h_old 2021-08-03 15:23:42.725100426 +0800 ++++ b/x3270/xscreen.h 2021-08-03 15:23:54.081295953 +0800 +@@ -163,5 +163,5 @@ + struct font_list *next; + char *mlabel; + }; +-struct font_list *font_list; +-int font_count; ++extern struct font_list *font_list; ++extern int font_count; +--- a/include/glue.h 2021-08-03 15:43:01.289032463 +0800 ++++ b/include/glue.h 2021-08-03 15:41:24.155363894 +0800 +@@ -49,5 +49,5 @@ + void register_merge_profile(merge_profile_t *); + + /* XtGlue.c */ +-void (*Error_redirect)(const char *); +-void (*Warning_redirect)(const char *); ++extern void (*Error_redirect)(const char *); ++extern void (*Warning_redirect)(const char *); diff --git a/x3270.spec b/x3270.spec index b2f0bfe..a950097 100644 --- a/x3270.spec +++ b/x3270.spec @@ -6,7 +6,7 @@ Name: x3270 Version: 3.6ga5 -Release: 5 +Release: 6 Summary: An IBM 3270 terminal emulator for the X Window System and Windows. License: BSD URL: http://x3270.sourceforge.net/ @@ -15,6 +15,7 @@ Source1: x3270.desktop Source2: x3270.png Patch0: x3270-3.5-ibmhostpath.patch Patch1: x3270-3.5-paths.patch +Patch2: gcc-10.patch BuildRequires: desktop-file-utils fontpackages-devel imake libtool BuildRequires: libXaw-devel ncurses-devel openssl-devel readline-devel @@ -78,7 +79,7 @@ done --enable-pr3287 \ --enable-s3270 \ --enable-x3270 -%make_build CCOPTIONS="$RPM_OPT_FLAGS -fcommon" LIBX3270DIR=%{_sysconfdir} +%make_build CCOPTIONS="$RPM_OPT_FLAGS" LIBX3270DIR=%{_sysconfdir} pushd Playback make CFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS" @@ -122,6 +123,9 @@ popd %changelog +* Tue Aug 03 2021 linjiaxin5 - 3.6ga5-6 +- Fix failure caused by GCC upgrade to 10 + * Fri Jul 30 2021 linjiaxin5 - 3.6ga5-5 - Fix failure caused by GCC upgrade to 10