David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
-
66b69ea5
by David Eichmann at 2026-07-14T09:58:55+01:00
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:
| ... | ... | @@ -121,7 +121,7 @@ linkDynLib logger tmpfs dflags0 unit_env o_files dep_packages |
| 121 | 121 | , FileOption "" output_fn
|
| 122 | 122 | , Option "-shared"
|
| 123 | 123 | ] ++
|
| 124 | - [ FileOption "-Wl,--out-implib=" (output_fn -<.> ".lib")
|
|
| 124 | + [ FileOption "-Wl,--out-implib=" (output_fn ++ ".a")
|
|
| 125 | 125 | | gopt Opt_SharedImplib dflags
|
| 126 | 126 | ]
|
| 127 | 127 | ++ map (FileOption "") o_files
|
| ... | ... | @@ -226,10 +226,12 @@ copyPackage context@Context {..} = do |
| 226 | 226 | -- TODO Don't do this once cabal is copying .libn files by default
|
| 227 | 227 | -- Copy missing .lib files
|
| 228 | 228 | dir <- Context.buildPath context
|
| 229 | - files <- getDirectoryFiles "." [ dir -/- "*.lib" ]
|
|
| 229 | + files <- getDirectoryFiles "." [ dir -/- "*.dll.a" ]
|
|
| 230 | 230 | libDir <- distDynDir context
|
| 231 | - forM_ files $ \file ->
|
|
| 232 | - copyFile' file (libDir </> takeFileName file)
|
|
| 231 | + forM_ files $ \file -> do
|
|
| 232 | + let fileCopy = libDir </> takeFileName file
|
|
| 233 | + copyFileUntracked file fileCopy
|
|
| 234 | + produces [fileCopy]
|
|
| 233 | 235 | |
| 234 | 236 | |
| 235 | 237 |
| ... | ... | @@ -213,7 +213,7 @@ extraObjects context |
| 213 | 213 | -- ghc-internal's .dll.a file is placed in the RTS build dir and not
|
| 214 | 214 | -- the ghc-internal build dir as we only use it when building the
|
| 215 | 215 | -- RTS and not other libraries.
|
| 216 | - ghcInternalDllName <- takeFileName <$> pkgLibraryFile Context {
|
|
| 216 | + ghcInternalDllName <- pkgLibraryFile Context {
|
|
| 217 | 217 | stage = stage context,
|
| 218 | 218 | way = rtsWayToLibraryWay (way context),
|
| 219 | 219 | iplace = iplace context,
|
| ... | ... | @@ -221,7 +221,7 @@ extraObjects context |
| 221 | 221 | }
|
| 222 | 222 | |
| 223 | 223 | builddir <- buildPath context
|
| 224 | - return [ builddir -/- ghcInternalDllName <.> "lib"]
|
|
| 224 | + return [ builddir -/- ghcInternalDllName <> ".a"]
|
|
| 225 | 225 | |
| 226 | 226 | | otherwise = return []
|
| 227 | 227 |
| ... | ... | @@ -14,7 +14,7 @@ rtsRules = priority 3 $ do |
| 14 | 14 | forM_ [Stage1, Stage2, Stage3 ] $ \ stage -> do
|
| 15 | 15 | let buildPath = root -/- buildDir (rtsContext stage)
|
| 16 | 16 | buildPath -/- "libHSghc-internal-*.def" %> buildGhcInternalImportDef
|
| 17 | - buildPath -/- "libHSghc-internal-*.lib" %> buildGhcInternalImportLib
|
|
| 17 | + buildPath -/- "libHSghc-internal-*.dll.a" %> buildGhcInternalImportLib
|
|
| 18 | 18 | |
| 19 | 19 | buildGhcInternalImportDef :: FilePath -> Action ()
|
| 20 | 20 | buildGhcInternalImportDef target = do
|
| ... | ... | @@ -26,6 +26,6 @@ buildGhcInternalImportDef target = do |
| 26 | 26 | buildGhcInternalImportLib :: FilePath -> Action ()
|
| 27 | 27 | buildGhcInternalImportLib target = do
|
| 28 | 28 | let input = dropExtension (dropExtension target) <.> "def" -- the .def file
|
| 29 | - output = target -- the .lib import lib
|
|
| 29 | + output = target -- the .dll.a import lib
|
|
| 30 | 30 | need [input]
|
| 31 | 31 | runBuilder Dlltool ["-d", input, "-l", output] [input] [output] |
| 1 | -Subproject commit 9c92f635c0f15c6e3f4f276770d35cf4fdac19d0 |
|
| 1 | +Subproject commit d9637d1b2e94bfff8e9aa9366fc4447dcc2ca4a8 |
| ... | ... | @@ -2058,8 +2058,8 @@ checkHSLib _verbosity dirs lib = do |
| 2058 | 2058 | "lib" ++ lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".so",
|
| 2059 | 2059 | "lib" ++ lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dylib",
|
| 2060 | 2060 | "lib" ++ lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dylib",
|
| 2061 | - lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".lib",
|
|
| 2062 | - lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".lib",
|
|
| 2061 | + lib ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dll.a",
|
|
| 2062 | + lib ++ "_p" ++ "-ghc" ++ GHC.Version.cProjectVersion ++ ".dll.a",
|
|
| 2063 | 2063 | lib ++ ".bytecodelib"
|
| 2064 | 2064 | ]
|
| 2065 | 2065 | b <- liftIO $ doesFileExistOnPath filenames dirs
|