summaryrefslogtreecommitdiff
path: root/compiler/ghc.mk
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-09-16 11:49:24 -0400
committerBen Gamari <ben@smart-cactus.org>2016-09-16 11:49:25 -0400
commitea310f9956179f91ca973bc747b0bc7b061bc174 (patch)
tree0f32a6b60091c6a53f9303cbce166ef81493e58a /compiler/ghc.mk
parent97b47d277d6b0ced3ce73175f78b23ecff84cfa3 (diff)
downloadhaskell-ea310f9956179f91ca973bc747b0bc7b061bc174.tar.gz
Remove directories from include paths
Previously this was a relative path which worked in the GHC tree, but failed elsewhere. This caused trouble for out-of-tree users as well as Hadrian, which wants to move build artifacts out of the working directory. Fixes #8040. Test Plan: Validate Reviewers: thomie, austin, snowleopard, hvr Reviewed By: snowleopard, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2530 GHC Trac Issues: #8040
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r--compiler/ghc.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 5aeda53d91..38eae0eee1 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -259,6 +259,11 @@ PRIMOP_BITS_STAGE3 = $(addprefix compiler/stage3/build/,$(PRIMOP_BITS_NAMES))
compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
compiler_CPP_OPTS += ${GhcCppOpts}
+# We add these paths to the Haskell compiler's #include search path list since
+# we must avoid #including files by paths relative to the source file as Hadrian
+# moves the build artifacts out of the source tree. See #8040.
+compiler_HC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
+
define preprocessCompilerFiles
# $0 = stage
compiler/stage$1/build/primops.txt: compiler/prelude/primops.txt.pp compiler/stage$1/$$(PLATFORM_H)