summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-11-22 11:26:28 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-11-22 11:26:28 +0000
commitd681f8700ad2c034d5b9dacf4e681b8e7279f6ee (patch)
treec808d7d5e623679e13b67d8e82d46ebbb0130005 /includes
parenta5762b71d1aaf9037d14fc706bb04976a231bf22 (diff)
parent6247b59e5d31de58ee51273916bc44ac2118240a (diff)
downloadhaskell-d681f8700ad2c034d5b9dacf4e681b8e7279f6ee.tar.gz
merge
Diffstat (limited to 'includes')
-rw-r--r--includes/Stg.h5
-rw-r--r--includes/ghc.mk4
2 files changed, 8 insertions, 1 deletions
diff --git a/includes/Stg.h b/includes/Stg.h
index cae4a3a4aa..1791795a0a 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -49,7 +49,10 @@
# define _BSD_SOURCE
#endif
-#if IN_STG_CODE == 0
+#if IN_STG_CODE == 0 || defined(llvm_CC_FLAVOR)
+// C compilers that use an LLVM back end (clang or llvm-gcc) do not
+// correctly support global register variables so we make sure that
+// we do not declare them for these compilers.
# define NO_GLOBAL_REG_DECLS /* don't define fixed registers */
#endif
diff --git a/includes/ghc.mk b/includes/ghc.mk
index 54f613933e..7c2aac52cf 100644
--- a/includes/ghc.mk
+++ b/includes/ghc.mk
@@ -104,6 +104,10 @@ endif
@echo "#define $(TargetVendor_CPP)_HOST_VENDOR 1" >> $@
@echo "#define BUILD_VENDOR \"$(HostVendor_CPP)\"" >> $@
@echo "#define HOST_VENDOR \"$(TargetVendor_CPP)\"" >> $@
+ifeq "$(CC_LLVM_BACKEND)" "1"
+ @echo >> $@
+ @echo "#define llvm_CC_FLAVOR 1" >> $@
+endif
@echo >> $@
@echo "/* These TARGET macros are for backwards compatibily... DO NOT USE! */" >> $@
@echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@