Opened 7 years ago

Closed 7 years ago

#1289 closed bug (fixed)

gcc error when building haddock with gcc 4.1.2: initializer element is not constant

Reported by: greenrd Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I got this error when trying to build haddock on x86_64 Linux with gcc 4.1.2 and ghc 6.4.2:

(Note that this is a build of haddock _before_ I've built ghc, so the version 6.6.20070422 is completely irrelevant here.)

------------------------------------------------------------------------
==fptools== make all -wr;
 in /tmp/rmake/builds/ghc/ghc-6.6.20070422/haddock-0.7/haddock/src
------------------------------------------------------------------------
make INSTALLING=0 BIN_DIST=0 - --no-print-directory -r all
/usr/bin/ghc -H16m -O -fglasgow-exts -cpp -package network -package mtl    -c FastMutInt.hs -o FastMutInt.o  -ohi FastMutInt.hi
In file included from /usr/lib/ghc-6.4.2/include/Stg.h:149,
                 from /tmp/ghc26249.hc:3:
/usr/lib/ghc-6.4.2/include/Regs.h:213: warning: call-clobbered register used for global register variable
/usr/lib/ghc-6.4.2/include/Regs.h:342: warning: call-clobbered register used for global register variable
/tmp/ghc26249.hc:9: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:9: error: initializer element is not constant
/tmp/ghc26249.hc:9: error: (near initialization for `FastMutInt_readFastMutInt_closure[0]')
/tmp/ghc26249.hc: In function `s1Z6_ret':
/tmp/ghc26249.hc:20: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:20: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:21: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:26: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_readFastMutInt_entry':
/tmp/ghc26249.hc:40: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:42: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:48: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:48: error: initializer element is not constant
/tmp/ghc26249.hc:48: error: (near initialization for `FastMutInt_writeFastMutInt_closure[0]')
/tmp/ghc26249.hc: In function `s1Zj_ret':
/tmp/ghc26249.hc:57: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:60: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `s1Zi_ret':
/tmp/ghc26249.hc:74: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:76: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_writeFastMutInt_entry':
/tmp/ghc26249.hc:87: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:89: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:95: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:95: error: initializer element is not constant
/tmp/ghc26249.hc:95: error: (near initialization for `FastMutInt_incFastMutInt_closure[0]')
/tmp/ghc26249.hc: In function `s1Zw_ret':
/tmp/ghc26249.hc:107: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:107: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:108: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:110: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:115: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_incFastMutInt_entry':
/tmp/ghc26249.hc:129: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:131: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:137: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:137: error: initializer element is not constant
/tmp/ghc26249.hc:137: error: (near initialization for `FastMutInt_newFastMutInt_closure[0]')
/tmp/ghc26249.hc: In function `s1ZI_ret':
/tmp/ghc26249.hc:156: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:156: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:161: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:171: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:171: error: initializer element is not constant
/tmp/ghc26249.hc:171: error: (near initialization for `FastMutInt_newFastMutInt_info[0]')
/tmp/ghc26249.hc: In function `FastMutInt_newFastMutInt_entry':
/tmp/ghc26249.hc:178: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:178: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:192: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:192: error: initializer element is not constant
/tmp/ghc26249.hc:192: error: (near initialization for `FastMutInt_incFastMutIntBy_closure[0]')
/tmp/ghc26249.hc: In function `s1ZW_ret':
/tmp/ghc26249.hc:204: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:204: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:205: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:207: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:212: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `s1ZV_ret':
/tmp/ghc26249.hc:229: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:231: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_incFastMutIntBy_entry':
/tmp/ghc26249.hc:242: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc:244: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: At top level:
/tmp/ghc26249.hc:250: warning: initializer element is not computable at load time
/tmp/ghc26249.hc:250: error: initializer element is not constant
/tmp/ghc26249.hc:250: error: (near initialization for `FastMutInt_FastMutInt_closure[0]')
/tmp/ghc26249.hc: In function `FastMutInt_FastMutInt_entry':
/tmp/ghc26249.hc:261: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:261: warning: cast from pointer to integer of different size
/tmp/ghc26249.hc:266: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_FastMutInt_con_entry':
/tmp/ghc26249.hc:279: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `FastMutInt_FastMutInt_static_entry':
/tmp/ghc26249.hc:289: warning: cast to pointer from integer of different size
/tmp/ghc26249.hc: In function `__stginit_FastMutInt_':
/tmp/ghc26249.hc:306: warning: cast to pointer from integer of different size
make[3]: *** [FastMutInt.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 1
make[1]: Leaving directory `/tmp/rmake/builds/ghc/ghc-6.6.20070422/haddock-0.7/haddock'
make: *** [build] Error 1
error: Shell command "cd /tmp/rmake/builds/ghc/ghc-6.6.20070422/haddock-0.7 && ./configure && make && cd /tmp/rmake/builds/ghc/ghc-6.6.2  0070422 && ln -s haddock-0.7/haddock" exited with exit code 2

Change History (1)

comment:1 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

With

The Glorious Glasgow Haskell Compilation System, version 6.6

and

gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

trying to build haddock gets past this point, so I think this is just an older ghc not being able to cope with newer gccs. I suggest upgrading to ghc 6.6.1 and then you can build haddock 0.8 with that. You won't be able to haddock the libraries until after you've done so, of course, but that isn't necessary to get a working compiler.

If you have a similar problem trying to build ghc itself then try either an OS-specific package or the generic Linux binary distribution, for either 6.6 or 6.6.1.

Note: See TracTickets for help on using tickets.