summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-11 18:49:09 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-19 11:56:21 -0500
commit2b27cc164ae5a978a8abd9966d04af74628a5396 (patch)
treef3d65422664b92428897ce2331b6097a10959fa8
parentcd40e12ad8072c6b881c6bb650e39e4d29c9718c (diff)
downloadhaskell-2b27cc164ae5a978a8abd9966d04af74628a5396.tar.gz
Properly account for libdw paths in make build system
Should finally fix #17255.
-rw-r--r--hadrian/src/Settings/Packages.hs7
-rw-r--r--mk/config.mk.in1
-rw-r--r--rts/ghc.mk2
-rw-r--r--rts/package.conf.in7
4 files changed, 14 insertions, 3 deletions
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 4d399ca9f0..b0e012d31e 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -207,6 +207,7 @@ rtsPackageArgs = package rts ? do
[ arg "-Irts"
, arg $ "-I" ++ path
, flag WithLibdw ? if not (null libdwIncludeDir) then arg ("-I" ++ libdwIncludeDir) else mempty
+ , flag WithLibdw ? if not (null libdwLibraryDir) then arg ("-L" ++ libdwLibraryDir) else mempty
, arg $ "-DRtsWay=\"rts_" ++ show way ++ "\""
-- Set the namespace for the rts fs functions
, arg $ "-DFS_NAMESPACE=rts"
@@ -222,6 +223,7 @@ rtsPackageArgs = package rts ? do
let cArgs = mconcat
[ rtsWarnings
, flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir)
+ , flag WithLibdw ? arg ("-I" ++ libdwIncludeDir)
, arg "-fomit-frame-pointer"
-- RTS *must* be compiled with optimisations. The INLINE_HEADER macro
-- requires that functions are inlined to work as expected. Inlining
@@ -319,13 +321,14 @@ rtsPackageArgs = package rts ? do
, builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs
, builder Ghc ? ghcArgs
- , builder HsCpp ? pure
+ , builder HsCpp ? pure
[ "-DTOP=" ++ show top
, "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir
, "-DFFI_LIB_DIR=" ++ show ffiLibraryDir
, "-DFFI_LIB=" ++ show libffiName
- , "-DLIBDW_LIB_DIR=" ++ show libdwLibraryDir ]
+ , "-DLIBDW_LIB_DIR=" ++ show libdwLibraryDir ]
+ , builder HsCpp ? flag WithLibdw ? arg "-DUSE_LIBDW"
, builder HsCpp ? flag HaveLibMingwEx ? arg "-DHAVE_LIBMINGWEX" ]
-- Compile various performance-critical pieces *without* -fPIC -dynamic
diff --git a/mk/config.mk.in b/mk/config.mk.in
index eff6b366e9..41cd71ca1f 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -363,6 +363,7 @@ UseSystemLibFFI=@UseSystemLibFFI@
FFILibDir=@FFILibDir@
FFIIncludeDir=@FFIIncludeDir@
+UseLibdw=@UseLibdw@
LibdwLibDir=@LibdwLibDir@
LibdwIncludeDir=@LibdwIncludeDir@
diff --git a/rts/ghc.mk b/rts/ghc.mk
index f25f2f9b75..dfff8df796 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -544,8 +544,10 @@ rts_PACKAGE_CPP_OPTS += '-DFFI_LIB="C$(LIBFFI_NAME)"'
endif
ifeq "$(UseLibdw)" "YES"
+rts_PACKAGE_CPP_OPTS += -DLIBDW_INCLUDE_DIR=$(LibdwIncludeDir)
rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=$(LibdwLibDir)
else
+rts_PACKAGE_CPP_OPTS += -DLIBDW_INCLUDE_DIR=
rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=
endif
diff --git a/rts/package.conf.in b/rts/package.conf.in
index 93b664ae61..e4cb159cb8 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -67,7 +67,12 @@ extra-libraries:
#if defined(INSTALLING)
include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR
#else /* !INSTALLING */
-include-dirs: TOP"/rts/dist/build" TOP"/includes" TOP"/includes/dist-derivedconstants/header" FFI_INCLUDE_DIR TOP"/includes/dist-install/build"
+include-dirs: TOP"/rts/dist/build"
+ TOP"/includes"
+ TOP"/includes/dist-derivedconstants/header"
+ FFI_INCLUDE_DIR
+ LIBDW_INCLUDE_DIR
+ TOP"/includes/dist-install/build"
#endif
includes: Stg.h