[GHC] #9886: Undefined reference to `__sync_fetch_and_xor_8'
GHC
ghc-devs at haskell.org
Sat Feb 28 00:48:12 UTC 2015
#9886: Undefined reference to `__sync_fetch_and_xor_8'
----------------------------------------+----------------------------------
Reporter: erikd | Owner: erikd
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (CodeGen) | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: powerpc
Type of failure: Building GHC failed | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
----------------------------------------+----------------------------------
Comment (by erikd):
It seems the 64 bit primpos are *only* needed on 32 bit architectures and
then only for the native code generators. For x86 via the native code
generator we needed #9346 as mentioned by @tibbe, but the arm backend did
need anything because that omly compilers via LLVM.
That leaves PowerPC as the remaining 32 bit architecture with an NCG.
However, if I hack the 64 bit primops like (for example) this:
{{{#!c
StgWord64
hs_atomic_add64(volatile StgWord64 *x, StgWord64 val)
{
#if WORD_SIZE_IN_BITS == 32
printf ("%s : %s not implemented.\n", __FILE__, __func__) ;
exit (1);
#else
return __sync_fetch_and_add(x, val);
#endif
}
}}}
then building the compiler runs to completion and futhermore, the one test
for these atomic primops,
`testsuite/tests/concurrent/should_run/AtomicPrimops.hs` passes. It turns
out this test operates on Int which on 32 bit platforms is a 32 bit value.
This makes me wonder if its worth the trouble of implementing these if
they aren't used anywhere.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9886#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list