[nhc-bugs] gcc 3.3 build failure

Ian Lynagh igloo at earth.li
Sun Sep 21 14:55:40 EDT 2003


On Fri, Sep 19, 2003 at 10:31:52AM +0100, Malcolm Wallace wrote:
> Ian Lynagh <igloo at earth.li> 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

-------------- next part --------------
	.file	"AssocTree.hc"
	.data
	.align 4
	.type	startLabel, @object
	.size	startLabel, 12
startLabel:
	.long	131072
	.long	33554689
	.long	startLabel+36
.globl FN_AssocTree_46mapAT
	.align 32
	.type	FN_AssocTree_46mapAT, @object
	.size	FN_AssocTree_46mapAT, 32
FN_AssocTree_46mapAT:
	.long	19565184
	.long	704870027
	.long	613183746
	.long	486897158
	.long	158
	.long	0
	.long	131076
	.long	0
.globl F0_AssocTree_46mapAT
	.align 32
	.type	F0_AssocTree_46mapAT, @object
	.size	F0_AssocTree_46mapAT, 156
F0_AssocTree_46mapAT:
	.long	FN_AssocTree_46mapAT-9
	.long	startLabel+69
	.long	FN_Tree234_46treeMap-5
	.long	FN_Prelude_46_36-5
	.long	F0_NHC_46Internal_46_95id
	.long	131072
	.long	33554689
	.long	startLabel+108
	.long	-2145674367
	.long	713687577
	.long	594644481
	.long	91655681
	.long	40476
	.long	0
	.long	0
	.long	33685506
	.long	131073
	.long	0
	.long	startLabel+67
	.long	FN_NHC_46Internal_46_95apply1-5
	.long	16908291
	.long	50332161
	.long	startLabel+168
	.long	-2145674111
	.long	1245721
	.long	713716101
	.long	2122876673
	.long	453213700
	.long	486677120
	.long	158
	.long	0
	.long	196609
	.long	0
	.long	startLabel+125
	.long	FN_Prelude_46compare-5
	.long	262144
	.long	33685763
	.long	67109633
	.long	startLabel+228
.globl FN_AssocTree_46updateAT
	.align 32
	.type	FN_AssocTree_46updateAT, @object
	.size	FN_AssocTree_46updateAT, 36
FN_AssocTree_46updateAT:
	.long	69896832
	.long	50408331
	.long	1980135052
	.long	1895967237
	.long	119801380
	.long	-1642264970
	.long	0
	.long	262149
	.long	0
.globl F0_AssocTree_46updateAT
	.align 32
	.type	F0_AssocTree_46updateAT, @object
	.size	F0_AssocTree_46updateAT, 96
F0_AssocTree_46updateAT:
	.long	FN_AssocTree_46updateAT-13
	.long	startLabel+265
	.long	startLabel+129
	.long	FN_Tree234_46treeUpdate-5
	.long	FN_Prelude_46_36-5
	.long	F0_NHC_46Internal_46_95id
	.long	131072
	.long	33554689
	.long	startLabel+304
	.long	-2145674367
	.long	713687577
	.long	594644481
	.long	91655681
	.long	40476
	.long	0
	.long	0
	.long	33685506
	.long	131073
	.long	0
	.long	startLabel+263
	.long	FN_NHC_46Internal_46_95apply1-5
	.long	16908291
	.long	50332161
	.long	startLabel+364
.globl FN_AssocTree_46lookupAT
	.align 32
	.type	FN_AssocTree_46lookupAT, @object
	.size	FN_AssocTree_46lookupAT, 40
FN_AssocTree_46lookupAT:
	.long	-1979636864
	.long	50408331
	.long	108432497
	.long	108398198
	.long	-1642266070
	.long	0
	.long	0
	.long	2
	.long	196611
	.long	0
.globl F0_AssocTree_46lookupAT
	.align 32
	.type	F0_AssocTree_46lookupAT, @object
	.size	F0_AssocTree_46lookupAT, 140
F0_AssocTree_46lookupAT:
	.long	FN_AssocTree_46lookupAT-11
	.long	startLabel+389
	.long	startLabel+129
	.long	FN_Tree234_46treeSearch-5
	.long	16777217
	.long	startLabel+420
	.long	-2145674623
	.long	594608665
	.long	-1642295551
	.long	0
	.long	0
	.long	16842770
	.long	65536
	.long	0
	.long	startLabel+389
	.long	262144
	.long	33685763
	.long	67109633
	.long	startLabel+480
	.long	77431177
	.long	35225627
	.long	1904541715
	.long	-2029966710
	.long	2114223752
	.long	444603139
	.long	10362114
	.long	0
	.long	262145
	.long	0
	.long	startLabel+435
	.long	FN_Prelude_46compare-5
	.long	17039365
	.long	50463235
	.long	83887105
	.long	startLabel+556
.globl FN_AssocTree_46addAT
	.align 32
	.type	FN_AssocTree_46addAT, @object
	.size	FN_AssocTree_46addAT, 52
FN_AssocTree_46addAT:
	.long	53119616
	.long	67185547
	.long	69927203
	.long	158764037
	.long	108398710
	.long	611385898
	.long	1980179462
	.long	10362119
	.long	0
	.long	0
	.long	33685506
	.long	327685
	.long	0
.globl F0_AssocTree_46addAT
	.align 32
	.type	F0_AssocTree_46addAT, @object
	.size	F0_AssocTree_46addAT, 100
F0_AssocTree_46addAT:
	.long	FN_AssocTree_46addAT-15
	.long	startLabel+591
	.long	startLabel+439
	.long	FN_Tree234_46treeAdd-5
	.long	FN_Prelude_46_36-5
	.long	F0_NHC_46Internal_46_95id
	.long	16908291
	.long	50332161
	.long	startLabel+640
	.long	421239681
	.long	25074690
	.long	35225627
	.long	755051146
	.long	594644483
	.long	108432897
	.long	40476
	.long	0
	.long	0
	.long	33685506
	.long	196609
	.long	0
	.long	startLabel+589
	.long	FN_NHC_46Internal_46_95apply2-5
	.long	0
	.long	startLabel+676
.globl FN_AssocTree_46initAT
	.align 4
	.type	FN_AssocTree_46initAT, @object
	.size	FN_AssocTree_46initAT, 20
FN_AssocTree_46initAT:
	.long	486739073
	.long	158
	.long	0
	.long	1
	.long	0
.globl CF_AssocTree_46initAT
	.align 4
	.type	CF_AssocTree_46initAT, @object
	.size	CF_AssocTree_46initAT, 16
CF_AssocTree_46initAT:
	.long	FN_AssocTree_46initAT-5
	.long	CF_Tree234_46initTree
	.long	16777217
	.long	startLabel+716
.globl FN_AssocTree_46listAT
	.align 4
	.type	FN_AssocTree_46listAT, @object
	.size	FN_AssocTree_46listAT, 24
FN_AssocTree_46listAT:
	.long	-1955493248
	.long	19530358
	.long	40477
	.long	0
	.long	65538
	.long	0
.globl F0_AssocTree_46listAT
	.align 32
	.type	F0_AssocTree_46listAT, @object
	.size	F0_AssocTree_46listAT, 72
F0_AssocTree_46listAT:
	.long	FN_AssocTree_46listAT-7
	.long	startLabel+739
	.long	FN_Tree234_46treeMapList-5
	.long	131072
	.long	33554689
	.long	startLabel+772
	.long	19100032
	.long	469893419
	.long	158
	.long	0
	.long	0
	.long	33685522
	.long	131072
	.long	0
	.long	startLabel+739
	.long	131072
	.long	33554689
	.long	startLabel+816
.globl FN_AssocTree_46reorderAT
	.align 4
	.type	FN_AssocTree_46reorderAT, @object
	.size	FN_AssocTree_46reorderAT, 28
FN_AssocTree_46reorderAT:
	.long	36342400
	.long	19565425
	.long	486897292
	.long	158
	.long	0
	.long	131075
	.long	0
.globl F0_AssocTree_46reorderAT
	.align 4
	.type	F0_AssocTree_46reorderAT, @object
	.size	F0_AssocTree_46reorderAT, 28
F0_AssocTree_46reorderAT:
	.long	FN_AssocTree_46reorderAT-9
	.long	FN_AssocTree_46listAT-5
	.long	FN_Prelude_46foldl-5
	.long	CF_AssocTree_46initAT
	.long	16908291
	.long	50332161
	.long	startLabel+872
.globl FN_Prelude_46Show_46AssocTree_46AssocTree_46show
	.align 4
	.type	FN_Prelude_46Show_46AssocTree_46AssocTree_46show, @object
	.size	FN_Prelude_46Show_46AssocTree_46AssocTree_46show, 28
FN_Prelude_46Show_46AssocTree_46AssocTree_46show:
	.long	19630720
	.long	53119746
	.long	108432497
	.long	-1642265482
	.long	0
	.long	196611
	.long	0
.globl F0_Prelude_46Show_46AssocTree_46AssocTree_46show
	.align 4
	.type	F0_Prelude_46Show_46AssocTree_46AssocTree_46show, @object
	.size	F0_Prelude_46Show_46AssocTree_46AssocTree_46show, 28
F0_Prelude_46Show_46AssocTree_46AssocTree_46show:
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46show-11
	.long	FN_Prelude_46Show_46Prelude_462-5
	.long	FN_AssocTree_46listAT-5
	.long	FN_Prelude_46Show_46Prelude_46_91_93_46show-5
	.long	16908291
	.long	50332161
	.long	startLabel+928
.globl FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType
	.align 4
	.type	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType, @object
	.size	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType, 28
FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType:
	.long	19630720
	.long	1988849922
	.long	486746628
	.long	158
	.long	0
	.long	196610
	.long	0
.globl F0_Prelude_46Show_46AssocTree_46AssocTree_46showsType
	.align 4
	.type	F0_Prelude_46Show_46AssocTree_46AssocTree_46showsType, @object
	.size	F0_Prelude_46Show_46AssocTree_46AssocTree_46showsType, 24
F0_Prelude_46Show_46AssocTree_46AssocTree_46showsType:
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType-11
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree-5
	.long	FN_Prelude_46_95_46showsType-5
	.long	16908291
	.long	50332161
	.long	startLabel+980
.globl FN_Prelude_46Show_46AssocTree_46AssocTree_46showList
	.align 4
	.type	FN_Prelude_46Show_46AssocTree_46AssocTree_46showList, @object
	.size	FN_Prelude_46Show_46AssocTree_46AssocTree_46showList, 28
FN_Prelude_46Show_46AssocTree_46AssocTree_46showList:
	.long	19630720
	.long	1988849922
	.long	486746628
	.long	158
	.long	0
	.long	196610
	.long	0
.globl F0_Prelude_46Show_46AssocTree_46AssocTree_46showList
	.align 4
	.type	F0_Prelude_46Show_46AssocTree_46AssocTree_46showList, @object
	.size	F0_Prelude_46Show_46AssocTree_46AssocTree_46showList, 28
F0_Prelude_46Show_46AssocTree_46AssocTree_46showList:
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showList-11
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree-5
	.long	FN_Prelude_46_95_46showList-5
	.long	262144
	.long	33685763
	.long	67109633
	.long	startLabel+1036
.globl FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec
	.align 4
	.type	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec, @object
	.size	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec, 28
FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec:
	.long	19630720
	.long	1988849922
	.long	67316740
	.long	158
	.long	0
	.long	262146
	.long	0
.globl F0_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec
	.align 4
	.type	F0_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec, @object
	.size	F0_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec, 24
F0_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec:
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec-13
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree-5
	.long	FN_Prelude_46_95_46showsPrec-5
	.long	131072
	.long	33554689
	.long	startLabel+1116
.globl FN_Prelude_46Show_46AssocTree_46AssocTree
	.align 32
	.type	FN_Prelude_46Show_46AssocTree_46AssocTree, @object
	.size	FN_Prelude_46Show_46AssocTree_46AssocTree, 56
FN_Prelude_46Show_46AssocTree_46AssocTree:
	.long	730493312
	.long	-1955528191
	.long	1895956779
	.long	33631116
	.long	721822833
	.long	594608641
	.long	755248385
	.long	479104771
	.long	158
	.long	0
	.long	0
	.long	67371010
	.long	131076
	.long	0
.globl F0_Prelude_46Show_46AssocTree_46AssocTree
	.align 4
	.type	F0_Prelude_46Show_46AssocTree_46AssocTree, @object
	.size	F0_Prelude_46Show_46AssocTree_46AssocTree, 20
F0_Prelude_46Show_46AssocTree_46AssocTree:
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree-9
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsPrec-9
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showsType-7
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46showList-7
	.long	FN_Prelude_46Show_46AssocTree_46AssocTree_46show-7
	.ident	"GCC: (GNU) 3.3.2 20030908 (Debian prerelease)"


More information about the Nhc-bugs mailing list