Skip to content
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

Use system linker on android #25

Open
bendlas opened this issue Nov 29, 2013 · 4 comments
Open

Use system linker on android #25

bendlas opened this issue Nov 29, 2013 · 4 comments

Comments

@bendlas
Copy link

bendlas commented Nov 29, 2013

ghc-android builds with 'DYNAMIC_GHC_PROGRAMS = NO', hence uses GHCs builtin linker, whose arm support is inclomplete. This leads to error cases such as:

$ arm-linux-androideabi-cabal install --reinstall --force-reinstall vector
...
[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... ghc: /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.7.20130921/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: unhandled ELF relocation(Rel) type 28

ghc: unable to load package `ghc-prim'
Failed to install vector-0.10.9.1
...
@whitehead1415
Copy link

Does this mean that you can't cross compile packages like vector at all? Or is there a way to do it manually?

@rwbarton
Copy link

@bendlas, I'm lost, how do you expect this to work? Are you running GHC on an ARM system? If not, how do you expect to link in ARM object files, static or dynamic?

I think recent versions of vector specifically don't require dynamic code loading.

@bendlas
Copy link
Author

bendlas commented Apr 15, 2015

@rwbarton it's been some time since I worked on this. I used a cross-compilation toolchain to compile and link for arm (there are tutorials on this). It mostly worked and even compiled simple binaries, but more complex examples hit the linker limitation of the GHC linker. I even found out about some plans to enable using the system (cross-compile-toolchain) linker for this, but IIRC @neurocyte wanted to hold off until some mainline work was finished.

@cies
Copy link

cies commented Dec 30, 2015

The issue just mentioned, Dependency on 'linear' introduces many more recursive dependencies, has status closed but is not resolved (since it is actually a ghc-android issue, probably this issue).

We tried to compile the same code for iOS where we did not encounter this ghc: unable to load packageghc-prim'` issue. Interesting. I expect the linker on iOS to be more capable in some respect(s).

I do not know if this issue is relate, but @rwbarton raised is and seems to describe linker incapabilities on in the ghc-android toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants