
Hi, My builds with gcc 3.3 on Linux are segfaulting, e.g. http://buildd.debian.org/fetch.php?&pkg=nhc98&ver=1.16-2&arch=sparc&stamp=1063762426&file=log&as=raw This is using the patch at http://ftp.debian.org/debian/pool/main/n/nhc98/nhc98_1.16-2.diff.gz which I think should be the two non-win32 patches from your website, the asmlong.h patch you committed to CVS, changing abort(-1) to abort() in src/runtime/Integer/alloca.c and protecting a trailing \ in src/prelude/List/Difference.hs with a comment. Also, your build system isn't very clear to me - what is the recommended way to use /usr/bin/gcc-2.95 as the C compiler? Thanks Ian

Ian Lynagh
My builds with gcc 3.3 on Linux are segfaulting.
We already saw a similar behaviour in the move from gcc-2.95 to gcc-3.x, so although we have fixed it once, perhaps the cause is similar. I suspect a change in the alignment constraints inserted into the assembler code. nhc98 assumes and requires a .align 4 between constant arrays of unsigned long. In gcc-3.0, these sometimes inexplicably lengthened to .align 32 and there is an "evil mangler" in the nhc98 driver script which converts them back to 4. I suggest you run gcc -x c -S -Iinclude on an arbitrary .hc file somewhere in the distribution package, and examine the output .s file with "grep .align". If any of the numbers are neither 4 nor 32, then we have the culprit.
which I think should be the two non-win32 patches from your website, the asmlong.h patch you committed to CVS, changing abort(-1) to abort() in src/runtime/Integer/alloca.c and protecting a trailing \ in src/prelude/List/Difference.hs with a comment.
Your extra bugfixes are noted, thanks.
Also, your build system isn't very clear to me - what is the recommended way to use /usr/bin/gcc-2.95 as the C compiler?
The best way would be to set it up at configure time: CC=gcc-2.95 ./configure ... make basic Regards, Malcolm

On Fri, Sep 19, 2003 at 10:31:52AM +0100, Malcolm Wallace wrote:
Ian Lynagh
writes: My builds with gcc 3.3 on Linux are segfaulting.
We already saw a similar behaviour in the move from gcc-2.95 to gcc-3.x, so although we have fixed it once, perhaps the cause is similar. I suspect a change in the alignment constraints inserted into the assembler code. nhc98 assumes and requires a .align 4 between constant arrays of unsigned long. In gcc-3.0, these sometimes inexplicably lengthened to .align 32 and there is an "evil mangler" in the nhc98 driver script which converts them back to 4.
I suggest you run gcc -x c -S -Iinclude on an arbitrary .hc file somewhere in the distribution package, and examine the output .s file with "grep .align". If any of the numbers are neither 4 nor 32, then we have the culprit.
Not with gcc -x c -S -Iinclude src/compiler98/AssocTree.hc I've attached the .s file.
which I think should be the two non-win32 patches from your website, the asmlong.h patch you committed to CVS, changing abort(-1) to abort() in src/runtime/Integer/alloca.c and protecting a trailing \ in src/prelude/List/Difference.hs with a comment.
Your extra bugfixes are noted, thanks.
Also, I don't think make clean should be removing the .hc files in the tarball: --- nhc98-1.16.orig/src/compiler98/Makefile +++ nhc98-1.16/src/compiler98/Makefile @@ -82,7 +82,7 @@ cd $(OBJDIR); $(LOCAL)nhc98 -H8M -o $(TARGET) *.$O strip $(TARGET) clean: - rm -f $(OBJDIR)/*.$O *.$O *.hi *.hc + rm -f $(OBJDIR)/*.$O *.$O *.hi realclean: clean rm -f *.hc *.c $(TARGET) --- nhc98-1.16.orig/src/hmake/Makefile +++ nhc98-1.16/src/hmake/Makefile @@ -46,7 +46,7 @@ strip $(MKPROG) $(OLDER) $(MKCONFIG) clean: rm -f $(OBJS) $(CPPOBJS) $(OBJDIR)/Older.$O $(OBJDIR)/MkConfig.$O - rm -f *.hi *.hc *.c + rm -f *.hi *.c realclean: clean rm -f $(TARGETS) package:
Also, your build system isn't very clear to me - what is the recommended way to use /usr/bin/gcc-2.95 as the C compiler?
The best way would be to set it up at configure time:
CC=gcc-2.95 ./configure ... make basic
$ tar -zxf nhc98src-1.16.tar.gz $ cd nhc98-1.16/ $ CC=gcc-2.95 ./configure > ../configure.out cat: targets/ix86-Linux/ghcsym: No such file or directory $ make basic make: *** No rule to make target `basic-gcc', needed by `basic'. Stop. $ Passing configure --buildwith=gcc-2.95 doesn't help. Thanks Ian

On Sun, Sep 21, 2003 at 01:55:40PM +0100, Ian Lynagh wrote:
On Fri, Sep 19, 2003 at 10:31:52AM +0100, Malcolm Wallace wrote:
Ian Lynagh
writes: Also, your build system isn't very clear to me - what is the recommended way to use /usr/bin/gcc-2.95 as the C compiler?
The best way would be to set it up at configure time:
CC=gcc-2.95 ./configure ... make basic
$ tar -zxf nhc98src-1.16.tar.gz $ cd nhc98-1.16/ $ CC=gcc-2.95 ./configure > ../configure.out cat: targets/ix86-Linux/ghcsym: No such file or directory $ make basic make: *** No rule to make target `basic-gcc', needed by `basic'. Stop. $
I've done this for now which makes it work: --- nhc98-1.16.orig/Makefile +++ nhc98-1.16/Makefile @@ -145,12 +145,14 @@ ##### compiler build + install scripts +COMPSUFFIX=$(if $(findstring gcc,$(BUILDCOMP)),$(CC),$(BUILDCOMP)) + default: all -basic: basic-${BUILDCOMP} -all: all-${BUILDCOMP} -compiler: compiler-${BUILDCOMP} -greencard: greencard-${BUILDCOMP} -hmake: hmake-${BUILDCOMP} +basic: basic-${COMPSUFFIX} +all: all-${COMPSUFFIX} +compiler: compiler-${COMPSUFFIX} +greencard: greencard-${COMPSUFFIX} +hmake: hmake-${COMPSUFFIX} help: @echo "Default target is: basic + heapprofile + timeprofile" @echo "Main targets include: basic heapprofile timeprofile" @@ -176,10 +178,10 @@ basic-$(CC): runtime prelude-$(CC) pragma-$(CC) compiler-$(CC) \ greencard-$(CC) hmake-$(CC) libraries-$(CC) -all-$(BUILDCOMP): basic-$(BUILDCOMP) heapprofile timeprofile #hoodui +all-$(COMPSUFFIX): basic-$(COMPSUFFIX) heapprofile timeprofile #hoodui -heapprofile: compiler profruntime profprelude-$(BUILDCOMP) hp2graph -timeprofile: compiler timeruntime timeprelude-$(BUILDCOMP) +heapprofile: compiler profruntime profprelude-$(COMPSUFFIX) hp2graph +timeprofile: compiler timeruntime timeprelude-$(COMPSUFFIX) profprelude-nhc: profprelude profprelude-ghc: profprelude Thanks Ian
participants (2)
-
Ian Lynagh
-
Malcolm Wallace