[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
52d13056 by David Eichmann at 2026-06-29T18:31:10+01:00
WIP export-all-symbols from hadrian
- - - - -
16 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 739ceeb77746a97fea82d8dce7165de658993b08
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -167,6 +168,7 @@ BOOL file_exists(LPCTSTR path)
}
/* If true then caller needs to free tempFileName. */
+__attribute__((dllexport))
bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix,
wchar_t* suffix, wchar_t** tempFileName)
{
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -747,8 +747,12 @@ foreign import capi unsafe "HsBase.h _unlink"
foreign import capi unsafe "HsBase.h _utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
+
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import capi unsafe "HsBase.h _getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#else
-- We use CAPI as on some OSs (eg. Linux) this is wrapped by a macro
-- which redirects to the 64-bit-off_t versions when large file
@@ -833,8 +837,11 @@ foreign import capi unsafe "HsBase.h utime"
c_getpid :: IO CPid
c_getpid = pure 1
#else
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import ccall unsafe "HsBase.h getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#endif
#endif
@@ -924,7 +931,10 @@ foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_rdwr" o_RDWR :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_append" o_APPEND :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_creat" o_CREAT :: CInt
-foreign import ccall unsafe "HsBase.h __hscore_o_excl" o_EXCL :: CInt
+{-# NOINLINE o_EXCL #-}
+o_EXCL :: CInt
+o_EXCL = _o_EXCL
+foreign import ccall unsafe "HsBase.h __hscore_o_excl" _o_EXCL :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_trunc" o_TRUNC :: CInt
-- non-POSIX flags.
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -212,13 +212,19 @@ failUnlessSuccessOr val fn_name act = do
-- by @GetLastError@.
-- | Map the last system error to an errno value, and assign it to @errno@.
+{-# NOINLINE c_maperrno #-}
+c_maperrno :: IO ()
+c_maperrno = _c_maperrno
foreign import ccall unsafe "maperrno" -- in Win32Utils.c
- c_maperrno :: IO ()
+ _c_maperrno :: IO ()
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52d13056cf191406db8b43230b76a05…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52d13056cf191406db8b43230b76a05…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
280b69d9 by David Eichmann at 2026-06-29T18:25:27+01:00
WIP export-all-symbols from hadrian
- - - - -
16 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 739ceeb77746a97fea82d8dce7165de658993b08
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -167,6 +168,7 @@ BOOL file_exists(LPCTSTR path)
}
/* If true then caller needs to free tempFileName. */
+__attribute__((dllexport))
bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix,
wchar_t* suffix, wchar_t** tempFileName)
{
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -747,8 +747,12 @@ foreign import capi unsafe "HsBase.h _unlink"
foreign import capi unsafe "HsBase.h _utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
+
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import capi unsafe "HsBase.h _getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#else
-- We use CAPI as on some OSs (eg. Linux) this is wrapped by a macro
-- which redirects to the 64-bit-off_t versions when large file
@@ -833,8 +837,11 @@ foreign import capi unsafe "HsBase.h utime"
c_getpid :: IO CPid
c_getpid = pure 1
#else
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import ccall unsafe "HsBase.h getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#endif
#endif
@@ -924,7 +931,10 @@ foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_rdwr" o_RDWR :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_append" o_APPEND :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_creat" o_CREAT :: CInt
-foreign import ccall unsafe "HsBase.h __hscore_o_excl" o_EXCL :: CInt
+{-# NOINLINE o_EXCL #-}
+o_EXCL :: CInt
+o_EXCL = _o_EXCL
+foreign import ccall unsafe "HsBase.h __hscore_o_excl" _o_EXCL :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_trunc" o_TRUNC :: CInt
-- non-POSIX flags.
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/280b69d9e1697a3765ea213a97533b1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/280b69d9e1697a3765ea213a97533b1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
2d2b3c0a by David Eichmann at 2026-06-29T18:24:44+01:00
WIP export-all-symbols from hadrian
- - - - -
16 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -167,6 +168,7 @@ BOOL file_exists(LPCTSTR path)
}
/* If true then caller needs to free tempFileName. */
+__attribute__((dllexport))
bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix,
wchar_t* suffix, wchar_t** tempFileName)
{
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -747,8 +747,12 @@ foreign import capi unsafe "HsBase.h _unlink"
foreign import capi unsafe "HsBase.h _utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
+
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import capi unsafe "HsBase.h _getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#else
-- We use CAPI as on some OSs (eg. Linux) this is wrapped by a macro
-- which redirects to the 64-bit-off_t versions when large file
@@ -833,8 +837,11 @@ foreign import capi unsafe "HsBase.h utime"
c_getpid :: IO CPid
c_getpid = pure 1
#else
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import ccall unsafe "HsBase.h getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#endif
#endif
@@ -924,7 +931,10 @@ foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_rdwr" o_RDWR :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_append" o_APPEND :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_creat" o_CREAT :: CInt
-foreign import ccall unsafe "HsBase.h __hscore_o_excl" o_EXCL :: CInt
+{-# NOINLINE o_EXCL #-}
+o_EXCL :: CInt
+o_EXCL = _o_EXCL
+foreign import ccall unsafe "HsBase.h __hscore_o_excl" _o_EXCL :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_trunc" o_TRUNC :: CInt
-- non-POSIX flags.
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d2b3c0aa0ee9191bcf211248a794e3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d2b3c0aa0ee9191bcf211248a794e3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
83e2ff93 by David Eichmann at 2026-06-29T18:20:55+01:00
WIP export-all-symbols from hadrian
- - - - -
16 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -167,6 +168,7 @@ BOOL file_exists(LPCTSTR path)
}
/* If true then caller needs to free tempFileName. */
+__attribute__((dllexport))
bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix,
wchar_t* suffix, wchar_t** tempFileName)
{
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -747,8 +747,12 @@ foreign import capi unsafe "HsBase.h _unlink"
foreign import capi unsafe "HsBase.h _utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
+
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import capi unsafe "HsBase.h _getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#else
-- We use CAPI as on some OSs (eg. Linux) this is wrapped by a macro
-- which redirects to the 64-bit-off_t versions when large file
@@ -833,8 +837,11 @@ foreign import capi unsafe "HsBase.h utime"
c_getpid :: IO CPid
c_getpid = pure 1
#else
+{-# NOINLINE c_getpid #-}
+c_getpid :: IO CPid
+c_getpid = _c_getpid
foreign import ccall unsafe "HsBase.h getpid"
- c_getpid :: IO CPid
+ _c_getpid :: IO CPid
#endif
#endif
@@ -924,7 +931,10 @@ foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_rdwr" o_RDWR :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_append" o_APPEND :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_creat" o_CREAT :: CInt
-foreign import ccall unsafe "HsBase.h __hscore_o_excl" o_EXCL :: CInt
+{-# NOINLINE o_EXCL #-}
+o_EXCL :: CInt
+o_EXCL = _o_EXCL
+foreign import ccall unsafe "HsBase.h __hscore_o_excl" _o_EXCL :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_trunc" o_TRUNC :: CInt
-- non-POSIX flags.
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/83e2ff9368561c89309aa4680b3c04e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/83e2ff9368561c89309aa4680b3c04e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
1811296f by David Eichmann at 2026-06-29T17:53:05+01:00
WIP export-all-symbols from hadrian
- - - - -
16 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -924,7 +924,10 @@ foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_rdwr" o_RDWR :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_append" o_APPEND :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_creat" o_CREAT :: CInt
-foreign import ccall unsafe "HsBase.h __hscore_o_excl" o_EXCL :: CInt
+{-# NOINLINE o_EXCL #-}
+o_EXCL :: CInt
+o_EXCL = _o_EXCL
+foreign import ccall unsafe "HsBase.h __hscore_o_excl" _o_EXCL :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_trunc" o_TRUNC :: CInt
-- non-POSIX flags.
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1811296fa7712b9868707d26dcd2dc9…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1811296fa7712b9868707d26dcd2dc9…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
9e2ed034 by David Eichmann at 2026-06-29T17:51:23+01:00
WIP export-all-symbols from hadrian
- - - - -
15 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/file-io
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/file-io
=====================================
@@ -1 +1 @@
-Subproject commit 21303160b5dd91d6197bd1d20a8796ba2a819d4e
+Subproject commit ea36fd962360bef588366b04609c2adc2c82eec7
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/System/IO.hs
=====================================
@@ -738,7 +738,10 @@ openTempFile' loc tmp_dir template binary mode
foreign import ccall "getTempFileNameErrorNo" c_getTempFileNameErrorNo
:: CWString -> CWString -> CWString -> CUInt -> Ptr CWchar -> IO Bool
-foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
+{-# NOINLINE c_createUUIDTempFileErrNo #-}
+c_createUUIDTempFileErrNo :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
+c_createUUIDTempFileErrNo = _c_createUUIDTempFileErrNo
+foreign import ccall "__createUUIDTempFileErrNo" _c_createUUIDTempFileErrNo
:: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool
pathSeparator :: String -> Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e2ed03442cafb3b5ca841c27ac5b4a…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e2ed03442cafb3b5ca841c27ac5b4a…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
8797a736 by David Eichmann at 2026-06-29T17:46:12+01:00
WIP export-all-symbols from hadrian
- - - - -
13 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
- libraries/text
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 423fd981e576bd17a8b5fa48d0ad6b9a0c370e77
+Subproject commit a1e9d389911eb613f2951364b9203be92ebc3cfa
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8797a736fcf69feeee64ab612d9a2cb…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8797a736fcf69feeee64ab612d9a2cb…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
6ac9aee9 by David Eichmann at 2026-06-29T17:41:31+01:00
WIP export-all-symbols from hadrian
- - - - -
12 changed files:
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/ghc-internal/cbits/Win32Utils.c
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/ghc-internal/cbits/Win32Utils.c
=====================================
@@ -138,6 +138,7 @@ LPWSTR base_getErrorMessage(DWORD err)
return what;
}
+__attribute__((dllexport))
int get_unique_file_info_hwnd(HANDLE h, HsWord64 *dev, HsWord64 *ino)
{
BY_HANDLE_FILE_INFORMATION info;
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ac9aee96c8005d1f900aaae5baf245…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ac9aee96c8005d1f900aaae5baf245…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] 2 commits: use --export-all-symbols for RTS
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
dfca0289 by David Eichmann at 2026-06-29T17:38:28+01:00
use --export-all-symbols for RTS
- - - - -
d1188eb4 by David Eichmann at 2026-06-29T17:40:19+01:00
WIP export-all-symbols from hadrian
- - - - -
12 changed files:
- hadrian/src/Settings/Packages.hs
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -322,6 +322,7 @@ rtsPackageArgs = package rts ? do
, Threaded `wayUnit` way ? arg "-DTHREADED_RTS"
, notM targetSupportsSMP ? arg "-optc-DNOSMP"
, isWinHost ? arg "-optl-Wl,--disable-runtime-pseudo-reloc"
+ <> arg "-optl-Wl,--export-all-symbols"
-- See Note [AutoApply.cmm for vectors] in genapply/Main.hs
--
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/352a6a489bbc611c6c5fb37dfcb9ee…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/352a6a489bbc611c6c5fb37dfcb9ee…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/davide/windows-dlls] WIP export-all-symbols from hadrian
by David Eichmann (@DavidEichmann) 29 Jun '26
by David Eichmann (@DavidEichmann) 29 Jun '26
29 Jun '26
David Eichmann pushed to branch wip/davide/windows-dlls at Glasgow Haskell Compiler / GHC
Commits:
352a6a48 by David Eichmann at 2026-06-29T17:36:02+01:00
WIP export-all-symbols from hadrian
- - - - -
12 changed files:
- hadrian/src/Settings/Packages.hs
- libraries/Win32
- libraries/base/src/Control/Concurrent.hs
- libraries/bytestring
- libraries/ghc-internal/cbits/inputReady.c
- libraries/ghc-internal/include/HsBase.h
- libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
- libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -322,6 +322,7 @@ rtsPackageArgs = package rts ? do
, Threaded `wayUnit` way ? arg "-DTHREADED_RTS"
, notM targetSupportsSMP ? arg "-optc-DNOSMP"
, isWinHost ? arg "-optl-Wl,--disable-runtime-pseudo-reloc"
+ <> arg "-optl-Wl,--export-all-symbols"
-- See Note [AutoApply.cmm for vectors] in genapply/Main.hs
--
=====================================
libraries/Win32
=====================================
@@ -1 +1 @@
-Subproject commit 7d0772bb265a6c59eb14c441cf65c778895528df
+Subproject commit b3d4064052dd6cd42a59d896b193c5c645a43aa9
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -132,6 +132,12 @@ import Control.Concurrent.Chan
import Control.Concurrent.QSem
import Control.Concurrent.QSemN
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE waitFd #-}
+
+
{- $conc_intro
The concurrency extension for Haskell is described in the paper
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 48cab2a9247f1a21cdfd1cb64c41f6911c23e395
=====================================
libraries/ghc-internal/cbits/inputReady.c
=====================================
@@ -150,6 +150,7 @@ compute_WaitForSingleObject_timeout(bool infinite, Time remaining)
* 1 => Input ready, 0 => not ready, -1 => error
* On error, sets `errno`.
*/
+__attribute__((dllexport))
int
fdReady(int fd, bool write, int64_t msecs, bool isSock)
{
=====================================
libraries/ghc-internal/include/HsBase.h
=====================================
@@ -134,7 +134,7 @@
#if defined(_WIN32)
/* in Win32Utils.c */
extern void maperrno (void);
-extern int maperrno_func(DWORD dwErrorCode);
+__attribute__((dllexport)) extern int maperrno_func(DWORD dwErrorCode);
extern HsWord64 getMonotonicUSec(void);
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/GMP.hs
=====================================
@@ -622,8 +622,11 @@ foreign import ccall unsafe "integer_gmp_mpn_xor_n"
-> IO ()
-- mp_bitcnt_t mpn_popcount (const mp_limb_t *s1p, mp_size_t n)
+{-# NOINLINE c_mpn_popcount #-}
+c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+c_mpn_popcount a b = _c_mpn_popcount a b
foreign import ccall unsafe "gmp.h __gmpn_popcount"
- c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
+ _c_mpn_popcount :: ByteArray# -> GmpSize# -> Word#
-- double integer_gmp_mpn_get_d (const mp_limb_t sp[], const mp_size_t sn)
foreign import ccall unsafe "integer_gmp_mpn_get_d"
=====================================
libraries/ghc-internal/src/GHC/Internal/Float.hs
=====================================
@@ -1632,17 +1632,47 @@ atanhDouble (D# x) = D# (atanhDouble# x)
powerDouble :: Double -> Double -> Double
powerDouble (D# x) (D# y) = D# (x **## y)
-foreign import ccall unsafe "isFloatNaN" isFloatNaN :: Float -> Int
-foreign import ccall unsafe "isFloatInfinite" isFloatInfinite :: Float -> Int
-foreign import ccall unsafe "isFloatDenormalized" isFloatDenormalized :: Float -> Int
-foreign import ccall unsafe "isFloatNegativeZero" isFloatNegativeZero :: Float -> Int
-foreign import ccall unsafe "isFloatFinite" isFloatFinite :: Float -> Int
-
-foreign import ccall unsafe "isDoubleNaN" isDoubleNaN :: Double -> Int
-foreign import ccall unsafe "isDoubleInfinite" isDoubleInfinite :: Double -> Int
-foreign import ccall unsafe "isDoubleDenormalized" isDoubleDenormalized :: Double -> Int
-foreign import ccall unsafe "isDoubleNegativeZero" isDoubleNegativeZero :: Double -> Int
-foreign import ccall unsafe "isDoubleFinite" isDoubleFinite :: Double -> Int
+{-# NOINLINE isFloatInfinite #-}
+isFloatInfinite :: Float -> Int
+isFloatInfinite x = cIsFloatInfinite x
+foreign import ccall unsafe "isFloatInfinite" cIsFloatInfinite :: Float -> Int
+{-# NOINLINE isFloatNaN #-}
+isFloatNaN :: Float -> Int
+isFloatNaN = _isFloatNaN
+foreign import ccall unsafe "isFloatNaN" _isFloatNaN :: Float -> Int
+{-# NOINLINE isFloatDenormalized #-}
+isFloatDenormalized :: Float -> Int
+isFloatDenormalized = _isFloatDenormalized
+foreign import ccall unsafe "isFloatDenormalized" _isFloatDenormalized :: Float -> Int
+{-# NOINLINE isFloatNegativeZero #-}
+isFloatNegativeZero :: Float -> Int
+isFloatNegativeZero = _isFloatNegativeZero
+foreign import ccall unsafe "isFloatNegativeZero" _isFloatNegativeZero :: Float -> Int
+{-# NOINLINE isFloatFinite #-}
+isFloatFinite :: Float -> Int
+isFloatFinite = _isFloatFinite
+foreign import ccall unsafe "isFloatFinite" _isFloatFinite :: Float -> Int
+
+{-# NOINLINE isDoubleInfinite #-}
+isDoubleInfinite :: Double -> Int
+isDoubleInfinite x = cIsDoubleInfinite x
+foreign import ccall unsafe "isDoubleInfinite" cIsDoubleInfinite :: Double -> Int
+{-# NOINLINE isDoubleNaN #-}
+isDoubleNaN :: Double -> Int
+isDoubleNaN = _isDoubleNaN
+foreign import ccall unsafe "isDoubleNaN" _isDoubleNaN :: Double -> Int
+{-# NOINLINE isDoubleDenormalized #-}
+isDoubleDenormalized :: Double -> Int
+isDoubleDenormalized = _isDoubleDenormalized
+foreign import ccall unsafe "isDoubleDenormalized" _isDoubleDenormalized :: Double -> Int
+{-# NOINLINE isDoubleNegativeZero #-}
+isDoubleNegativeZero :: Double -> Int
+isDoubleNegativeZero = _isDoubleNegativeZero
+foreign import ccall unsafe "isDoubleNegativeZero" _isDoubleNegativeZero :: Double -> Int
+{-# NOINLINE isDoubleFinite #-}
+isDoubleFinite :: Double -> Int
+isDoubleFinite = _isDoubleFinite
+foreign import ccall unsafe "isDoubleFinite" _isDoubleFinite :: Double -> Int
------------------------------------------------------------------------
-- Coercion rules
=====================================
libraries/ghc-internal/src/GHC/Internal/Float/RealFracMethods.hs
=====================================
@@ -357,5 +357,8 @@ float2Integer (F# x) =
foreign import ccall unsafe "rintDouble"
c_rintDouble :: Double -> Double
+{-# NOINLINE c_rintFloat #-}
+c_rintFloat :: Float -> Float
+c_rintFloat = _c_rintFloat
foreign import ccall unsafe "rintFloat"
- c_rintFloat :: Float -> Float
+ _c_rintFloat :: Float -> Float
=====================================
libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs
=====================================
@@ -109,6 +109,14 @@ import GHC.Internal.Num
import GHC.Internal.Base ( String, otherwise, return, ($) )
import GHC.Internal.Types ( Bool(..) )
+
+
+-- Needed for windows dynamic builds
+-- TODO we may need to disable inlining of ccalls by default
+{-# NOINLINE getErrno #-}
+
+
+
-- "errno" type
-- ------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -387,8 +387,11 @@ foreign import ccall safe "__get_console_echo"
foreign import ccall safe "__close_handle"
c_close_handle :: HANDLE -> IO Bool
+{-# NOINLINE c_handle_type #-}
+c_handle_type :: HANDLE -> IO Int
+c_handle_type = _c_handle_type
foreign import ccall safe "__handle_type"
- c_handle_type :: HANDLE -> IO Int
+ _c_handle_type :: HANDLE -> IO Int
foreign import ccall safe "__set_file_pointer"
c_set_file_pointer :: HANDLE -> CLong -> DWORD -> Ptr CLong -> IO BOOL
@@ -990,8 +993,11 @@ handleToMode hwnd = do
| hasFlag (#{const GENERIC_WRITE}) -> return WriteMode
| otherwise -> error "unknown access mask in handleToMode."
+{-# NOINLINE c_get_handle_access_mask #-}
+c_get_handle_access_mask :: HANDLE -> IO DWORD
+c_get_handle_access_mask = _c_get_handle_access_mask
foreign import ccall unsafe "__get_handle_access_mask"
- c_get_handle_access_mask :: HANDLE -> IO DWORD
+ _c_get_handle_access_mask :: HANDLE -> IO DWORD
release :: RawHandle a => a -> IO ()
release h = if isLockable h
@@ -1011,11 +1017,15 @@ foreign import ccall unsafe "unlockFile"
-- | Returns -1 on error. Otherwise writes two values representing
-- the file into the given ptrs.
+{-# NOINLINE c_getUniqueFileInfo #-}
+c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+c_getUniqueFileInfo = _c_getUniqueFileInfo
foreign import ccall unsafe "get_unique_file_info_hwnd"
- c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
+ _c_getUniqueFileInfo :: HANDLE -> Ptr Word64 -> Ptr Word64 -> IO ()
-- | getUniqueFileInfo assumes the C call to getUniqueFileInfo
-- succeeds.
+{-# NOINLINE getUniqueFileInfo #-}
getUniqueFileInfo :: RawHandle a => a -> IO (Word64, Word64)
getUniqueFileInfo handle = do
with 0 $ \devptr -> do
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -217,8 +217,11 @@ foreign import ccall unsafe "maperrno" -- in Win32Utils.c
-- | Pure function variant of 'c_maperrno' that does not call @GetLastError@
-- or modify @errno@.
+{-# NOINLINE c_maperrno_func #-}
+c_maperrno_func :: ErrCode -> Errno
+c_maperrno_func = _c_maperrno_func
foreign import ccall unsafe "maperrno_func" -- in Win32Utils.c
- c_maperrno_func :: ErrCode -> Errno
+ _c_maperrno_func :: ErrCode -> Errno
foreign import ccall unsafe "base_getErrorMessage" -- in Win32Utils.c
c_getErrorMessage :: DWORD -> IO LPWSTR
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/352a6a489bbc611c6c5fb37dfcb9ee9…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/352a6a489bbc611c6c5fb37dfcb9ee9…
You're receiving this email because of your account on gitlab.haskell.org.
1
0