|
| 1 | +From 6fbd93ed7307402027aa336fc6dc512022e7baeb Mon Sep 17 00:00:00 2001 |
| 2 | +From: Joel Stanley < [email protected]> |
| 3 | +Date: Thu, 17 Mar 2022 14:00:52 +1030 |
| 4 | +Subject: [PATCH 2/4] utilmisc: Fix build error with GCC 10 |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +From when this was introduced (2737de709eae) it wasn't commented why it |
| 10 | +was done this way. Clean it up. |
| 11 | + |
| 12 | +utilmisc.C:31:6: error: ‘bool Util::isSimics()’ specifies less restrictive attribute than its target ‘bool Util::__isSimicsRunning()’: ‘nothrow’ [-Werror=missing-attributes] |
| 13 | + 31 | bool isSimics() __attribute__((alias("__isSimicsRunning"))); |
| 14 | + | ^~~~~~~~ |
| 15 | +utilmisc.C:34:6: note: ‘bool Util::isSimics()’ target declared here |
| 16 | + 34 | bool __isSimicsRunning() |
| 17 | + | ^~~~~~~~~~~~~~~~~ |
| 18 | +utilmisc.C:48:6: error: ‘bool Util::isQmeModelEnabled()’ specifies less restrictive attribute than its target ‘bool Util::__isQmeEnabled()’: ‘nothrow’ [-Werror=missing-attributes] |
| 19 | + 48 | bool isQmeModelEnabled() __attribute__((alias("__isQmeEnabled"))); |
| 20 | + | ^~~~~~~~~~~~~~~~~ |
| 21 | +utilmisc.C:51:6: note: ‘bool Util::isQmeModelEnabled()’ target declared here |
| 22 | + 51 | bool __isQmeEnabled() |
| 23 | + | ^~~~~~~~~~~~~~ |
| 24 | + |
| 25 | +Change-Id: Id5291022b09dca6789175d69e54a30d55f1bde13 |
| 26 | +Signed-off-by: Joel Stanley < [email protected]> |
| 27 | +--- |
| 28 | + src/lib/utilmisc.C | 18 ++++++++++-------- |
| 29 | + 1 file changed, 10 insertions(+), 8 deletions(-) |
| 30 | + |
| 31 | +diff --git a/src/lib/utilmisc.C b/src/lib/utilmisc.C |
| 32 | +index b3ca1ac04c53..85665c824487 100644 |
| 33 | +--- a/src/lib/utilmisc.C |
| 34 | ++++ b/src/lib/utilmisc.C |
| 35 | +@@ -28,8 +28,7 @@ |
| 36 | + namespace Util |
| 37 | + { |
| 38 | + |
| 39 | +-bool isSimics() __attribute__((alias("__isSimicsRunning"))); |
| 40 | +-extern "C" bool __isSimicsRunning() NEVER_INLINE; |
| 41 | ++bool __isSimicsRunning() NEVER_INLINE; |
| 42 | + |
| 43 | + bool __isSimicsRunning() |
| 44 | + { |
| 45 | +@@ -40,12 +39,11 @@ bool __isSimicsRunning() |
| 46 | + |
| 47 | + bool isSimicsRunning() |
| 48 | + { |
| 49 | +- static bool simics = isSimics(); |
| 50 | ++ static bool simics = __isSimicsRunning(); |
| 51 | + return simics; |
| 52 | + } |
| 53 | + |
| 54 | + |
| 55 | +-bool isQmeModelEnabled() __attribute__((alias("__isQmeEnabled"))); |
| 56 | + extern "C" bool __isQmeEnabled() NEVER_INLINE; |
| 57 | + |
| 58 | + bool __isQmeEnabled() |
| 59 | +@@ -58,7 +56,7 @@ bool __isQmeEnabled() |
| 60 | + bool requiresSecondaryCoreWorkaround() |
| 61 | + { |
| 62 | + static const auto required = |
| 63 | +- isSimicsRunning() && !isQmeModelEnabled(); |
| 64 | ++ isSimicsRunning() && !__isQmeEnabled(); |
| 65 | + return required; |
| 66 | + } |
| 67 | + |
| 68 | +@@ -86,10 +84,14 @@ void setIsConsoleStarted() |
| 69 | + g_isConsoleStarted = true; |
| 70 | + } |
| 71 | + |
| 72 | +-bool isMultiprocSupported() __attribute__((alias("__isMultiprocSupported"))); |
| 73 | + extern "C" bool __isMultiprocSupported() NEVER_INLINE; |
| 74 | + |
| 75 | +-bool __isMultiprocSupported() |
| 76 | ++bool __isMulitprocSupported() |
| 77 | ++{ |
| 78 | ++ return MAGIC_INST_CHECK_FEATURE(MAGIC_FEATURE__MULTIPROC); |
| 79 | ++} |
| 80 | ++ |
| 81 | ++bool isMultiprocSupported() |
| 82 | + { |
| 83 | + bool multiprocSupport = true; |
| 84 | + |
| 85 | +@@ -98,7 +100,7 @@ bool __isMultiprocSupported() |
| 86 | + #else |
| 87 | + if (isSimicsRunning()) |
| 88 | + { |
| 89 | +- multiprocSupport = MAGIC_INST_CHECK_FEATURE(MAGIC_FEATURE__MULTIPROC); |
| 90 | ++ multiprocSupport = __isMulitprocSupported(); |
| 91 | + } |
| 92 | + #endif |
| 93 | + |
| 94 | +-- |
| 95 | +2.35.1 |
| 96 | + |
0 commit comments