Do not #include external header files when compiling via C
authorSimon Marlow <simonmar@microsoft.com>
Wed, 2 Apr 2008 05:14:12 +0000 (05:14 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 2 Apr 2008 05:14:12 +0000 (05:14 +0000)
commitc245355e6f2c7b7c95e9af910c4d420e13af9413
treee8309f467b8bea2501e9f7de7af86fbfc22e0a67
parentab5c770bed51f08d56a0d61086988053b21aa461
Do not #include external header files when compiling via C

This has several advantages:

 - -fvia-C is consistent with -fasm with respect to FFI declarations:
   both bind to the ABI, not the API.

 - foreign calls can now be inlined freely across module boundaries, since
   a header file is not required when compiling the call.

 - bootstrapping via C will be more reliable, because this difference
   in behavour between the two backends has been removed.

There is one disadvantage:

 - we get no checking by the C compiler that the FFI declaration
   is correct.

So now, the c-includes field in a .cabal file is always ignored by
GHC, as are header files specified in an FFI declaration.  This was
previously the case only for -fasm compilations, now it is also the
case for -fvia-C too.
26 files changed:
compiler/cmm/CLabel.hs
compiler/cmm/CmmParse.y
compiler/cmm/PprC.hs
compiler/deSugar/DsForeign.lhs
compiler/main/CodeOutput.lhs
compiler/main/HscTypes.lhs
compiler/main/Packages.lhs
includes/README
includes/Regs.h
includes/Rts.h
includes/RtsExternal.h
includes/RtsTypeable.h
includes/SMP.h
includes/SMPClosureOps.h [new file with mode: 0644]
includes/SpinLock.h [new file with mode: 0644]
includes/Stg.h
includes/StgMiscClosures.h
rts/Exception.cmm
rts/HCIncludes.h [deleted file]
rts/Linker.c
rts/Makefile
rts/PrimOps.cmm
rts/StgCRun.c
rts/StgMiscClosures.cmm
rts/StgRun.h
rts/Typeable.c