
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