Commit 2b27cc16 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

Properly account for libdw paths in make build system

Should finally fix #17255.
parent cd40e12a
Pipeline #12958 canceled with stages
...@@ -207,6 +207,7 @@ rtsPackageArgs = package rts ? do ...@@ -207,6 +207,7 @@ rtsPackageArgs = package rts ? do
[ arg "-Irts" [ arg "-Irts"
, arg $ "-I" ++ path , arg $ "-I" ++ path
, flag WithLibdw ? if not (null libdwIncludeDir) then arg ("-I" ++ libdwIncludeDir) else mempty , 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 ++ "\"" , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\""
-- Set the namespace for the rts fs functions -- Set the namespace for the rts fs functions
, arg $ "-DFS_NAMESPACE=rts" , arg $ "-DFS_NAMESPACE=rts"
...@@ -222,6 +223,7 @@ rtsPackageArgs = package rts ? do ...@@ -222,6 +223,7 @@ rtsPackageArgs = package rts ? do
let cArgs = mconcat let cArgs = mconcat
[ rtsWarnings [ rtsWarnings
, flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir) , flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir)
, flag WithLibdw ? arg ("-I" ++ libdwIncludeDir)
, arg "-fomit-frame-pointer" , arg "-fomit-frame-pointer"
-- RTS *must* be compiled with optimisations. The INLINE_HEADER macro -- RTS *must* be compiled with optimisations. The INLINE_HEADER macro
-- requires that functions are inlined to work as expected. Inlining -- requires that functions are inlined to work as expected. Inlining
...@@ -319,13 +321,14 @@ rtsPackageArgs = package rts ? do ...@@ -319,13 +321,14 @@ rtsPackageArgs = package rts ? do
, builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs , builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs
, builder Ghc ? ghcArgs , builder Ghc ? ghcArgs
, builder HsCpp ? pure , builder HsCpp ? pure
[ "-DTOP=" ++ show top [ "-DTOP=" ++ show top
, "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir , "-DFFI_INCLUDE_DIR=" ++ show ffiIncludeDir
, "-DFFI_LIB_DIR=" ++ show ffiLibraryDir , "-DFFI_LIB_DIR=" ++ show ffiLibraryDir
, "-DFFI_LIB=" ++ show libffiName , "-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" ] , builder HsCpp ? flag HaveLibMingwEx ? arg "-DHAVE_LIBMINGWEX" ]
-- Compile various performance-critical pieces *without* -fPIC -dynamic -- Compile various performance-critical pieces *without* -fPIC -dynamic
......
...@@ -363,6 +363,7 @@ UseSystemLibFFI=@UseSystemLibFFI@ ...@@ -363,6 +363,7 @@ UseSystemLibFFI=@UseSystemLibFFI@
FFILibDir=@FFILibDir@ FFILibDir=@FFILibDir@
FFIIncludeDir=@FFIIncludeDir@ FFIIncludeDir=@FFIIncludeDir@
UseLibdw=@UseLibdw@
LibdwLibDir=@LibdwLibDir@ LibdwLibDir=@LibdwLibDir@
LibdwIncludeDir=@LibdwIncludeDir@ LibdwIncludeDir=@LibdwIncludeDir@
......
...@@ -544,8 +544,10 @@ rts_PACKAGE_CPP_OPTS += '-DFFI_LIB="C$(LIBFFI_NAME)"' ...@@ -544,8 +544,10 @@ rts_PACKAGE_CPP_OPTS += '-DFFI_LIB="C$(LIBFFI_NAME)"'
endif endif
ifeq "$(UseLibdw)" "YES" ifeq "$(UseLibdw)" "YES"
rts_PACKAGE_CPP_OPTS += -DLIBDW_INCLUDE_DIR=$(LibdwIncludeDir)
rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=$(LibdwLibDir) rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=$(LibdwLibDir)
else else
rts_PACKAGE_CPP_OPTS += -DLIBDW_INCLUDE_DIR=
rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR= rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=
endif endif
......
...@@ -67,7 +67,12 @@ extra-libraries: ...@@ -67,7 +67,12 @@ extra-libraries:
#if defined(INSTALLING) #if defined(INSTALLING)
include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR
#else /* !INSTALLING */ #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 #endif
includes: Stg.h includes: Stg.h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment