adds -latomic to. ghc-prim
ClosedPublic

Authored by angerman on Feb 4 2018, 8:03 PM.

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.
angerman created this revision.Feb 4 2018, 8:03 PM

@bgamari yey, everything is green... except for Linux which fails with Haddock 🗡

Why do we need this?

angerman added a comment.EditedFeb 6 2018, 9:03 PM

Why do we need this?

In cbits/atomic.c we use HAVE_C11_ATOMICS, which gloriously is defined via autoconfig, outside of ghc-prim, and ends up in ghcautoconf.h

So maybe we should rather define a atomic flag in ghc-prim, which sets the HAVE_C11_ATOMICS, and links -latomic? And then have
GHC build ghc-prim with -f+atomic, if we detect HAVE_C11_ATOMICS?


Or we could just turn ghc-prim into a configure package. And have it do the right thing self contained?

bgamari added a subscriber: hvr.Feb 12 2018, 7:37 PM

Why do we need this?

In cbits/atomic.c we use HAVE_C11_ATOMICS, which gloriously is defined via autoconfig, outside of ghc-prim, and ends up in ghcautoconf.h

So maybe we should rather define a atomic flag in ghc-prim, which sets the HAVE_C11_ATOMICS, and links -latomic? And then have
GHC build ghc-prim with -f+atomic, if we detect HAVE_C11_ATOMICS?


Or we could just turn ghc-prim into a configure package. And have it do the right thing self contained?

@hvr, what do you think about this? I'm not sure I see much advantage to making ghc-prim its own configure script at the moment.

I have a working version with the configure script in a local branch.

I am much in favor of untangling the build system and making the packages self contained instead of linking resources across package boundaries. (header files, ... and here: defines)

angerman updated this revision to Diff 15442.Feb 13 2018, 7:57 AM
  • adds configure
bgamari accepted this revision.Feb 14 2018, 11:43 AM

Looks reasonable to me.

This revision is now accepted and ready to land.Feb 14 2018, 11:43 AM
This revision was automatically updated to reflect the committed changes.