David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC Commits: 36667d05 by David Eichmann at 2026-07-13T16:14:02+01:00 WIP link haskell libs via import library - - - - - 6 changed files: - compiler/GHC/Linker/Dynamic.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - hadrian/src/Rules/Library.hs - hadrian/src/Rules/Rts.hs - libraries/Cabal - utils/ghc-pkg/Main.hs Changes: ===================================== compiler/GHC/Linker/Dynamic.hs ===================================== @@ -121,7 +121,7 @@ linkDynLib logger tmpfs dflags0 unit_env o_files dep_packages , FileOption "" output_fn , Option "-shared" ] ++ - [ FileOption "-Wl,--out-implib=" (output_fn ++ ".a") + [ FileOption "-Wl,--out-implib=" (output_fn -<.> ".lib") | gopt Opt_SharedImplib dflags ] ++ map (FileOption "") o_files ===================================== hadrian/src/Hadrian/Haskell/Cabal/Parse.hs ===================================== @@ -222,6 +222,17 @@ copyPackage context@Context {..} = do C.defaultMainWithHooksNoReadArgs C.autoconfUserHooks gpd [ "copy", "--builddir", ctxPath, "--target-package-db", pkgDbPath, v ] + -- TODO This is windows only + -- TODO Don't do this once cabal is copying .libn files by default + -- Copy missing .lib files + dir <- Context.buildPath context + files <- getDirectoryFiles "." [ dir -/- "*.lib" ] + libDir <- distDynDir context + forM_ files $ \file -> + copyFile' file (libDir </> takeFileName file) + + + shakeVerbosityToCabalFlag :: Verbosity -> String shakeVerbosityToCabalFlag = \case Diagnostic -> "-v3" ===================================== hadrian/src/Rules/Library.hs ===================================== @@ -221,7 +221,7 @@ extraObjects context } builddir <- buildPath context - return [ builddir -/- ghcInternalDllName <> ".a"] + return [ builddir -/- ghcInternalDllName <.> "lib"] | otherwise = return [] ===================================== hadrian/src/Rules/Rts.hs ===================================== @@ -14,7 +14,7 @@ rtsRules = priority 3 $ do forM_ [Stage1, Stage2, Stage3 ] $ \ stage -> do let buildPath = root -/- buildDir (rtsContext stage) buildPath -/- "libHSghc-internal-*.def" %> buildGhcInternalImportDef - buildPath -/- "libHSghc-internal-*.dll.a" %> buildGhcInternalImportLib + buildPath -/- "libHSghc-internal-*.lib" %> buildGhcInternalImportLib buildGhcInternalImportDef :: FilePath -> Action () buildGhcInternalImportDef target = do @@ -26,6 +26,6 @@ buildGhcInternalImportDef target = do buildGhcInternalImportLib :: FilePath -> Action () buildGhcInternalImportLib target = do let input = dropExtension (dropExtension target) <.> "def" -- the .def file - output = target -- the .dll.a import lib + output = target -- the .lib import lib need [input] runBuilder Dlltool ["-d", input, "-l", output] [input] [output] ===================================== libraries/Cabal ===================================== @@ -1 +1 @@ -Subproject commit 8d1f5a33662be0db0654061fb53fb00e3f4417e0 +Subproject commit 9c92f635c0f15c6e3f4f276770d35cf4fdac19d0 ===================================== utils/ghc-pkg/Main.hs ===================================== @@ -2058,8 +2058,8 @@ checkHSLib _verbosity dirs lib = do "lib" ++ lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".so", "lib" ++ lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dylib", "lib" ++ lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dylib", - lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dll", - lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dll", + lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".lib", + lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".lib", lib ++ ".bytecodelib" ] b <- liftIO $ doesFileExistOnPath filenames dirs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/36667d05e63f1723bd852a1709a0d976... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/36667d05e63f1723bd852a1709a0d976... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help