From f7c2395c37e6d400d5cd7a4c53e8be914aa83158 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Thu, 17 Mar 2022 14:00:52 +1030 Subject: [PATCH] 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() | ^~~~~~~~~~~~~~ Fixes: open-power/hostboot#205 Change-Id: Id5291022b09dca6789175d69e54a30d55f1bde13 Signed-off-by: Joel Stanley Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/128902 Tested-by: Jenkins OP Build CI Tested-by: Jenkins Server Tested-by: Jenkins Combined Simics CI Reviewed-by: Zachary Clark Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Tested-by: Hostboot CI Reviewed-by: Daniel M Crowell Reviewed-by: Nick Bofferding --- 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 b3ca1ac04c5..25a372b4423 100644 --- a/src/lib/utilmisc.C +++ b/src/lib/utilmisc.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2020 */ +/* Contributors Listed Below - COPYRIGHT 2014,2022 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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() +{ + 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 = __isMultiprocSupported(); } #endif