Linking error
Simon Marlow
simonmar at microsoft.com
Tue Feb 13 10:13:16 EST 2001
> Some students of mine have the following problem:
> When linking a file originally created by happy and compiled
> with ghc they
> get the following error message:
>
> Javahappy.o: In function `Javahappy_actionzu102_entry':
> Javahappy.o(.text+0x12394): undefined reference to
> `PrelTup_Z48T_con_entry'
> Javahappy.o: In function `Javahappy_actionzu99_entry':
> Javahappy.o(.text+0x1247c): undefined reference to
> `PrelTup_Z48T_con_entry'
> Javahappy.o: In function `Javahappy_actionzu97_entry':
> Javahappy.o(.text+0x12564): undefined reference to
> `PrelTup_Z48T_con_entry'
> Javahappy.o: In function `Javahappy_actionzu96_entry':
> Javahappy.o(.text+0x1264c): undefined reference to
> `PrelTup_Z48T_con_entry'
> Javahappy.o: In function `Javahappy_actionzu95_entry':
> Javahappy.o(.text+0x12734): undefined reference to
> `PrelTup_Z48T_con_entry'
> Javahappy.o(.text+0x1281c): more undefined references to
> `PrelTup_Z48T_con_entry' follow
> Javahappy.o: In function `dgJ9_closure':
> Javahappy.o(.data+0x167c): undefined reference to
> `PrelTup_Z48T_static_info'
> collect2: ld returned 1 exit status
>
> > ghc --version
> The Glorious Glasgow Haskell Compilation System, version 4.08.1
> > gcc -v
> gcc version 2.95.2 19991024 (release)
> > happy -v
> Happy Version 1.8 ...
This is a problem that crops up from time to time, but I've never
managed to find a small enough repeatable example to diagnose. The
problem is that ghc translates a mutually recursive set of functions
using a large tuple; the idea being that the tuple should be optimised
away by later transformations. In rare cases, this doesn't happen and
the tuple gets left behind. When the tuple is larger than GHC actually
supports, you get a link error, as above.
Try: using flags -agc to happy (upgrade to version 1.9 first), or
compiling the parser with -O.
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list