Closed GoogleCodeExporter closed 9 years ago
I get the same error when compiling for 32-bit PowerPC. The problem is that
spinlock_internal.cc assumes there will be an Atomic64 overload of
NoBarrier_Load and NoBarrier_Store available, but atomicops-internal-linuxppc.h
only declares the Atomic32 overloads if __PPC64__ is not defined.
It would appear that base::subtle::NoBarrier_Load(volatile const Atomic64 *)
and base::subtle::NoBarrier_Store(volatile Atomic64 *, Atomic64) don't really
need a PPC64 CPU, so they should not be inside an #ifdef __PPC64__ section.
Indeed, simply commenting out the #ifdef __PPC64__ and #endif directives allows
gperftools to compile for this architecture.
Original comment by mwhitl...@gmail.com
on 24 Jul 2012 at 4:25
> but atomicops-internal-linuxppc.h only declares the Atomic32 overloads if
__PPC64__ is not defined.
Rather, I meant, atomicops-internal-linuxppc.h only declares the Atomic64
overloads (in addition to the Atomic32 overloads) if __PPC64__ is defined. If
__PPC64__ is not defined, then only the Atomic32 overloads are declared and not
the Atomic64 overloads.
(I hate human languages.)
Original comment by mwhitl...@gmail.com
on 24 Jul 2012 at 4:27
On second thought, I am not sure that 32-bit PowerPC has a 64-bit memory access
mode; it may need two instructions to load and store 64-bit memory locations,
in which case there is no way to perform a lock-free, atomic, 64-bit
load/store, so the Atomic64 overloads should remain #ifdef'd out on that
platform.
As an alternative on platforms that lack BASE_HAS_ATOMIC64, the
linear-congruential pseudo-random number generator in
base::internal::SuggestedDelayNS(int) can be re-implemented as a 32-bit LCG.
See the attached patch.
Original comment by mwhitl...@gmail.com
on 24 Jul 2012 at 5:27
Attachments:
Correct, one cannot do 64b atomics on PPC32. I'll try the patch shortly.
Thanks!
Original comment by jeff.science@gmail.com
on 24 Jul 2012 at 3:59
Issue 431 has been merged into this issue.
Original comment by chapp...@gmail.com
on 18 Sep 2012 at 2:40
------------------------------------------------------------------------
r160 | chappedm@gmail.com | 2012-09-17 22:47:24 -0400 (Mon, 17 Sep 2012) | 1
line
issue-442: Fixes an issue encountered on PPC with undefined conversions from
'base::subtle::Atomic64*' to 'const volatile Atomic32*'
------------------------------------------------------------------------
Original comment by chapp...@gmail.com
on 18 Sep 2012 at 2:48
Original issue reported on code.google.com by
jeff.science@gmail.com
on 2 Jul 2012 at 3:43