Blame SOURCES/sharutils-4.15.2-Fix-building-with-GCC-10.patch

80e372
From ec4ceb632abc0d54061269bc779459e13172f264 Mon Sep 17 00:00:00 2001
80e372
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
80e372
Date: Thu, 23 Jan 2020 15:42:41 +0100
80e372
Subject: [PATCH 1/2] Fix building with GCC 10
80e372
MIME-Version: 1.0
80e372
Content-Type: text/plain; charset=UTF-8
80e372
Content-Transfer-Encoding: 8bit
80e372
80e372
GCC 10 defaults to -fno-common that results into errors on multiple
80e372
global variable definitions:
80e372
80e372
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld:
80e372
shar-opts.o:(.data.rel.ro.local+0x0): multiple definition of
80e372
`program_name'; shar.o:(.rodata+0x10): first defined here
80e372
80e372
This patch fixes it by changing the definitions in header files into extern
80e372
declarations.
80e372
80e372
<https://lists.gnu.org/archive/html/bug-gnu-utils/2020-01/msg00001.html>
80e372
80e372
Signed-off-by: Petr Písař <ppisar@redhat.com>
80e372
---
80e372
 src/shar-opts.h     | 2 +-
80e372
 src/shar-std.def    | 2 +-
80e372
 src/unshar-opts.h   | 2 +-
80e372
 src/uudecode-opts.h | 2 +-
80e372
 src/uuencode-opts.h | 2 +-
80e372
 5 files changed, 5 insertions(+), 5 deletions(-)
80e372
80e372
diff --git a/src/shar-opts.h b/src/shar-opts.h
80e372
index 75dcae2..5055d1c 100644
80e372
--- a/src/shar-opts.h
80e372
+++ b/src/shar-opts.h
80e372
@@ -352,7 +352,7 @@ extern "C" {
80e372
  *  global exported definitions
80e372
  */
80e372
 #include "local.h"
80e372
-char const * const program_name;
80e372
+extern char const * const program_name;
80e372
 
80e372
 extern bool initialization_done;
80e372
 extern int optidx;
80e372
diff --git a/src/shar-std.def b/src/shar-std.def
80e372
index ed06b77..a28f61c 100644
80e372
--- a/src/shar-std.def
80e372
+++ b/src/shar-std.def
80e372
@@ -41,7 +41,7 @@ no-misuse-usage;
80e372
 usage-message;
80e372
 die-code;
80e372
 
80e372
-export  = '#include "local.h"'"\nchar const * const program_name;";
80e372
+export  = '#include "local.h"'"\nextern char const * const program_name;";
80e372
 
80e372
 #shell
80e372
 echo "include = 'char const * const program_name = \"${progname}\";';"
80e372
diff --git a/src/unshar-opts.h b/src/unshar-opts.h
80e372
index 2c3febe..9ebe2fc 100644
80e372
--- a/src/unshar-opts.h
80e372
+++ b/src/unshar-opts.h
80e372
@@ -192,7 +192,7 @@ extern "C" {
80e372
 extern size_t       separator_str_len;
80e372
 
80e372
 #include "local.h"
80e372
-char const * const program_name;
80e372
+extern char const * const program_name;
80e372
 
80e372
 
80e372
 /* * * * * *
80e372
diff --git a/src/uudecode-opts.h b/src/uudecode-opts.h
80e372
index 29b3b5c..5494289 100644
80e372
--- a/src/uudecode-opts.h
80e372
+++ b/src/uudecode-opts.h
80e372
@@ -170,7 +170,7 @@ extern "C" {
80e372
  *  global exported definitions
80e372
  */
80e372
 #include "local.h"
80e372
-char const * const program_name;
80e372
+extern char const * const program_name;
80e372
 
80e372
 
80e372
 /* * * * * *
80e372
diff --git a/src/uuencode-opts.h b/src/uuencode-opts.h
80e372
index e71c9b8..d6ec03e 100644
80e372
--- a/src/uuencode-opts.h
80e372
+++ b/src/uuencode-opts.h
80e372
@@ -166,7 +166,7 @@ extern "C" {
80e372
  *  global exported definitions
80e372
  */
80e372
 #include "local.h"
80e372
-char const * const program_name;
80e372
+extern char const * const program_name;
80e372
 
80e372
 
80e372
 /* * * * * *
80e372
-- 
80e372
2.21.1
80e372