summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Steuck <greg@nest.cx>2021-12-18 15:40:47 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-21 01:47:55 -0500
commitf92c9c0d40d0cd5efe2bc08dbfbf02cf7bc2ed3e (patch)
tree1bd17950f9b558c8b1a3a07b89ec3378735274bd
parent9bc5ab64de16f786ede145755d52f5452af453f9 (diff)
downloadhaskell-f92c9c0d40d0cd5efe2bc08dbfbf02cf7bc2ed3e.tar.gz
Only use -ldl conditionally to fix T3807
OpenBSD doesn't have this library and so the linker complains: ld.lld: error: unable to find library -ldl
-rw-r--r--testsuite/mk/boilerplate.mk6
-rw-r--r--testsuite/tests/dynlibs/Makefile2
2 files changed, 7 insertions, 1 deletions
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk
index 2f5c23bc0c..9b66ee1d1e 100644
--- a/testsuite/mk/boilerplate.mk
+++ b/testsuite/mk/boilerplate.mk
@@ -303,3 +303,9 @@ LIBCXX_PLATFORM = YES
else
LIBCXX_PLATFORM = NO
endif
+ifeq "$(HostOS)" "openbsd"
+# None required, dlopen and the like are in libc.
+LIBDL_NAME =
+else
+LIBDL_NAME = -ldl
+endif
diff --git a/testsuite/tests/dynlibs/Makefile b/testsuite/tests/dynlibs/Makefile
index 3de7571f27..f557a1238a 100644
--- a/testsuite/tests/dynlibs/Makefile
+++ b/testsuite/tests/dynlibs/Makefile
@@ -15,7 +15,7 @@ T3807:
# when linking an executable).
# Hence we must explicitly linking with the RTS here.
'$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 --make -dynamic -fPIC -shared T3807Export.hs T3807-export.c -o T3807test.so -flink-rts
- '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -no-auto-link-packages -no-hs-main T3807-load.c -o T3807-load -ldl
+ '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -no-auto-link-packages -no-hs-main T3807-load.c -o T3807-load $(LIBDL_NAME)
./T3807-load
.PHONY: T4464dyn