summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/ghci/Linker.hs11
-rw-r--r--rules/build-package-way.mk4
2 files changed, 6 insertions, 9 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index 32bf270abd..3f4264cf48 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -1469,13 +1469,8 @@ locateLib hsc_env is_hs lib_dirs gcc_dirs lib
findDynObject `orElse`
assumeDll
- | loading_profiled_hs_libs -- only a libHSfoo_p.a archive will do.
- = findArchive `orElse`
- assumeDll
-
| otherwise
- -- HSfoo.o is the best, but only works for the normal way
- -- libHSfoo.a is the backup option.
+ -- use HSfoo.{o,p_o} if it exists, otherwise fallback to libHSfoo{,_p}.a
= findObject `orElse`
findArchive `orElse`
assumeDll
@@ -1486,7 +1481,9 @@ locateLib hsc_env is_hs lib_dirs gcc_dirs lib
gcc = False
user = True
- obj_file = lib <.> "o"
+ obj_file
+ | is_hs && loading_profiled_hs_libs = lib <.> "p_o"
+ | otherwise = lib <.> "o"
dyn_obj_file = lib <.> "dyn_o"
arch_files = [ "lib" ++ lib ++ lib_tag <.> "a"
, lib <.> "a" -- native code has no lib_tag
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 8d14b7a3e2..0a762d385a 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -112,7 +112,7 @@ endif
endif
# Build the GHCi library
-ifeq "$3" "v"
+ifneq "$(filter $3, v p)" ""
$1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf)
ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
# Don't put bootstrapping packages in the bindist
@@ -132,7 +132,7 @@ ifneq "$4" "0"
$(call all-target,$1_$2,$$($1_$2_GHCI_LIB))
endif
endif # "$$($1_$2_BUILD_GHCI_LIB)" "YES"
-endif # "$3" "v"
+endif # "$(filter $3, v p)" ""
$(call profEnd, build-package-way($1,$2,$3))
endef # build-package-way