0

I was building GHC to get more libraries than the default installation the Arch repos give, but I managed to do something to the system which makes the initial configure fail on a clean copy of the source:

:~/tmp$ tar -xvf ghc-7.10.2-src.tar.xz
...
:~/tmp$ cd ghc-7.10.2
:~/tmp/ghc-7.10.2$ ./configure --prefix=`pwd`/inst
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC Git commit id... given 0da488c4438d88c9252e0b860426b8e74b5fc9e8
checking for ghc... /usr/local/bin/ghc
checking version of ghc... 7.10.2
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Build platform inferred as: x86_64-unknown-linux
Host platform inferred as: x86_64-unknown-linux
Target platform inferred as: x86_64-unknown-linux
GHC build  : x86_64-unknown-linux
GHC host   : x86_64-unknown-linux
GHC target : x86_64-unknown-linux
configure: Building in-tree ghc-pwd
/usr/bin/ld: utils/ghc-pwd/dist-boot/Main.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
utils/ghc-pwd/dist-boot/Main.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
configure: error: Building ghc-pwd failed

What could I have done to the system? I can only remember doing a sudo make install (before deciding I wanted a user-land install as in the command line above) after getting it to build once, but the error is a ld error not a ghc error...

cronburg
  • 726

1 Answers1

0

I was only looking in /usr/local/lib and /usr/local/bin for ghc stuff to purge, but it seems the make install actually installed things here:

/usr/local/haskell/ghc-7.10.2-x86_64

After removing this directory and reinstalling the repo version of ghc, the configure error goes away. A useful command for me in finding this directory was:

sudo updatedb && (locate ghc | cut -f1-4 -d'/' | sort | uniq)
cronburg
  • 726