Sandipan Das has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31414 )

Change subject: systemc: Fix builds on Power systems
......................................................................

systemc: Fix builds on Power systems

Based on the 64-bit ELF ABI for Power systems (ppc64 and
ppc64le), the data types int64_t and uint64_t are typedefs
of long and unsigned long respectively. If the SystemC
data types int64 and uint64 point to these, several errors
are observed while building the simulator on Power systems
due to ambiguity between the types when overloading some
operators and functions.

E.g.
  ...
build/POWER/systemc/ext/channel/../dt/bit/sc_bit.hh:114:17: error: 'static bool sc_dt::sc_bit::to_value(sc_dt::int64)' cannot be overloaded with 'static bool sc_dt::sc_bit::to_value(long int)'
    114 |     static bool to_value(tp i) { return to_value((int)i); }
        |                 ^~~~~~~~
  ...
build/POWER/systemc/ext/channel/../dt/bit/sc_bit.hh:114:17: note: previous declaration 'static bool sc_dt::sc_bit::to_value(long int)'
    114 |     static bool to_value(tp i) { return to_value((int)i); }
        |                 ^~~~~~~~
  ...

This adds a minor change to a SystemC datatype header to
ensure that the simulator can be built on Power systems.

Change-Id: Icd8bb38134bf98768cc38f9856d7d11a01ebaf21
Signed-off-by: Sandipan Das <sandi...@linux.ibm.com>
---
M src/systemc/ext/dt/int/sc_nbdefs.hh
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/src/systemc/ext/dt/int/sc_nbdefs.hh b/src/systemc/ext/dt/int/sc_nbdefs.hh
index 3854a91..536a0fc 100644
--- a/src/systemc/ext/dt/int/sc_nbdefs.hh
+++ b/src/systemc/ext/dt/int/sc_nbdefs.hh
@@ -164,7 +164,7 @@

 // Support for the long long type. This type is not in the standard
 // but is usually supported by compilers.
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
 typedef long long int64;
 typedef unsigned long long uint64;
 #else

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31414
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icd8bb38134bf98768cc38f9856d7d11a01ebaf21
Gerrit-Change-Number: 31414
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <sandi...@linux.ibm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to