summaryrefslogtreecommitdiff
path: root/testsuite/tests/plugins/Makefile
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-09-10 10:52:37 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-08 13:08:16 -0400
commit3d31f11e83a3d60d17459457e036ae387fc95323 (patch)
tree86def0d3861e72c25688fd28f761bdaa7dc19b67 /testsuite/tests/plugins/Makefile
parent01f5324f8eaa2ce28d617922bc4d3b680ad4fc38 (diff)
downloadhaskell-3d31f11e83a3d60d17459457e036ae387fc95323.tar.gz
Don't link plugins' units with target code (#20218)
Before this patch, plugin units were linked with the target code even when the unit was passed via `-plugin-package`. This is an issue to support plugins in cross-compilers (plugins are definitely not ABI compatible with target code). We now clearly separate unit dependencies for plugins and unit dependencies for target code and only link the latter ones. We've also added a test to ensure that plugin units passed via `-package` are linked with target code so that `thNameToGhcName` can still be used in plugins that need it (see T20218b).
Diffstat (limited to 'testsuite/tests/plugins/Makefile')
-rw-r--r--testsuite/tests/plugins/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile
index 710cf827ec..c00b26684b 100644
--- a/testsuite/tests/plugins/Makefile
+++ b/testsuite/tests/plugins/Makefile
@@ -152,3 +152,14 @@ plugin-recomp-change-2:
T20417:
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 plugin-recomp-test.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -hide-all-packages -package base -plugin-package plugin-recompilation-0.1 -fplugin PurePlugin
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 plugin-recomp-test.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -hide-all-packages -package base -plugin-package plugin-recompilation-0.1 -fplugin PurePlugin
+
+# Test that we don't link plugin with target code
+.PHONY: T20218
+T20218:
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v4 T20218.hs -package-db simple-plugin/pkg.T20218/local.package.conf -fplugin Simple.Plugin -plugin-package simple-plugin
+
+# T20218b tests that we correctly link with plugins passed with -package
+.PHONY: T20218b
+T20218b:
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) T20218b.hs -package-db simple-plugin/pkg.T20218b/local.package.conf -fplugin Simple.ReplacePlugin -package simple-plugin -v0
+ ./T20218b