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

Accommodate GHC 7.8 by compiling C bits with -fPIC #9

Closed
wants to merge 1 commit into from

Conversation

mietek
Copy link

@mietek mietek commented Nov 8, 2014

As described in Bitbucket issue #9:

The linker changes in GHC 7.8 require building C code with -fPIC.

This is a problem with text-icu-0.7.0.0, reproducible on (at least) Ubuntu 14.04 LTS (64-bit):

$ apt-get install libicu-dev
$ cabal unpack text-icu-0.7.0.0
$ cd text-icu-0.7.0.0
$ cabal sandbox init
$ cabal install --dep
$ cabal configure
$ cabal build
$ cabal repl
Preprocessing library text-icu-0.7.0.0...
GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package text-1.2.0.0 ... linking ... done.
Loading object (static) dist/build/cbits/text_icu.o ... /usr/bin/ld: dist/build/cbits/text_icu.o: relocation R_X86_64_PC32 against undefined symbol `ucnv_getMaxCharSize_52' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

The solution is to add cc-options: -fPIC to the Cabal package description.

@mietek
Copy link
Author

mietek commented Dec 1, 2014

@bos: ping?

@bos
Copy link
Collaborator

bos commented Dec 4, 2014

This is an upstream bug in Cabal that will be fixed shortly.

@bos bos closed this Dec 4, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants