-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy path0002-utilmisc-Fix-build-error-with-GCC-10.patch
96 lines (80 loc) · 3 KB
/
0002-utilmisc-Fix-build-error-with-GCC-10.patch
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
From 6fbd93ed7307402027aa336fc6dc512022e7baeb Mon Sep 17 00:00:00 2001
From: Joel Stanley <[email protected]>
Date: Thu, 17 Mar 2022 14:00:52 +1030
Subject: [PATCH 2/4] utilmisc: Fix build error with GCC 10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From when this was introduced (2737de709eae) it wasn't commented why it
was done this way. Clean it up.
utilmisc.C:31:6: error: ‘bool Util::isSimics()’ specifies less restrictive attribute than its target ‘bool Util::__isSimicsRunning()’: ‘nothrow’ [-Werror=missing-attributes]
31 | bool isSimics() __attribute__((alias("__isSimicsRunning")));
| ^~~~~~~~
utilmisc.C:34:6: note: ‘bool Util::isSimics()’ target declared here
34 | bool __isSimicsRunning()
| ^~~~~~~~~~~~~~~~~
utilmisc.C:48:6: error: ‘bool Util::isQmeModelEnabled()’ specifies less restrictive attribute than its target ‘bool Util::__isQmeEnabled()’: ‘nothrow’ [-Werror=missing-attributes]
48 | bool isQmeModelEnabled() __attribute__((alias("__isQmeEnabled")));
| ^~~~~~~~~~~~~~~~~
utilmisc.C:51:6: note: ‘bool Util::isQmeModelEnabled()’ target declared here
51 | bool __isQmeEnabled()
| ^~~~~~~~~~~~~~
Change-Id: Id5291022b09dca6789175d69e54a30d55f1bde13
Signed-off-by: Joel Stanley <[email protected]>
---
src/lib/utilmisc.C | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/lib/utilmisc.C b/src/lib/utilmisc.C
index b3ca1ac04c53..85665c824487 100644
--- a/src/lib/utilmisc.C
+++ b/src/lib/utilmisc.C
@@ -28,8 +28,7 @@
namespace Util
{
-bool isSimics() __attribute__((alias("__isSimicsRunning")));
-extern "C" bool __isSimicsRunning() NEVER_INLINE;
+bool __isSimicsRunning() NEVER_INLINE;
bool __isSimicsRunning()
{
@@ -40,12 +39,11 @@ bool __isSimicsRunning()
bool isSimicsRunning()
{
- static bool simics = isSimics();
+ static bool simics = __isSimicsRunning();
return simics;
}
-bool isQmeModelEnabled() __attribute__((alias("__isQmeEnabled")));
extern "C" bool __isQmeEnabled() NEVER_INLINE;
bool __isQmeEnabled()
@@ -58,7 +56,7 @@ bool __isQmeEnabled()
bool requiresSecondaryCoreWorkaround()
{
static const auto required =
- isSimicsRunning() && !isQmeModelEnabled();
+ isSimicsRunning() && !__isQmeEnabled();
return required;
}
@@ -86,10 +84,14 @@ void setIsConsoleStarted()
g_isConsoleStarted = true;
}
-bool isMultiprocSupported() __attribute__((alias("__isMultiprocSupported")));
extern "C" bool __isMultiprocSupported() NEVER_INLINE;
-bool __isMultiprocSupported()
+bool __isMulitprocSupported()
+{
+ return MAGIC_INST_CHECK_FEATURE(MAGIC_FEATURE__MULTIPROC);
+}
+
+bool isMultiprocSupported()
{
bool multiprocSupport = true;
@@ -98,7 +100,7 @@ bool __isMultiprocSupported()
#else
if (isSimicsRunning())
{
- multiprocSupport = MAGIC_INST_CHECK_FEATURE(MAGIC_FEATURE__MULTIPROC);
+ multiprocSupport = __isMulitprocSupported();
}
#endif
--
2.35.1