summaryrefslogtreecommitdiff
path: root/rts/Makefile
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2008-04-02 05:14:12 +0000
committerSimon Marlow <simonmar@microsoft.com>2008-04-02 05:14:12 +0000
commitc245355e6f2c7b7c95e9af910c4d420e13af9413 (patch)
treee8309f467b8bea2501e9f7de7af86fbfc22e0a67 /rts/Makefile
parentab5c770bed51f08d56a0d61086988053b21aa461 (diff)
downloadhaskell-c245355e6f2c7b7c95e9af910c4d420e13af9413.tar.gz
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.
Diffstat (limited to 'rts/Makefile')
-rw-r--r--rts/Makefile10
1 files changed, 3 insertions, 7 deletions
diff --git a/rts/Makefile b/rts/Makefile
index 2a20279382..6fb168824a 100644
--- a/rts/Makefile
+++ b/rts/Makefile
@@ -152,6 +152,8 @@ SRC_CC_OPTS += $(STANDARD_OPTS)
SRC_CC_OPTS += $(GhcRtsCcOpts)
SRC_HC_OPTS += $(GhcRtsHcOpts) $(STANDARD_OPTS) -package-name rts
+SRC_HC_OPTS += -fvia-C
+
ifneq "$(GhcWithSMP)" "YES"
SRC_CC_OPTS += -DNOSMP
SRC_HC_OPTS += -optc-DNOSMP
@@ -366,13 +368,7 @@ endif
# Compiling the cmm files
# ToDo: should we really include Rts.h here? Required for GNU_ATTRIBUTE().
-SRC_HC_OPTS += -I. -\#include HCIncludes.h
-
-ifeq "$(Windows)" "YES"
-PrimOps_HC_OPTS += -\#include '<windows.h>' -\#include win32/AsyncIO.h
-else
-PrimOps_HC_OPTS += -\#include posix/Itimer.h
-endif
+SRC_HC_OPTS += -I.
# Otherwise the stack-smash handler gets triggered.
ifeq "$(TargetOS_CPP)" "openbsd"