Skip to content

Commit

Permalink
utilmisc: Fix build error with GCC 10
Browse files Browse the repository at this point in the history
From when this was introduced (2737de7) 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: #205
Change-Id: Id5291022b09dca6789175d69e54a30d55f1bde13
Signed-off-by: Joel Stanley <[email protected]>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/128902
Tested-by: Jenkins OP Build CI <[email protected]>
Tested-by: Jenkins Server <[email protected]>
Tested-by: Jenkins Combined Simics CI <[email protected]>
Reviewed-by: Zachary Clark <[email protected]>
Tested-by: FSP CI Jenkins <[email protected]>
Tested-by: Jenkins OP HW <[email protected]>
Tested-by: Hostboot CI <[email protected]>
Reviewed-by: Daniel M Crowell <[email protected]>
Reviewed-by: Nick Bofferding <[email protected]>
  • Loading branch information
shenki authored and Nick Bofferding committed Apr 29, 2022
1 parent d644508 commit f7c2395
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/lib/utilmisc.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* Contributors Listed Below - COPYRIGHT 2014,2022 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -28,8 +28,7 @@
namespace Util
{

bool isSimics() __attribute__((alias("__isSimicsRunning")));
extern "C" bool __isSimicsRunning() NEVER_INLINE;
bool __isSimicsRunning() NEVER_INLINE;

bool __isSimicsRunning()
{
Expand All @@ -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()
Expand All @@ -58,7 +56,7 @@ bool __isQmeEnabled()
bool requiresSecondaryCoreWorkaround()
{
static const auto required =
isSimicsRunning() && !isQmeModelEnabled();
isSimicsRunning() && !__isQmeEnabled();
return required;
}

Expand Down Expand Up @@ -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;

Expand All @@ -98,7 +100,7 @@ bool __isMultiprocSupported()
#else
if (isSimicsRunning())
{
multiprocSupport = MAGIC_INST_CHECK_FEATURE(MAGIC_FEATURE__MULTIPROC);
multiprocSupport = __isMultiprocSupported();
}
#endif

Expand Down

0 comments on commit f7c2395

Please sign in to comment.