-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combining lvish with Template Haskell: undefined symbol: nand_and_fetch_8 #123
Comments
Sorry for late response,
What happens when you try to compile this program with GCC? int main()
{
int i = 3;
int j = __sync_nand_and_fetch(&i, 1);
return 0;
} |
Thanks @osa1 . I've boiled it down to a small test case. Main.hs module Main where
import Data.Bits.Atomic
import Data.Word
import Foreign.Ptr
main = do
x <- nandAndFetch nullPtr 1 :: IO Word8
print x Setup.hs import Distribution.Simple
main = defaultMain cas-test.cabal
Trying to compile
The key message is:
For some reason, the symbols from |
This was on Linux, right? Is clang being used here instead of gcc? Which distro, etc? I saw similar problems with Bits-atomic seems like it's probably abandonware, so we may need to fork/maintain it or use something else. @DreamLinuxer is going to contact the maintainer. |
Hi,
I'm experiencing a compilation error
undefined symbol: nand_and_fetch_8
stemming from bits-atomic, when combining Template Haskell with lvish 2.0.2.I've put together a small test case.
Foo.hs
And Main.hs
For convenience, this code has been cabalised, available here: http://www.macs.hw.ac.uk/~rs46/files/lvish-template-haskell-fail-case.tar.gz . When trying to compile with
cabal install
, I get:This symbol should be found from
cbits/atomic-bitops-gcc.h
andcbits/atomic-bitops-gcc.c
from thebits-atomic
package, but it's not being found. I don't get this error if I comment out the lvishbuild-depends
entry in the cabal file and comment out the import ofControl.LVish
in Main.hs .My software environment is: GHC 7.10, 32bit OS, bits-atomic-0.1.3, lvish-2.0.2. Questions:
The text was updated successfully, but these errors were encountered: