Help with unregisterised build
Jeremy Wazny
jeremywazny at yahoo.com.au
Wed Sep 13 07:43:03 EDT 2006
Hello GHC users,
I've attempted to build an installation of GHC which uses
unregisterised libraries, but have not had much success. I am new to
GHC's build system and would be grateful for some advice.
I'm trying to build the 6.4.2 source distribution on an x86 linux
machine, using GHC 6.4.2 (the "Generic Linux with glibc2.3" version on
the download page.) The target is the same machine.
I've created a mk/build.mk file containing just the line:
GhcUnregisterised = YES
which, according to the comment in mk/config.mk, ought to build the
unregisterised libraries that I'm after (and use them by default.)
I run configure as follows:
./configure --prefix="$HOME"/ghc_u
and then simply "make".
After some time, the build fails with the following:
------------------------------------------------------------------------
==fptools== make all -wr;
in /mnt/raid/home/jeremyrw/src/src/ghc-6.4.2/libraries/base
------------------------------------------------------------------------
../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude
-"#include" HsBase.h -funbox-strict-fields -ignore-package base -O
-Rghc-timing -fgenerics -fgenerics -split-objs -c GHC/Err.lhs-boot
-o GHC/Err.o-boot -ohi GHC/Err. hi-boot
<<ghc: 13862608 bytes, 4 GCs, 102828/102828 avg/max bytes residency (1
samples), 18M in use, 0.00 INIT (0.00 elapsed), 0.03 MUT (0.03
elapsed), 0.00 GC (0.02 elapsed) :ghc>>
rm -f GHC/Base.o; if [ ! -d GHC/Base_split ]; then mkdir
GHC/Base_split; else /usr/bin/find GHC/Base_split -name '*.o' -print |
xargs rm -f __rm_food; fi;
../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude
-"#include" HsBase.h -funbox-strict-fields -ignore-package base -O
Rghc-timing -fgenerics -fgenerics -split-objs -c GHC/Base.lhs -o
GHC/Base.o -ohi GHC/Base.hi
/tmp/ghc4237.s: Assembler messages:
/tmp/ghc4237.s:17: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:29: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:41: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:53: Error: symbol `__stg_split_marker' is already
defined
.... This goes on for a while ...
/tmp/ghc4237.s:16568: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:16614: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:16660: Error: symbol `__stg_split_marker' is already
defined
/tmp/ghc4237.s:16706: Error: symbol `__stg_split_marker' is already
defined
<<ghc: 124912780 bytes, 12 GCs, 808164/1513632 avg/max bytes residency
(2 samples), 19M in use, 0.00 INIT (0.00 elapsed), 0.59 MUT (2.39
elapsed), 0.10 GC (0.09 elapsed) :ghc>>
make[2]: *** [GHC/Base.o] Error 1
make[1]: *** [all] Error 1
make[1]: Leaving directory
`/mnt/raid/home/jeremyrw/src/src/ghc-6.4.2/libraries'
make: *** [build] Error 1
I've also tried with the following build.mk
(I was guessing the -fvia-C might avoid the above assembler problem.):
GhcUnregisterised = YES
GhcLibHcOpts = -O -fvia-C
but it fails in the same way.
I'm not sure what to do at this point.
Am I missing something in the build.mk?
My ultimate goal is to link a Haskell object, which exports one of its
functions via the FFI, with some other objects, into a single shared
object. To do this I will need to compile everything with gcc's -fPIC
flag, hence the need for unregisterised libraries.
To go that extra step (to get relocatable GHC libraries), I'm guessing
that I'll need to extend the GhcLibHcOpts line in build.mk with: -optc
-fPIC.
Will I need to do that for the run-time system as well?
i.e. adding a line like: GhcRtsHcOpts = -fvia-C -optc '-fPIC'
Is there likely to be anything else that needs to be tweaked?
Has anybody had any success with this sort of thing before?
Regards,
Jeremy
____________________________________________________
On Yahoo!7
Answers: 25 million answers and counting. Learn something new today
http://www.yahoo7.com.au/answers
More information about the Glasgow-haskell-users
mailing list