[Git][ghc/ghc][master] driver: recognise .dyn_o as a valid object file to link if passed on the command line.
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: bc4b4487 by Zubin Duggal at 2026-04-03T14:22:27-04:00 driver: recognise .dyn_o as a valid object file to link if passed on the command line. This allows plugins compiled with this suffix to run. Fixes #24486 - - - - - 9 changed files: - compiler/GHC/Driver/Phases.hs - testsuite/tests/plugins/Makefile - + testsuite/tests/plugins/T24486-plugin/Makefile - + testsuite/tests/plugins/T24486-plugin/Setup.hs - + testsuite/tests/plugins/T24486-plugin/T24486-plugin.cabal - + testsuite/tests/plugins/T24486-plugin/T24486_Plugin.hs - + testsuite/tests/plugins/T24486.hs - + testsuite/tests/plugins/T24486_Helper.hs - testsuite/tests/plugins/all.T Changes: ===================================== compiler/GHC/Driver/Phases.hs ===================================== @@ -262,7 +262,7 @@ objish_suffixes :: Platform -> [String] -- the GHC-compiled code will run objish_suffixes platform = case platformOS platform of OSMinGW32 -> [ "o", "O", "obj", "OBJ" ] - _ -> [ "o" ] + _ -> [ "o", "dyn_o"] dynlib_suffixes :: Platform -> [String] dynlib_suffixes platform = case platformOS platform of ===================================== testsuite/tests/plugins/Makefile ===================================== @@ -238,3 +238,10 @@ test-late-plugin: .PHONY: T21730 T21730: "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T21730.hs -package-db T21730-plugin/pkg.T21730-plugin/local.package.conf + +# Test that .dyn_o files are accepted as valid object files on the command line +# without producing "ignoring unrecognised input" warnings (#24486) +.PHONY: T24486 +T24486: + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c T24486_Helper.hs -osuf dyn_o + "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T24486.hs T24486_Helper.dyn_o -package-db T24486-plugin/pkg.T24486-plugin/local.package.conf -fplugin T24486_Plugin -plugin-package T24486-plugin ===================================== testsuite/tests/plugins/T24486-plugin/Makefile ===================================== @@ -0,0 +1,18 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +clean.%: + rm -rf pkg.$* + +HERE := $(abspath .) +$(eval $(call canonicalise,HERE)) + +package.%: + $(MAKE) -s --no-print-directory clean.$* + mkdir pkg.$* + "$(TEST_HC)" -outputdir pkg.$* --make -v0 -o pkg.$*/setup Setup.hs + "$(GHC_PKG)" init pkg.$*/local.package.conf + pkg.$*/setup configure --distdir pkg.$*/dist -v0 $(CABAL_PLUGIN_BUILD) --prefix="$(HERE)/pkg.$*/install" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=pkg.$*/local.package.conf $(if $(findstring YES,$(HAVE_PROFILING)), --enable-library-profiling) + pkg.$*/setup build --distdir pkg.$*/dist -v0 + pkg.$*/setup install --distdir pkg.$*/dist -v0 ===================================== testsuite/tests/plugins/T24486-plugin/Setup.hs ===================================== @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain ===================================== testsuite/tests/plugins/T24486-plugin/T24486-plugin.cabal ===================================== @@ -0,0 +1,9 @@ +Name: T24486-plugin +Version: 0.1 +Synopsis: For testing +Cabal-Version: >= 1.2 +Build-Type: Simple + +Library + Build-Depends: base, ghc + Exposed-Modules: T24486_Plugin ===================================== testsuite/tests/plugins/T24486-plugin/T24486_Plugin.hs ===================================== @@ -0,0 +1,6 @@ +module T24486_Plugin (plugin) where + +import GHC.Plugins + +plugin :: Plugin +plugin = defaultPlugin ===================================== testsuite/tests/plugins/T24486.hs ===================================== @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = return () ===================================== testsuite/tests/plugins/T24486_Helper.hs ===================================== @@ -0,0 +1,4 @@ +module T24486_Helper where + +helper :: Int +helper = 42 ===================================== testsuite/tests/plugins/all.T ===================================== @@ -395,3 +395,10 @@ test('T21730', pre_cmd('$MAKE -s --no-print-directory -C T21730-plugin package.T21730-plugin TOP={top}') ], makefile_test, []) + +test('T24486', + [extra_files(['T24486-plugin/', 'T24486_Helper.hs']), + when(opsys('mingw32'), skip), + pre_cmd('$MAKE -s --no-print-directory -C T24486-plugin package.T24486-plugin TOP={top}') + ], + makefile_test, []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bc4b44870d096d43e8cbc530da1fd613... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bc4b44870d096d43e8cbc530da1fd613... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)