summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-03-06 23:31:40 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2021-03-07 22:19:24 +0800
commit820b0766984d42c06c977a6c32da75c429106f7f (patch)
treebb7d404f42010c5b392c5ba2932357dea4d60f00
parent347058430f9f7f9b15f1eaa003610b3438edc404 (diff)
downloadhaskell-820b0766984d42c06c977a6c32da75c429106f7f.tar.gz
[darwin] stop the DYLD_LIBRARY_PATH madness
this causes *significant* slowdown on macOS as the linker ends up looking through all the paths. Slowdown can be as bad as 100% or more.
-rw-r--r--rules/library-path.mk7
-rw-r--r--testsuite/driver/runtests.py7
2 files changed, 5 insertions, 9 deletions
diff --git a/rules/library-path.mk b/rules/library-path.mk
index 9a398eebf0..92511f2c94 100644
--- a/rules/library-path.mk
+++ b/rules/library-path.mk
@@ -13,9 +13,8 @@
# $1 = paths to prepend
ifeq "$(TargetOS_CPP)" "mingw32"
prependLibraryPath = $(error Do not know how to prependLibraryPath on Windows)
-else ifeq "$(TargetOS_CPP)" "darwin"
-prependLibraryPath = export DYLD_LIBRARY_PATH="$1$${DYLD_LIBRARY_PATH:+:$$DYLD_LIBRARY_PATH}"
-else
+else ifneq "$(TargetOS_CPP)" "darwin"
prependLibraryPath = export LD_LIBRARY_PATH="$1$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}"
+else
+prependLibraryPath =
endif
-
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 5ef6ca27bf..5f059e58d4 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -238,7 +238,7 @@ def format_path(path):
# On Windows we need to set $PATH to include the paths to all the DLLs
# in order for the dynamic library tests to work.
-if windows or darwin:
+if windows:
pkginfo = getStdout([config.ghc_pkg, 'dump'])
topdir = config.libdir
if windows:
@@ -256,12 +256,9 @@ if windows or darwin:
if path.startswith('"'):
path = re.sub('^"(.*)"$', '\\1', path)
path = re.sub('\\\\(.)', '\\1', path)
- if windows:
+
path = format_path(path)
ghc_env['PATH'] = os.pathsep.join([path, ghc_env.get("PATH", "")])
- else:
- # darwin
- ghc_env['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, ghc_env.get("DYLD_LIBRARY_PATH", "")])
testopts_local.x = TestOptions()