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

Specify that ~/.ghc/android-host/bin's ghc must be first on the path #3

Open
dominiccooney opened this issue Jul 16, 2013 · 3 comments

Comments

@dominiccooney
Copy link

I wrestled with this for a couple of days trying to work out why HaskellActivity.cabal was causing incompatible options to ld (-Wl,-r emanating from the bowels of GHC, and -lopt-shared from the cabal file) and trying to make it go (add -shared to ghc-options, then link HSrts and Cffi, finally wrestling with trying to dynamically link modp from gnustl_shared.)

I ultimately realized my (perhaps obvious, in hindsight?) mistake: I was using some random ghc; putting ~/.ghc/android-host/bin first on my path and everything went swimmingly.

It would be nice if the instructions were me-proof.

@neurocyte
Copy link
Owner

I guess I should mention in the ghc-android docs that you should have the android-host ghc compiler as you default ghc when using the cross compilers. The way ghc-android installs things should be cleaned up in general.

@dominiccooney
Copy link
Author

I cloned android-haskell-activity again, and despite having the path set up this time, I encountered this error again:

[exec] /home/dpc/.ghc/android-14/x86-4.7/bin/../lib/gcc/i686-linux-android/4.7/../../../../i686-linux-android/bin/ld: 
fatal error: -shared and -r are incompatible

ant is annoying because it doesn't really understand dependencies. So it seems by continually messing with build options and rebuilding I was able to get to a working state.

It seems voodoo which works again is to edit HaskellActivity.cabal and build once with ghc-options minus -optl-shared plus -shared and no cc-options: -shared or ld-options: shared; then restore the HaskellActivity.cabal and rebuild. For whatever reason ghc doesn't pass -Wl,-r this second time.

@iphydf
Copy link

iphydf commented Jul 1, 2016

I ran into this issue today: /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.gold: fatal error: -shared and -r are incompatible

I was doing arm-linux-androideabi-cabal build.

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

3 participants