1

I've got a bit of an issue. I've been working on linking some Rust code I'm developing with some heavy-lifting algorithms that have been written in Haskell. I have gotten cargo to play nicely with ghc and cabal, and have my code working the the Fibonacci test and now I'm trying to get everything properly linked with my algorithms in Haskell.

The problem: Everything seems to generate correctly, but when running, I'm missing a symbol: _attoparseczm0zi13zi0zi0_DataziAttoparsecziByteStringziBuffer_Buf_con_info

I tracked down the symbol to part of the haskell-platform package installed, but then, when I try to compile with:

ghc -o target/debug/build/shroudbase-algorithms-c299ade0066a2dda/out/libshroudbase.so -shared -dynamic -fPIC dist/build/Shroudbase/C.o cbits/wrapper.o -lHSrts -lffi -lHSattoparsec-0.13.0.0 -L.cabal-sandbox/lib/x86_64-osx-ghc-7.8.4/attoparsec-0.13.0.0`

I get:

ld: illegal text-relocation to '_base_DataziEither_Left_con_info' in /Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/base-4.7.0.2/libHSbase-4.7.0.2-ghc7.8.4.dylib from '_c3uyl_info' in .cabal-sandbox/lib/x86_64-osx-ghc-7.8.4/attoparsec-0.13.0.0/libHSattoparsec-0.13.0.0.a(Lazy.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I can't seem to get the right libraries to link to get main body of Rust code running with the included dynamic library.

Let me know if I can give additional information.

EDIT1: previous information can be found here

0 Answers0