On 13/10/2011 19:30, Ben Gamari wrote:
While compiling the master branch on my ARM machine, I ran into the
following error. It seems that the Alloc.hs defines functions named
free, malloc, and realloc, which then clash with the built-in
functions of the same name. Any ideas what to do here? Thanks.

You might try adding malloc/realloc/free to the list of symbols in compiler/cmm/CLabel.hs, math_funs. It looks like your gcc has some built-in prototypes for these functions that you can't override, which is messing up the way we generate C code (we assume there are no prototypes in scope, because we don't #include any headers - this is a deliberate choice).

Cheers,
        Simon




Cheers,

- Ben


[1] Error:

"inplace/bin/ghc-stage1"   -H64m -O0 -fvia-C -keep-tmp-files    -package-name 
base-4.4.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build 
-ilibraries/base/dist-install/build/autogen -Ilibraries/base/dist-install/build 
-Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include   
-optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include 
-optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.2.0.0 
-package integer-gmp-0.3.0.0 -package rts-1.0  -package-name base -XHaskell98 -XCPP -O 
-fasm  -no-user-package-conf -rtsopts     -odir libraries/base/dist-install/build -hidir 
libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -hisuf hi 
-osuf  o -hcsuf hc -c libraries/base/./Foreign/Marshal/Alloc.hs -o 
libraries/base/dist-install/build/Foreign/Marshal/Alloc.o

on the commandline:
     Warning: The -fvia-C flag does nothing; it will be removed in a future GHC 
release

on the commandline:
     Warning: Compiler has no native codegen, so ignoring -fasm

/tmp/ghc22798_0/ghc22798_0.hc:469:1:
      warning: built-in function ‘free’ declared as non-function
/tmp/ghc22798_0/ghc22798_0.hc: In function 
‘base_ForeignziMarshalziAlloc_zdwa_entry’:

/tmp/ghc22798_0/ghc22798_0.hc:544:2:
      warning: conflicting types for built-in function ‘malloc’
/tmp/ghc22798_0/ghc22798_0.hc: In function ‘s1LZ_ret’:

/tmp/ghc22798_0/ghc22798_0.hc:845:2:
      warning: conflicting types for built-in function ‘realloc’
/tmp/ghc22798_0/ghc22798_0.hc: In function 
‘base_ForeignziMarshalziAlloc_zdwccall_entry’:

/tmp/ghc22798_0/ghc22798_0.hc:992:2:
      error: ‘free’ redeclared as different kind of symbol

/tmp/ghc22798_0/ghc22798_0.hc:469:1:
      note: previous declaration of ‘free’ was here


[2] Region surrounding line 469 of C source. Note line 469,
     "EI_(free);", which apparently defines free to be an StgWordArray.

EF_(base_ForeignziMarshalziAlloc_alloca_entry);
StgWord base_ForeignziMarshalziAlloc_alloca_info[] = {
(W_)&base_ForeignziMarshalziAlloc_alloca_entry, 0x0, 0x1000fU, 0x10005U, 
(W_)&base_ForeignziMarshalziAlloc_alloca_srt
};
EI_(base_GHCziPtr_FunPtr_static_info);
EI_(free);
StgWord base_ForeignziMarshalziAlloc_finalizzerFree_closure[] = {
(W_)&base_GHCziPtr_FunPtr_static_info, (W_)&free
};
EI_(base_ForeignziMarshalziAlloc_mallocBytes4_info);
StgWord base_ForeignziMarshalziAlloc_mallocBytes4_closure[] = {
(W_)&base_ForeignziMarshalziAlloc_mallocBytes4_info, 0x0, 0x0, 0x0
};


_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc


_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to