Skip to content

Build failure on windows: rts/Linker.c

I'm getting this error when trying to compile current GHC-HEAD on windows:

"inplace/bin/ghc-stage1.exe" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Wi
nline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -opt
c-Irts -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-Ilibffi/build/include -optc-fomit-frame-pointer -optc-DRtsWay=\
"rts_thr\" -optc-DTHREADED_RTS  -H32m -O -Iincludes -Irts -DCOMPILING_RTS -package-name rts  -dcmm-lint  -Ilibffi/build/include     -i -irts
 -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen          -optc-O2   -c rts/Linker.c -o rts/dist/build/L
inker.thr_o

rts\Linker.c:1039:1:  error: conflicting types for 'mktime'
c:\haskell\ghc-src\inplace\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/time.h:104:40: note: previous declaration of 'mktime' was
here

rts\Linker.c:1039:1:  error: conflicting types for 'localtime'
c:\haskell\ghc-src\inplace\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/time.h:121:45: note: previous declaration of 'localtime' w
as here

rts\Linker.c:1039:1:  error: conflicting types for 'gmtime'
c:\haskell\ghc-src\inplace\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/time.h:120:45: note: previous declaration of 'gmtime' was
here
make[1]: *** [rts/dist/build/Linker.thr_o] Error 1
make: *** [all] Error 2

rts/Linker.c:1039 basicly is just:

RTS_MINGW_ONLY_SYMBOLS

with the definition somewhere below line 381:

/* These are statically linked from the mingw libraries into the ghc
   executable, so we have to employ this hack. */
#define RTS_MINGW_ONLY_SYMBOLS                           \
      ...
      SymI_NeedsProto(mktime)                            \
      ...
      SymI_NeedsProto(localtime)                         \
      SymI_NeedsProto(gmtime)                            \
      ...

I tried all different versions of MinGW - the one of the current Haskell Platform 2010.2.0.0 and the one currently available at mingw.org and an old version I had installed.

However, removing these 3 lines will result in another error, so the changes to fix this won't be that trivial:

rts\sm\GC.c: In function 'new_gc_thread':

rts\sm\GC.c:863:11:
     error: incompatible types when assigning to type 'OSThreadId' from type 'int'
make[1]: *** [rts/dist/build/sm/GC.thr_o] Error 1
make: *** [all] Error 2

(even though I'm not 100% if that's because of those changes, since I probably never got that far in the building process...)

Trac metadata
Trac field Value
Version
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information