summarylogtreecommitdiffstats
path: root/fix-build.patch
diff options
context:
space:
mode:
authorIyán Méndez Veiga2022-09-10 21:42:01 +0200
committerIyán Méndez Veiga2022-09-10 21:42:01 +0200
commit32763063e72a84b3c03e36ca207ddde060e81e57 (patch)
tree704870523d1686553091ca6998861bb3591cac2f /fix-build.patch
parentc10abbfef8b956cd304b9b1bd40375974ba7d78b (diff)
downloadaur-scute.tar.gz
upgpkg: scute 1.7.0-3
Diffstat (limited to 'fix-build.patch')
-rw-r--r--fix-build.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/fix-build.patch b/fix-build.patch
new file mode 100644
index 000000000000..d8bfb003a29d
--- /dev/null
+++ b/fix-build.patch
@@ -0,0 +1,55 @@
+From 49ad2b0e05e3fcb8c8c2e23bb1c6063b390dee02 Mon Sep 17 00:00:00 2001
+From: Damien Goutte-Gattat <dgouttegattat@incenp.org>
+Date: Tue, 30 Mar 2021 22:31:40 +0100
+Subject: [PATCH] Do not declare global variable in header file.
+
+* src/options.h (_scute_opt_t): New typedef.
+(_scute_opt): Declare as extern and move definition to ...
+* src/readconf.c (_scute_opt): here.
+--
+
+This fixes build with gcc-10, which has -fno-common enabled by
+default.
+
+GnuPG-bug-id: 5360
+Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
+---
+ src/options.h | 6 ++++--
+ src/readconf.c | 2 ++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/options.h b/src/options.h
+index 10667db..d74071d 100644
+--- a/src/options.h
++++ b/src/options.h
+@@ -22,10 +22,12 @@
+ #define OPTIONS_H 1
+
+ /* Global options. */
+-struct {
++typedef struct {
+ char *user;
+ int debug_flags;
+-} _scute_opt;
++} _scute_opt_t;
++
++extern _scute_opt_t _scute_opt;
+
+
+ /*-- readconf.c --*/
+diff --git a/src/readconf.c b/src/readconf.c
+index 387a44f..5af2336 100644
+--- a/src/readconf.c
++++ b/src/readconf.c
+@@ -31,6 +31,8 @@
+
+ #include "options.h"
+
++_scute_opt_t _scute_opt;
++
+ static const char *
+ my_strusage (int level)
+ {
+--
+2.11.0
+