Perry The Cynic writes:
 <snip>
  > The compiler proper (hsc) fails to execute, with ld.so (the runtime linker)
 > complaining that it can't find the symbol "getrusage" in the attached dynamic
 > libraries. This also happens to the binary distribution for version 0.29.
 > I am using a fairly standard Solaris version 2.4.
 > 
 > "Getrusage" is indeed not in Solaris's libc; it's a part of the BSD compatibility
 > world (/usr/ucblib/libucb), which hsc claims it doesn't need (that is,
 > libucb is NOT in its dynamic library dependency list, as shown by "ldd").
 > Without relinking the hsc program, I can't add it.
 > 
 > I assume your Solaris 2 distribution is not just broken, so what obvious(?)
 > change to my environment am I required to make to get hsc to run? I'm planning
 > to build my own 2.04 compiler from sources, but right now I need a running
 > compiler to bootstrap from.

Your Solaris is a little broken. getrusage was in Solaris preceding
version 2.4, and after version 2.4, but not in version 2.4. Odd.  So
one solution is to upgrade to Solaris 2.5.  Another is to dynamically
link a shared object containing getrusage before running the
executable.  This is easier than it sounds.  See
http://www.cse.ogi.edu/~simonpj/ghc-bugs.html#getrusage for more
details.  (The above recipe creates a dummy getrusage which does
nothing.  You can go one step further and create a real getrusage.so
by extracting it from the library with the following magical
incantations:
ar x /usr/ucblib/libucb.a getrusage.o
ld -G -o getrusage.so getrusage.o -lc
 )

Cheers,
Jon

Reply via email to