Add atomic operations to package.conf.in
ClosedPublic

Authored by alexbiehl on Jul 29 2016, 12:48 AM.

Details

Summary

This patch resulted from the discussion in D2431 and should be merged first.

@erikd and @trommler reported errors like

/home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o): In function `c14_info':
(.text+0x2b8): undefined reference to `hs_cmpxchg32'
/home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o): In function `c5e_info':
(.text+0xac4): undefined reference to `hs_cmpxchg32'
/home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o): In function `c8b_info':
(.text+0x1198): undefined reference to `hs_cmpxchg32'
/home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o): In function `c8b_info':
(.text+0x122c): undefined reference to `hs_cmpxchg32'
/home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o): In function `c8b_info':
(.text+0x12ec): undefined reference to `hs_cmpxchg32'

on PowerPC. @simonmar suggests to add the specific exports to rts/package.conf.in. This patch does exactly that, including all other atomic ops as they probably (maybe someone can verify?) suffer from the same problem on PPC.

Test Plan

Please make sure to build on PPC.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alexbiehl updated this revision to Diff 8347.Jul 29 2016, 12:48 AM
alexbiehl retitled this revision from to Add atomic operations to package.conf.in.
alexbiehl updated this object.
alexbiehl edited the test plan for this revision. (Show Details)
alexbiehl added reviewers: simonmar, trommler, erikd.
alexbiehl updated this object.Jul 29 2016, 12:52 AM
alexbiehl edited edge metadata.
trommler requested changes to this revision.Jul 29 2016, 1:27 AM
trommler edited edge metadata.

Please support all 64-bit platforms. See my inline comment.

This revision now requires changes to proceed.Jul 29 2016, 1:27 AM

Oh, I am sorry.

I am looking for a 'is 64 bit-architecture' macro but can't find one.

alexbiehl updated this revision to Diff 8348.Jul 29 2016, 2:34 AM
alexbiehl edited edge metadata.

Put together a macro indicating 64bit on all available archs

alexbiehl updated this revision to Diff 8349.Jul 29 2016, 2:36 AM
alexbiehl edited edge metadata.

Undef macro

alexbiehl updated this revision to Diff 8350.Jul 29 2016, 2:37 AM
alexbiehl edited edge metadata.

Trailing whitespace

erikd accepted this revision.Jul 29 2016, 2:45 AM
erikd edited edge metadata.

Could have also used:

#if WORD_SIZE_IN_BITS == 64

but otherwise fine.

simonmar requested changes to this revision.Jul 29 2016, 3:52 AM
simonmar edited edge metadata.

please do as @erikd suggests and use #if WORD_SIZE_IN_BITS == 64. x64_HOST_ARCH is misleading, and the platform-specific #ifdef will be wrong if we add another 64-bit platform.

This revision now requires changes to proceed.Jul 29 2016, 3:52 AM
alexbiehl updated this revision to Diff 8351.Jul 29 2016, 4:01 AM
alexbiehl edited edge metadata.

use #if WORD_SIZE_IN_BITS == 64 instead of some custom macro

trommler requested changes to this revision.Jul 29 2016, 4:35 AM
trommler edited edge metadata.

One macro is still AMD/Intel specific.

I'll do a validate run on PowerPC 64-bit big endian and report back.

This revision now requires changes to proceed.Jul 29 2016, 4:35 AM
alexbiehl updated this revision to Diff 8352.Jul 29 2016, 4:57 AM
alexbiehl edited edge metadata.

Remove last occurrence of custom macro

trommler accepted this revision.Jul 29 2016, 12:47 PM
trommler edited edge metadata.

This builds on PowerPC 64-bit big endian.

erikd added a comment.Jul 29 2016, 3:59 PM

@alexbiehl Do you have commit access? If not would you like me to commit this for you?

@erikd I just tried: I don't have access. Please go ahead and land my revision :)

This revision was automatically updated to reflect the committed changes.