aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-11-11 00:15:22 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-11-11 00:15:22 -0300
commitd7a855f0bff8b4cbb33e9ca0d7166f0a2158d1ba (patch)
tree155a2569d71deed73a2518dc3644235569008590
parentac36f654656e1db3674bb0d1b77b0b7a5bd59ec5 (diff)
downloadaports-d7a855f0bff8b4cbb33e9ca0d7166f0a2158d1ba.tar.gz
aports-d7a855f0bff8b4cbb33e9ca0d7166f0a2158d1ba.tar.bz2
aports-d7a855f0bff8b4cbb33e9ca0d7166f0a2158d1ba.tar.xz
main/gdb: fix build against gcc-10
-rw-r--r--main/gdb/APKBUILD4
-rw-r--r--main/gdb/gdb-9.2-sim-ppc-fno-common.patch97
2 files changed, 100 insertions, 1 deletions
diff --git a/main/gdb/APKBUILD b/main/gdb/APKBUILD
index 757bb2fae3..7de4163b45 100644
--- a/main/gdb/APKBUILD
+++ b/main/gdb/APKBUILD
@@ -15,6 +15,7 @@ source="https://ftp.gnu.org/gnu/gdb/gdb-$pkgver.tar.xz
ppc-musl.patch
ppc-ptregs.patch
musl-signals.patch
+ gdb-9.2-sim-ppc-fno-common.patch
"
prepare() {
@@ -78,4 +79,5 @@ sha512sums="73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f
70e7d04e4d72461436da503b5bfa370c5779e03245c521f30e9779d5ff37dbb2d708b05f2afb27f43ad9defc44df4bd979d72f777e744851fdbf156295e1cc9f s390x-use-elf-gdb_fpregset_t.patch
04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01 ppc-musl.patch
b75e1c1ee503a1948a7d5b8d90427b5c7d38ded69978056cee0adca222771a5c95ed1ac73127fcae7b795ea94296344eee5fca47e4cd04b418c164a756fb0933 ppc-ptregs.patch
-013141b89afafba02a6ddd1407dfd9b2566606e7b1d4bd03b4e23d9b523231103dbeca17a435669a7a7508f827cbe7f601e3bb1daa96d892ea33b897265966ad musl-signals.patch"
+013141b89afafba02a6ddd1407dfd9b2566606e7b1d4bd03b4e23d9b523231103dbeca17a435669a7a7508f827cbe7f601e3bb1daa96d892ea33b897265966ad musl-signals.patch
+ae2610ed3ce7c55526979fa9157aff7a46b008bf66b1a304e37c4ce20be74bc762de44a464238c37e0652e7c4bb5915f62c355d1a522d71b22a5819c13ce6e3d gdb-9.2-sim-ppc-fno-common.patch"
diff --git a/main/gdb/gdb-9.2-sim-ppc-fno-common.patch b/main/gdb/gdb-9.2-sim-ppc-fno-common.patch
new file mode 100644
index 0000000000..76b29649ad
--- /dev/null
+++ b/main/gdb/gdb-9.2-sim-ppc-fno-common.patch
@@ -0,0 +1,97 @@
+https://bugs.gentoo.org/738272
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=ad8464f799a4c96c7ab8bdfec3f95846cf54f9b0
+
+From ad8464f799a4c96c7ab8bdfec3f95846cf54f9b0 Mon Sep 17 00:00:00 2001
+From: Sebastian Huber <sebastian.huber@embedded-brains.de>
+Date: Wed, 1 Jul 2020 19:29:55 +0200
+Subject: [PATCH] sim/ppc: Fix linker error with -fno-common
+
+GCC 10 enables -fno-common by default. This resulted in a multiple
+definition linker error since global variables were declared and defined
+in a header file:
+
+ ld: ld-insn.o:sim/ppc/ld-insn.h:221: multiple definition of
+ `max_model_fields_len'; igen.o:sim/ppc/ld-insn.h:221: first defined here
+
+sim/ppc
+
+ * ld-insn.h (last_model, last_model_data, last_model_function,
+ last_model_internal, last_model_macro, last_model_static):
+ Delete.
+ (max_model_fields_len, model_data, model_functions,
+ model_internal, model_macros, model_static, models): Declare, but do not
+ define.
+ * ld-insn.c (last_model, last_model_data, last_model_function,
+ last_model_internal, last_model_macro, last_model_static,
+ max_model_fields_len, model_data, model_functions,
+ model_internal, model_macros, model_static, models): Define.
+---
+ sim/ppc/ld-insn.c | 18 ++++++++++++++++++
+ sim/ppc/ld-insn.h | 24 +++++++-----------------
+ 3 files changed, 38 insertions(+), 17 deletions(-)
+
+--- a/sim/ppc/ld-insn.c
++++ b/sim/ppc/ld-insn.c
+@@ -28,6 +28,24 @@
+
+ #include "igen.h"
+
++static model *last_model;
++
++static insn *last_model_macro;
++static insn *last_model_function;
++static insn *last_model_internal;
++static insn *last_model_static;
++static insn *last_model_data;
++
++model *models;
++
++insn *model_macros;
++insn *model_functions;
++insn *model_internal;
++insn *model_static;
++insn *model_data;
++
++int max_model_fields_len;
++
+ static void
+ update_depth(insn_table *entry,
+ lf *file,
+--- a/sim/ppc/ld-insn.h
++++ b/sim/ppc/ld-insn.h
+@@ -200,25 +200,15 @@ extern insn_table *load_insn_table
+ table_include *includes,
+ cache_table **cache_rules);
+
+-model *models;
+-model *last_model;
++extern model *models;
+
+-insn *model_macros;
+-insn *last_model_macro;
++extern insn *model_macros;
++extern insn *model_functions;
++extern insn *model_internal;
++extern insn *model_static;
++extern insn *model_data;
+
+-insn *model_functions;
+-insn *last_model_function;
+-
+-insn *model_internal;
+-insn *last_model_internal;
+-
+-insn *model_static;
+-insn *last_model_static;
+-
+-insn *model_data;
+-insn *last_model_data;
+-
+-int max_model_fields_len;
++extern int max_model_fields_len;
+
+ extern void insn_table_insert_insn
+ (insn_table *table,
+--
+2.28.0
+