[Pkg-haskell-maintainers] Bug#712228: ghc: Hard to use for compilation: linking failures with no apparent solution

Reuben Thomas rrt at sc3d.org
Fri Jun 14 09:00:37 UTC 2013


Package: ghc
Version: 7.6.2-1ubuntu1
Severity: normal

I want to compile a simple Haskell program:

$ git clone git://github.com/jgoerzen/twidge.git
$ ghc --make -o setup Setup.lhs
[1 of 1] Compiling Main             ( Setup.lhs, Setup.o )
Linking setup ...
/usr/bin/ld.bfd.real: Setup.o: relocation R_X86_64_32S against `stg_CAF_BLACKHOLE_info’ can not be used when making a shared object; recompile with -fPIC
Setup.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

Oops! So, after a bit of searching, I tried:

$ ghc --make -dynamic -o setup Setup.lhs
[1 of 1] Compiling Main             ( Setup.lhs, Setup.o )
Linking setup ...
/usr/bin/ld.bfd.real: Setup.o: relocation R_X86_64_PC32 against undefined symbol `newCAF’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld.bfd.real: final link failed: Bad value

Oops! More searching leads me to this ancient mailing list message:

http://www.haskell.org/pipermail/glasgow-haskell-users/2004-May/006597.html

but no further clues I can translate into workarounds. I can't find a
README.Debian explaining this problem, but without further evidence,
it doesn't seem to be a GHC bug.

I presume there is a workaround; it would be lovely to know what it is.

(Disclosure: I used to be on the GHC team! A very long time ago,
though. And I mostly worked on the Windows port.)

I am using Ubuntu, but the only change in the Ubuntu packaging is to
disable GHCi on ARM (a change since adopted upstream), so I'm fairly
confident this problem manifests on Debian x86_64 too.

-- System Information:
Debian Release: wheezy/sid
  APT prefers raring-updates
  APT policy: (500, 'raring-updates'), (500, 'raring-security'), (500, 'raring')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8.0-19-generic (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ghc depends on:
ii  gcc         4:4.7.3-1ubuntu10
ii  libbsd-dev  0.4.2-1ubuntu1
ii  libc6       2.17-0ubuntu5
ii  libc6-dev   2.17-0ubuntu5
ii  libffi-dev  3.0.13-2ubuntu1
ii  libffi6     3.0.13-2ubuntu1
ii  libgmp-dev  2:5.0.5+dfsg-2ubuntu3
ii  libgmp10    2:5.0.5+dfsg-2ubuntu3
ii  libtinfo5   5.9-10ubuntu4

ghc recommends no packages.

Versions of packages ghc suggests:
pn  ghc-doc      <none>
pn  ghc-prof     <none>
pn  haskell-doc  <none>
pn  llvm-3.0     <none>
ii  perl         5.14.2-21

-- no debconf information



More information about the Pkg-haskell-maintainers mailing list