From: Sandipan Das Date: Thu, 16 Jul 2020 16:05:48 +0000 (+0530) Subject: systemc: Fix builds on Power systems X-Git-Tag: v20.1.0.0~439 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a937089d6ffcbfe82ac06754451d1d67c12cc36d;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31414 Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/src/systemc/ext/dt/int/sc_nbdefs.hh b/src/systemc/ext/dt/int/sc_nbdefs.hh index 3854a9198..536a0fc2c 100644 --- a/src/systemc/ext/dt/int/sc_nbdefs.hh +++ b/src/systemc/ext/dt/int/sc_nbdefs.hh @@ -164,7 +164,7 @@ typedef unsigned int sc_digit; // 32-bit unsigned integer // 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