summarylogtreecommitdiffstats
path: root/dimemas-Build-fix-for-GCC-10-fno-common-default.patch
blob: ca79c02d70611c49fd33c871ee14626c24ecd724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
From 6d4a89a3d6a6767ad88b74933f060d0891c248b0 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Tue, 12 May 2020 20:58:38 +0200
Subject: [PATCH] Build fix for GCC 10+ (-fno-common default)

See https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
---
 Simulator/input/read.c              |  7 +++++++
 Simulator/input/read.h              | 10 +++++-----
 Simulator/utils/deadlock_analysis.c | 11 +++++++++++
 Simulator/utils/deadlock_analysis.h | 16 ++++++++--------
 Simulator/utils/graph.c             |  3 +++
 Simulator/utils/graph.h             |  4 ++--
 6 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/Simulator/input/read.c b/Simulator/input/read.c
index 2ada26e..4a62055 100644
--- a/Simulator/input/read.c
+++ b/Simulator/input/read.c
@@ -44,6 +44,13 @@
 #include <file_data_access.h>
 #include <schedule.h>
 
+pthread_t reader_thread;
+
+volatile struct t_action ***action_buffer;
+volatile int *buffer_heads;
+volatile int *buffer_tails;
+int bsize_per_thread;
+
 struct t_Ptask *Ptask_current;
 int stop_restarts;
 extern t_boolean reload_while_longest_running;
diff --git a/Simulator/input/read.h b/Simulator/input/read.h
index b009524..8654ff6 100644
--- a/Simulator/input/read.h
+++ b/Simulator/input/read.h
@@ -3,12 +3,12 @@
 
 #include <pthread.h>
 
-pthread_t reader_thread;
+extern pthread_t reader_thread;
 
-volatile struct t_action ***action_buffer;
-volatile int *buffer_heads;
-volatile int *buffer_tails;
-int bsize_per_thread;
+extern volatile struct t_action ***action_buffer;
+extern volatile int *buffer_heads;
+extern volatile int *buffer_tails;
+extern int bsize_per_thread;
 
 /*
  * MACROS PARA LA FUNCION 'show_individual_statistics_pallas'
diff --git a/Simulator/utils/deadlock_analysis.c b/Simulator/utils/deadlock_analysis.c
index e29bfe1..e1c46db 100644
--- a/Simulator/utils/deadlock_analysis.c
+++ b/Simulator/utils/deadlock_analysis.c
@@ -7,6 +7,17 @@
 #include <list.h>
 #include <communic.h>
 
+struct t_estats * estats_per_rank;
+
+int are_estats_parsed;
+int total_ranks;
+char * extra_stats_filename;
+
+unsigned int _MAX_SENDS;
+unsigned int _MAX_RECVS;
+unsigned int _MAX_GLOPS;
+
+float _end_analysis_tpercent;
 
 int _get_earlier_task_index(int * dep_chain_queue, int deepness, t_boolean ignore_glops);
 
diff --git a/Simulator/utils/deadlock_analysis.h b/Simulator/utils/deadlock_analysis.h
index 4bd179b..67ca780 100644
--- a/Simulator/utils/deadlock_analysis.h
+++ b/Simulator/utils/deadlock_analysis.h
@@ -30,19 +30,19 @@ struct t_deadlock_descriptor
   int discarded;
 };
 
-struct t_estats * estats_per_rank;
+extern struct t_estats * estats_per_rank;
 
-int are_estats_parsed;
-int total_ranks;
-char * extra_stats_filename;
+extern int are_estats_parsed;
+extern int total_ranks;
+extern char * extra_stats_filename;
 
 // Keeps the maximum number of sends and recieves in all ranks. This info is
 // gathered through estats file.
-unsigned int _MAX_SENDS;
-unsigned int _MAX_RECVS;
-unsigned int _MAX_GLOPS;
+extern unsigned int _MAX_SENDS;
+extern unsigned int _MAX_RECVS;
+extern unsigned int _MAX_GLOPS;
 
-float _end_analysis_tpercent;
+extern float _end_analysis_tpercent;
 
 
 void DEADLOCK_init_deadlock_analysis(int ranks, const char * parameter_tracefile, float end_analysis_tpercent);
diff --git a/Simulator/utils/graph.c b/Simulator/utils/graph.c
index 669b818..61d138a 100644
--- a/Simulator/utils/graph.c
+++ b/Simulator/utils/graph.c
@@ -4,6 +4,9 @@
 #include <communic.h>
 #include <file_data_access.h>
 
+struct dependency_queue * _graph_map;
+int _nodes;
+
 FILE *log_file;
 int file_index;
 char * log_file_name;
diff --git a/Simulator/utils/graph.h b/Simulator/utils/graph.h
index 3fc7233..6aa8c6d 100644
--- a/Simulator/utils/graph.h
+++ b/Simulator/utils/graph.h
@@ -52,8 +52,8 @@ struct dependency
   dimemas_timer time;   // Instant when the dependency has been added
 };
 
-struct dependency_queue * _graph_map;
-int _nodes;
+extern struct dependency_queue * _graph_map;
+extern int _nodes;
 
 
 void GRAPH_init(int _nodes);
-- 
2.26.2