Link errors when using the GHC API

Bas van Dijk basvandijk at
Mon Oct 16 06:29:22 EDT 2006

(I noticed my reply to Mathew Mills didn't reach the GHC list, so here it is.)

On Wednesday 11 October 2006 21:53, Mathew Mills wrote:
> Interesting.   I was unable to reproduce your problem.  What platform
> are you running on?  Are you using a binary distribution or one you
> built from source?

I'm running Gentoo Linux (x86). I emerged the latest GHC (6.6). So GHC is 
built from source.

$ uname -a
Linux bassbox 2.6.17-gentoo-r7 #7 PREEMPT Tue Oct 3 01:15:50 CEST 2006 i686 
AMD Athlon(tm) 64 Processor 3200+ GNU/Linux

$ gcc --version
gcc (GCC) 4.1.1 (Gentoo 4.1.1)

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.6

$ ghc-pkg list
    Cabal-1.1.6, GLUT-2.0, HaXml-1.13.2, OpenGL-2.1, QuickCheck-1.0,
    base-2.0, (ghc-6.6), haskell-src-1.0, haskell-src-exts-0.2,
    haskell98-1.0, html-1.0, mtl-1.0, network-2.0, parsec-2.0,
    readline-1.0, regex-base-0.71, regex-compat-0.71, regex-posix-0.71,
    rts-1.0, stm-2.0, template-haskell-2.0, unix-1.0

BTW, why is the (ghc-6.6) package listed between parentheses?

I also emerged GHC on another PC with the same architecture running the same 
Gentoo version and there I had the same error:

$ ghci -package ghc
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package readline-1.0 ... linking ... done.
Loading package unix-1.0 ... linking ... done.
Loading package Cabal-1.1.6 ... linking ... done.
Loading package regex-base-0.71 ... linking ... done.
Loading package regex-posix-0.71 ... linking ... done.
Loading package regex-compat-0.71 ... linking ... done.
Loading package haskell98 ... linking ... done.
ghc-6.6: /usr/lib/ghc-6.6/HSghc.o: unknown symbol 
Loading package ghc-6.6 ... linking ... ghc-6.6: unable to load package 

> Seems like something didn't build right...  You might use 'nm' to
> examine your libHSCabal.a to see if a similarly named symbol is
> present.  For example, is there a leading underscore?  May the
> version ("m1zi1zi6") isn't present?

When I 'nm /usr/lib/ghc-6.6/libHSCabal.a' and search for, for example, 
"Cabalzm1zi1zi6_DistributionziPackage_a_closure" I see that it is indeed an 
(U)ndefined symbol. I don't know what that means though.

Reemerging GHC or Cabal also doesn't help.

Any help is highly appreciated.


Bas van Dijk.

More information about the Glasgow-haskell-users mailing list