Building GHC 5.02 on Solaris x86
Ian Lynagh
igloo at earth.li
Tue Oct 23 20:22:37 EDT 2001
On Tue, Oct 23, 2001 at 02:10:52PM +0100, Simon Marlow wrote:
> > I am trying to build GHC 5.02 on an x86 Solaris machine (with
> > the x86 HC
> > stuff) and I am getting this error:
> >
[...]
>
> You need to add the line
>
> MArray_HC_OPTS += -monly-3-regs
>
> to fptools/hslibs/lang/Makefile.
Thanks
> > I have also fount it neccesary to add
> > /tmp/foo/ghc-5.02/ghc/driver/mangler to the path for ghc-asm - should
> > this be needed?
>
> I don't know, we haven't tested the bootstrapping process very
> thoroughly due to lack of time. I'll be happy to look through any
> patches you come up with, though.
I've attached a diff of the changes I've made so far - they are changes
to make it work rather than the correct way to fix it, though.
I'm not quite there yet. It's currently doing this when linking
everything together into ghc-5.02:
[...]
lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm -L/auto/ecslab/m99igl/scratch/local/readline/lib -lreadline -lhistory -ltermcap -ldl
Undefined first referenced
symbol in file
Readline_addzuhistory_closure ghci/InteractiveUI.o
Readline_readline_fast2 ghci/InteractiveUI.o
Readline_readline_closure ghci/InteractiveUI.o
__stginit_Readline ghci/InteractiveUI.o
ld: fatal: Symbol referencing errors. No output written to ghc-5.02
collect2: ld returned 1 exit status
make[1]: *** [ghc-5.02] Error 1
make: *** [all] Error 1
make: Leaving directory `/tmp/foo/ghc-5.02/ghc'
I'm doing something like:
bunzip2 -c ghc-5.02-src-2.tar.bz2 | tar -xf -
bunzip2 -c ghc-5.02-i386-hc-1.tar.bz2 | tar -xf -
tar -zxf happy-1.11-src.tar.gz
cd ghc-5.02
ln -s ../happy-1.11/happy/ happy
<make the changes>
export PATH=$PATH:/tmp/foo/ghc-5.02/ghc/driver/mangler
CPPFLAGS=-I/auto/ecslab/m99igl/scratch/local/readline/include/
distrib/hc-build --prefix=/auto/ecslab/m99igl/scratch/local/ghc --includedir=/auto/ecslab/m99igl/scratch/local/readline/include/
If anyone spots anything obviously stupid I'm doing, please let me
know :-)
Thanks
Ian
-------------- next part --------------
diff -ur ghc-5.02x/ghc/lib/std/Makefile ghc-5.02/ghc/lib/std/Makefile
--- ghc-5.02x/ghc/lib/std/Makefile Tue Oct 23 10:24:45 2001
+++ ghc-5.02/ghc/lib/std/Makefile Tue Oct 23 22:54:04 2001
@@ -113,14 +113,14 @@
ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
# Standard rule
HSstd.o :: $(GHCI_LIBOBJS)
- ld -r -x -o $@ $(GHCI_LIBOBJS)
+ ld -r -o $@ $(GHCI_LIBOBJS)
else
# Rule for Win32 platform
# Keep HSstd.o as a pseudo-target (I think)
HSstd.o :: $(GHCI_LIBOBJS)
- ld -r -x -o HSstd1.o $(filter Prel%, $(GHCI_LIBOBJS))
- ld -r -x -o HSstd2.o $(filter-out Prel%, $(GHCI_LIBOBJS))
+ ld -r -o HSstd1.o $(filter Prel%, $(GHCI_LIBOBJS))
+ ld -r -o HSstd2.o $(filter-out Prel%, $(GHCI_LIBOBJS))
endif # TARGETPLATFORM = i386-unknown-mingw32
diff -ur ghc-5.02x/ghc/rts/StgCRun.c ghc-5.02/ghc/rts/StgCRun.c
--- ghc-5.02x/ghc/rts/StgCRun.c Tue Oct 23 10:24:46 2001
+++ ghc-5.02/ghc/rts/StgCRun.c Tue Oct 23 22:57:20 2001
@@ -138,7 +138,7 @@
"movl %2,%%eax\n\t"
"jmp *%%eax\n\t"
- ".global " STG_RETURN "\n"
+ ".globl " STG_RETURN "\n"
STG_RETURN ":\n\t"
"movl %%esi, %%eax\n\t" /* Return value in R1 */
diff -ur ghc-5.02x/hslibs/lang/Makefile ghc-5.02/hslibs/lang/Makefile
--- ghc-5.02x/hslibs/lang/Makefile Tue Oct 23 10:24:47 2001
+++ ghc-5.02/hslibs/lang/Makefile Tue Oct 23 22:54:14 2001
@@ -20,6 +20,7 @@
CTypes_HC_OPTS += -monly-3-regs
ArrayBase_HC_OPTS += -monly-3-regs
ForeignObj_HC_OPTS += -monly-3-regs
+MArray_HC_OPTS += -monly-3-regs
StorableArray_HC_OPTS += -funbox-strict-fields
include $(TOP)/mk/target.mk
diff -ur ghc-5.02x/hslibs/win32/Makefile ghc-5.02/hslibs/win32/Makefile
--- ghc-5.02x/hslibs/win32/Makefile Tue Oct 23 10:24:47 2001
+++ ghc-5.02/hslibs/win32/Makefile Tue Oct 23 22:54:18 2001
@@ -58,9 +58,9 @@
HACKY_ALLOBJS = $(sort $(LIBOBJS) $(STUBOBJS) \
Win32Dialogue_stub.o Win32Window_stub.o)
HSwin32.o :: $(HACKY_ALLOBJS)
- ld -r -x -o HSwin321.o $(filter Win32M% Win32N% Win32R% Win32W%, \
+ ld -r -o HSwin321.o $(filter Win32M% Win32N% Win32R% Win32W%, \
$(HACKY_ALLOBJS))
- ld -r -x -o HSwin322.o $(filter-out Win32M% Win32N% Win32R% Win32W%, \
+ ld -r -o HSwin322.o $(filter-out Win32M% Win32N% Win32R% Win32W%, \
$(HACKY_ALLOBJS))
diff -ur ghc-5.02x/mk/bootstrap.mk ghc-5.02/mk/bootstrap.mk
--- ghc-5.02x/mk/bootstrap.mk Tue Oct 23 10:24:44 2001
+++ ghc-5.02/mk/bootstrap.mk Tue Oct 23 22:56:00 2001
@@ -114,7 +114,7 @@
-u "PrelMain_mainIO_closure" \
-u "__stginit_PrelMain"
-HC_BOOT_LIBS = -lHStext -lHStext_cbits -lHSutil -lHSposix -lHSposix_cbits -lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS)
+HC_BOOT_LIBS = -lHStext -lHStext_cbits -lHSutil -lHSposix -lHSposix_cbits -lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm -L/auto/ecslab/m99igl/scratch/local/readline/lib -lreadline -lhistory -ltermcap $(EXTRA_HC_BOOT_LIBS)
ifeq "$(GhcLibsWithReadline)" "YES"
HC_BOOT_LIBS += $(patsubst %, -l%, $(LibsReadline))
diff -ur ghc-5.02x/mk/target.mk ghc-5.02/mk/target.mk
--- ghc-5.02x/mk/target.mk Tue Oct 23 10:24:44 2001
+++ ghc-5.02/mk/target.mk Tue Oct 23 22:55:34 2001
@@ -337,7 +337,7 @@
ifneq "$(PACKAGE)" ""
# add syslib dependencies and current package name
-SRC_HC_OPTS += -package-name $(PACKAGE)
+#SRC_HC_OPTS += -package-name $(PACKAGE)
SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS))
ifeq "$(IS_CBITS_LIB)" "YES"
@@ -347,7 +347,7 @@
C_SRCS += $(wildcard ../*_hsc.c)
# Make .hsc.h include files from the directory above visible
# (and the cbits/ library too).
-SRC_CC_OPTS += -I.. -I.
+SRC_CC_OPTS += -I.. -I. -I/auto/ecslab/m99igl/scratch/local/readline/include
endif
ifneq "$(way)" "i"
@@ -376,6 +376,8 @@
SRC_CC_OPTS += -Icbits
endif
+SRC_CC_OPTS += -I/auto/ecslab/m99igl/scratch/local/readline/include/
+
endif # PACKAGE
#----------------------------------------
@@ -444,7 +446,7 @@
$(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \
$(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi
ifeq "$(GhcWithInterpreter)" "YES"
-HC_SPLIT_POST = ld -r -x -o $@ $(basename $@)/*.$(way_)o
+HC_SPLIT_POST = ld -r -o $@ $(basename $@)/*.$(way_)o
else
HC_SPLIT_POST = touch $@
endif # GhcWithInterpreter == YES
@@ -474,12 +476,12 @@
ifeq "$(SplitObjs)" "YES"
SRC_HC_POST_OPTS += \
for i in $(basename $@)/*; do \
- ld -r -x -o $$i.tmp $$i; \
+ ld -r -o $$i.tmp $$i; \
$(MV) $$i.tmp $$i; \
done
else
SRC_HC_POST_OPTS += \
- ld -r -x -o $@.tmp $@; $(MV) $@.tmp $@
+ ld -r -o $@.tmp $@; $(MV) $@.tmp $@
endif # SplitObjs
endif # StripLibraries
@@ -527,7 +529,7 @@
# for cbits.
# JRS 04 Sept 01: The exact same deal applies to hslibs/HSwin32.o.
$(GHCI_LIBRARY) :: $(LIBOBJS)
- ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
+ ld -r -o $@ $(LIBOBJS) $(STUBOBJS)
endif # GHCI_LIBRARY != "HSwin32.o"
endif # GHCI_LIBRARY != "HSstd.o"
More information about the Glasgow-haskell-bugs
mailing list