diff --git a/configure.ac b/configure.ac index d6a3dba53152d53a29cad1a61c0dcc1ab02bd5dd..4a011e3fa1ac6d46741cc901744c3f415229ba72 100644 --- a/configure.ac +++ b/configure.ac @@ -934,17 +934,6 @@ AC_CHECK_DECLS([program_invocation_short_name], , , [#define _GNU_SOURCE 1 #include <errno.h>]) -dnl ** check for mingwex library -AC_CHECK_LIB( - [mingwex], - [closedir], - [AC_SUBST([HaveLibMingwEx],[YES])] [AC_SUBST([CabalMingwex],[True])], - [AC_SUBST([HaveLibMingwEx],[NO])] [AC_SUBST([CabalMingwex],[False])]) - -if test $HaveLibMingwEx = YES ; then - AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.]) -fi - dnl ** check for math library dnl Keep that check as early as possible. dnl as we need to know whether we need libm diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 8cefe803ac7303360145d3e1fe149775d4f843fc..6a891b43632fd357c0f237977e2f950b0a5fdb5c 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -205,7 +205,6 @@ libnuma-lib-dir = @LibNumaLibDir@ use-lib-dw = @UseLibdw@ use-lib-numa = @UseLibNuma@ -use-lib-mingw-ex = @HaveLibMingwEx@ use-lib-m = @UseLibm@ use-lib-rt = @UseLibrt@ use-lib-dl = @UseLibdl@ diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs index 1f585595c5e2b349a8052e38abd101c5e1714121..d3baec493294111718732da5eb6055a3eeab43fd 100644 --- a/hadrian/src/Oracles/Flag.hs +++ b/hadrian/src/Oracles/Flag.hs @@ -35,7 +35,6 @@ data Flag = ArSupportsAtFile | UseLibffiForAdjustors | UseLibdw | UseLibnuma - | UseLibmingwex | UseLibm | UseLibrt | UseLibdl @@ -66,7 +65,6 @@ flag f = do UseLibffiForAdjustors -> "use-libffi-for-adjustors" UseLibdw -> "use-lib-dw" UseLibnuma -> "use-lib-numa" - UseLibmingwex -> "use-lib-mingw-ex" UseLibm -> "use-lib-m" UseLibrt -> "use-lib-rt" UseLibdl -> "use-lib-dl" diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index b04bfb15da7cea4e56dafd3ec2f37e61bbf47e35..0a27d2418010b1a14438beaab737ba778f7c0ed0 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -283,8 +283,7 @@ projectVersion = mconcat rtsCabalFlags :: Interpolations rtsCabalFlags = mconcat - [ flag "CabalMingwex" UseLibmingwex - , flag "CabalHaveLibdw" UseLibdw + [ flag "CabalHaveLibdw" UseLibdw , flag "CabalHaveLibm" UseLibm , flag "CabalHaveLibrt" UseLibrt , flag "CabalHaveLibdl" UseLibdl diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 901ff10a09b13b494c5bc58438de20e38602338e..c441ca6cb3a6c2c3444fc0654840ace3722b4f21 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -404,7 +404,6 @@ rtsPackageArgs = package rts ? do [ "-DTOP=" ++ show top ] , builder HsCpp ? flag UseLibdw ? arg "-DUSE_LIBDW" - , builder HsCpp ? flag UseLibmingwex ? arg "-DHAVE_LIBMINGWEX" ] -- Compile various performance-critical pieces *without* -fPIC -dynamic -- even when building a shared library. If we don't do this, then the diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs index 44065be7c498d3b7da31e051b31dc7db102a4de1..6aae25ab5e1d35f3b9e452037ff66e349bdd61b3 100644 --- a/libraries/base/System/Posix/Internals.hs +++ b/libraries/base/System/Posix/Internals.hs @@ -452,7 +452,6 @@ foreign import ccall unsafe "HsBase.h __hscore_fstat" foreign import ccall unsafe "HsBase.h __hscore_lstat" lstat :: CFilePath -> Ptr CStat -> IO CInt - #endif #if defined(js_HOST_ARCH) @@ -592,109 +591,95 @@ foreign import javascript unsafe "(($1,$2,$3_1,$3_2) => { return h$base_c_fcntl_ #else -{- Note: Win32 POSIX functions -Functions that are not part of the POSIX standards were -at some point deprecated by Microsoft. This deprecation -was performed by renaming the functions according to the -C++ ABI Section 17.6.4.3.2b. This was done to free up the -namespace of normal Windows programs since Windows isn't -POSIX compliant anyway. +#if defined(mingw32_HOST_OS) +-- See Note [Windows types] +foreign import capi unsafe "HsBase.h _read" + c_read :: CInt -> Ptr Word8 -> CUInt -> IO CInt -These were working before since the RTS was re-exporting -these symbols under the undeprecated names. This is no longer -being done. See #11223 +-- See Note [Windows types] +foreign import capi safe "HsBase.h _read" + c_safe_read :: CInt -> Ptr Word8 -> CUInt -> IO CInt -See https://msdn.microsoft.com/en-us/library/ms235384.aspx -for more. +foreign import ccall unsafe "HsBase.h _umask" + c_umask :: CMode -> IO CMode -However since we can't hope to get people to support Windows -packages we should support the deprecated names. See #12497 --} -foreign import capi unsafe "unistd.h lseek" - c_lseek :: CInt -> COff -> CInt -> IO COff +-- See Note [Windows types] +foreign import capi unsafe "HsBase.h _write" + c_write :: CInt -> Ptr Word8 -> CUInt -> IO CInt -foreign import ccall unsafe "HsBase.h access" +-- See Note [Windows types] +foreign import capi safe "HsBase.h _write" + c_safe_write :: CInt -> Ptr Word8 -> CUInt -> IO CInt + +foreign import ccall unsafe "HsBase.h _pipe" + c_pipe :: Ptr CInt -> IO CInt + +foreign import capi unsafe "HsBase.h _lseeki64" + c_lseek :: CInt -> Int64 -> CInt -> IO Int64 + +foreign import capi unsafe "HsBase.h _access" c_access :: CString -> CInt -> IO CInt #if !defined(HAVE_CHMOD) c_chmod :: CString -> CMode -> IO CInt -c_chmod _ _ = ioError (ioeSetLocation unsupportedOperation "chmod") +c_chmod _ _ = ioError (ioeSetLocation unsupportedOperation "_chmod") #else -foreign import ccall unsafe "HsBase.h chmod" +foreign import ccall unsafe "HsBase.h _chmod" c_chmod :: CString -> CMode -> IO CInt #endif -foreign import ccall unsafe "HsBase.h close" +foreign import capi unsafe "HsBase.h _close" c_close :: CInt -> IO CInt -foreign import ccall unsafe "HsBase.h creat" +foreign import capi unsafe "HsBase.h _creat" c_creat :: CString -> CMode -> IO CInt #if !defined(HAVE_DUP) c_dup :: CInt -> IO CInt -c_dup _ = ioError (ioeSetLocation unsupportedOperation "dup") +c_dup _ = ioError (ioeSetLocation unsupportedOperation "_dup") c_dup2 :: CInt -> CInt -> IO CInt -c_dup2 _ _ = ioError (ioeSetLocation unsupportedOperation "dup2") +c_dup2 _ _ = ioError (ioeSetLocation unsupportedOperation "_dup2") #else -foreign import ccall unsafe "HsBase.h dup" +foreign import ccall unsafe "HsBase.h _dup" c_dup :: CInt -> IO CInt -foreign import ccall unsafe "HsBase.h dup2" +foreign import ccall unsafe "HsBase.h _dup2" c_dup2 :: CInt -> CInt -> IO CInt #endif -foreign import ccall unsafe "HsBase.h isatty" +foreign import capi unsafe "HsBase.h _isatty" c_isatty :: CInt -> IO CInt -#if defined(mingw32_HOST_OS) --- See Note: Windows types -foreign import capi unsafe "HsBase.h _read" - c_read :: CInt -> Ptr Word8 -> CUInt -> IO CInt - --- See Note: Windows types -foreign import capi safe "HsBase.h _read" - c_safe_read :: CInt -> Ptr Word8 -> CUInt -> IO CInt - -foreign import ccall unsafe "HsBase.h _umask" - c_umask :: CMode -> IO CMode - --- See Note: Windows types -foreign import capi unsafe "HsBase.h _write" - c_write :: CInt -> Ptr Word8 -> CUInt -> IO CInt +foreign import capi unsafe "HsBase.h _unlink" + c_unlink :: CString -> IO CInt --- See Note: Windows types -foreign import capi safe "HsBase.h _write" - c_safe_write :: CInt -> Ptr Word8 -> CUInt -> IO CInt +foreign import capi unsafe "HsBase.h _utime" + c_utime :: CString -> Ptr CUtimbuf -> IO CInt -foreign import ccall unsafe "HsBase.h _pipe" - c_pipe :: Ptr CInt -> IO CInt +foreign import capi unsafe "HsBase.h _getpid" + 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 -- support is enabled. --- See Note: Windows types +-- See Note [Windows types] foreign import capi unsafe "HsBase.h read" c_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize --- See Note: Windows types +-- See Note [Windows types] foreign import capi safe "HsBase.h read" c_safe_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize -#if defined(HAVE_UMASK) foreign import ccall unsafe "HsBase.h umask" c_umask :: CMode -> IO CMode -#else -c_umask :: CMode -> IO CMode -c_umask _ = ioError (ioeSetLocation unsupportedOperation "umask") -#endif --- See Note: Windows types +-- See Note [Windows types] foreign import capi unsafe "HsBase.h write" c_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize --- See Note: Windows types +-- See Note [Windows types] foreign import capi safe "HsBase.h write" c_safe_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize @@ -705,8 +690,44 @@ c_pipe _ = ioError (ioeSetLocation unsupportedOperation "pipe") foreign import ccall unsafe "HsBase.h pipe" c_pipe :: Ptr CInt -> IO CInt #endif + +foreign import capi unsafe "unistd.h lseek" + c_lseek :: CInt -> COff -> CInt -> IO COff + +foreign import ccall unsafe "HsBase.h access" + c_access :: CString -> CInt -> IO CInt + +#if !defined(HAVE_CHMOD) +c_chmod :: CString -> CMode -> IO CInt +c_chmod _ _ = ioError (ioeSetLocation unsupportedOperation "chmod") +#else +foreign import ccall unsafe "HsBase.h chmod" + c_chmod :: CString -> CMode -> IO CInt +#endif + +foreign import ccall unsafe "HsBase.h close" + c_close :: CInt -> IO CInt + +foreign import ccall unsafe "HsBase.h creat" + c_creat :: CString -> CMode -> IO CInt + +#if !defined(HAVE_DUP) +c_dup :: CInt -> IO CInt +c_dup _ = ioError (ioeSetLocation unsupportedOperation "dup") + +c_dup2 :: CInt -> CInt -> IO CInt +c_dup2 _ _ = ioError (ioeSetLocation unsupportedOperation "dup2") +#else +foreign import ccall unsafe "HsBase.h dup" + c_dup :: CInt -> IO CInt + +foreign import ccall unsafe "HsBase.h dup2" + c_dup2 :: CInt -> CInt -> IO CInt #endif +foreign import ccall unsafe "HsBase.h isatty" + c_isatty :: CInt -> IO CInt + foreign import ccall unsafe "HsBase.h unlink" c_unlink :: CString -> IO CInt @@ -720,6 +741,7 @@ c_getpid = pure 1 foreign import ccall unsafe "HsBase.h getpid" c_getpid :: IO CPid #endif +#endif #if !defined(js_HOST_ARCH) foreign import ccall unsafe "HsBase.h __hscore_stat" @@ -881,7 +903,7 @@ foreign import capi unsafe "stdio.h value SEEK_END" sEEK_END :: CInt #endif {- -Note: Windows types +Note [Windows types] Windows' _read and _write have types that differ from POSIX. They take an unsigned int for length and return a signed int where POSIX uses size_t and diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal index d615108c58ce8e1fb6ef2b5c0c7309dc15f1c571..5e7fdc17c69fd21319ee7a1851c6703ecd356596 100644 --- a/libraries/base/base.cabal +++ b/libraries/base/base.cabal @@ -397,7 +397,6 @@ Library if os(windows) -- Windows requires some extra libraries for linking because the RTS -- is no longer re-exporting them. - -- mingwex: provides C99 compatibility. libm is a stub on MingW. -- mingw32: Unfortunately required because of a resource leak between -- mingwex and mingw32. the __math_err symbol is defined in -- mingw32 which is required by mingwex. @@ -410,7 +409,7 @@ Library -- advapi32: provides advanced kernel functions extra-libraries: wsock32, user32, shell32, mingw32, kernel32, advapi32, - mingwex, ws2_32, shlwapi, ole32, rpcrt4, ntdll + ws2_32, shlwapi, ole32, rpcrt4, ntdll -- Minimum supported Windows version. -- These numbers can be found at: -- https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac index a1c68577aa75defdc7b51aa7e040369dfb26274f..cea01384aace463a41151f0657a671015277936f 100644 --- a/libraries/base/configure.ac +++ b/libraries/base/configure.ac @@ -39,7 +39,7 @@ AC_CHECK_LIB([rt], [clock_gettime]) AC_CHECK_FUNCS([clock_gettime]) AC_CHECK_DECLS([CLOCK_PROCESS_CPUTIME_ID], [], [], [[#include <time.h>]]) AC_CHECK_FUNCS([getclock getrusage times]) -AC_CHECK_FUNCS([_chsize ftruncate]) +AC_CHECK_FUNCS([_chsize_s ftruncate]) # event-related fun # The line below already defines HAVE_KQUEUE and HAVE_POLL, so technically some of the diff --git a/libraries/base/include/HsBase.h b/libraries/base/include/HsBase.h index 12edce964d85f3ed1c00f13a601ef8b22e2a939b..d841141be2e7491fd8359b33946acb80e9882fac 100644 --- a/libraries/base/include/HsBase.h +++ b/libraries/base/include/HsBase.h @@ -280,15 +280,12 @@ __hscore_o_nonblock( void ) INLINE int __hscore_ftruncate( int fd, off_t where ) { -#if defined(HAVE_FTRUNCATE) +#if defined(HAVE__CHSIZE_S) + return _chsize_s(fd,where); +#elif defined(HAVE_FTRUNCATE) return ftruncate(fd,where); -#elif defined(HAVE__CHSIZE) - return _chsize(fd,where); #else -// ToDo: we should use _chsize_s() on Windows which allows a 64-bit -// offset, but it doesn't seem to be available from mingw at this time -// --SDM (01/2008) -#error at least ftruncate or _chsize functions are required to build +#error at least _chsize_s or ftruncate functions are required to build #endif } diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal index dbe1e325450937471c4f881216904001c89753d3..5393363505a36062d9a18ce7c7cc0d1fb7d2f126 100644 --- a/libraries/ghc-prim/ghc-prim.cabal +++ b/libraries/ghc-prim/ghc-prim.cabal @@ -66,15 +66,14 @@ Library if os(windows) -- Windows requires some extra libraries for linking because the RTS -- is no longer re-exporting them (see #11223) - -- msvcrt: standard C library. The RTS will automatically include this, - -- but is added for completeness. - -- mingwex: provides C99 compatibility. libm is a stub on MingW. + -- ucrt: standard C library. The RTS will automatically include this, + -- but is added for completeness. -- mingw32: Unfortunately required because of a resource leak between -- mingwex and mingw32. the __math_err symbol is defined in -- mingw32 which is required by mingwex. -- user32: provides access to apis to modify user components (UI etc) -- on Windows. Required because of mingw32. - extra-libraries: user32, mingw32, mingwex, ucrt + extra-libraries: user32, mingw32, ucrt if os(linux) -- we need libm, but for musl and other's we might need libc, as libm diff --git a/rts/Linker.c b/rts/Linker.c index 6300240c48c9868ad2c4e1ec84bd5152ea5c3f3f..af91a098beb8df5005bea0add0ba2c29a02c7d6b 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -135,7 +135,8 @@ extern void iconv(); This is to enable lazy loading of symbols. Eager loading is problematic as it means that all symbols must be available, even those which we will never use. This is especially painful on Windows, where the number of - libraries required to link things like mingwex grows to be quite high. + libraries required to link things like mingwex (TODO: We no longer depend + on mingwex, so think of a different example here) grows to be quite high. We proceed through these stages as follows, @@ -193,7 +194,8 @@ extern void iconv(); 1) Dependency chains, if A.o required a .o in libB but A.o isn't required to link then we don't need to load libB. This means the dependency chain for libraries - such as mingw32 and mingwex can be broken down. + such as mingw32 and mingwex (TODO: We no longer depend on mingwex, so think of + a different example here) can be broken down. 2) The number of duplicate symbols, since now only symbols that are true duplicates will display the error. diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index 357ea4ddceec70f2c521417dca5c9e0cb7f850ec..a95a1b1231eec5c6fca923f1f6b60392eca032ed 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -113,26 +113,6 @@ extern char **environ; * by the RtsSymbols entry. To avoid this we introduce a horrible special case * in `ghciInsertSymbolTable`, ensure that `atexit` is never overridden. */ -/* - * Note [Symbols for MinGW's printf] - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * The printf offered by Microsoft's libc implementation, msvcrt, is quite - * incomplete, lacking support for even %ull. Consequently mingw-w64 offers its - * own implementation which we enable. However, to be thread-safe the - * implementation uses _lock_file. This would be fine except msvcrt.dll doesn't - * export _lock_file, only numbered versions do (e.g. msvcrt90.dll). - * - * To work around this mingw-w64 packages a static archive of msvcrt which - * includes their own implementation of _lock_file. However, this means that - * the archive contains things which the dynamic library does not; consequently - * we need to ensure that the runtime linker provides this symbol. - * - * It's all just so terrible. - * - * See also: - * https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/ - * https://sourceforge.net/p/mingw-w64/discussion/723797/thread/55520785/ - */ /* Note [_iob_func symbol] * ~~~~~~~~~~~~~~~~~~~~~~~ * Microsoft in VS2013 to VS2015 transition made a backwards incompatible change @@ -170,10 +150,6 @@ extern char **environ; SymI_NeedsProto(__mingw_module_is_dll) \ RTS_WIN32_ONLY(SymI_NeedsProto(___chkstk_ms)) \ RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \ - RTS_WIN64_ONLY(SymI_HasProto(_errno)) \ - /* see Note [Symbols for MinGW's printf] */ \ - SymI_HasProto(_lock_file) \ - SymI_HasProto(_unlock_file) \ SymI_HasProto(__mingw_vsnwprintf) \ /* ^^ Need to figure out why this is needed. */ \ /* See Note [_iob_func symbol] */ \ @@ -185,120 +161,8 @@ extern char **environ; /* ^^ Need to figure out why this is needed. */ \ SymI_HasProto(__mingw_vfprintf) \ /* ^^ Need to figure out why this is needed. */ - -#define RTS_MINGW_COMPAT_SYMBOLS \ - SymI_HasProto_deprecated(access) \ - SymI_HasProto_deprecated(cabs) \ - SymI_HasProto_deprecated(cgets) \ - SymI_HasProto_deprecated(chdir) \ - SymI_HasProto_deprecated(chmod) \ - SymI_HasProto_deprecated(chsize) \ - SymI_HasProto_deprecated(close) \ - SymI_HasProto_deprecated(cprintf) \ - SymI_HasProto_deprecated(cputs) \ - SymI_HasProto_deprecated(creat) \ - SymI_HasProto_deprecated(cscanf) \ - SymI_HasProto_deprecated(cwait) \ - SymI_HasProto_deprecated(dup) \ - SymI_HasProto_deprecated(dup2) \ - SymI_HasProto_deprecated(ecvt) \ - SymI_HasProto_deprecated(eof) \ - SymI_HasProto_deprecated(execl) \ - SymI_HasProto_deprecated(execle) \ - SymI_HasProto_deprecated(execlp) \ - SymI_HasProto_deprecated(execlpe) \ - SymI_HasProto_deprecated(execv) \ - SymI_HasProto_deprecated(execve) \ - SymI_HasProto_deprecated(execvp) \ - SymI_HasProto_deprecated(execvpe) \ - SymI_HasProto_deprecated(fcloseall) \ - SymI_HasProto_deprecated(fcvt) \ - SymI_HasProto_deprecated(fdopen) \ - SymI_HasProto_deprecated(fgetchar) \ - SymI_HasProto_deprecated(filelength) \ - SymI_HasProto_deprecated(fileno) \ - SymI_HasProto_deprecated(flushall) \ - SymI_HasProto_deprecated(fputchar) \ - SymI_HasProto_deprecated(gcvt) \ - SymI_HasProto_deprecated(getch) \ - SymI_HasProto_deprecated(getche) \ - SymI_HasProto_deprecated(getcwd) \ - SymI_HasProto_deprecated(getpid) \ - SymI_HasProto_deprecated(getw) \ - SymI_HasProto_deprecated(hypot) \ - SymI_HasProto_deprecated(inp) \ - SymI_HasProto_deprecated(inpw) \ - SymI_HasProto_deprecated(isascii) \ - SymI_HasProto_deprecated(isatty) \ - SymI_HasProto_deprecated(iscsym) \ - SymI_HasProto_deprecated(iscsymf) \ - SymI_HasProto_deprecated(itoa) \ - SymI_HasProto_deprecated(j0) \ - SymI_HasProto_deprecated(j1) \ - SymI_HasProto_deprecated(jn) \ - SymI_HasProto_deprecated(kbhit) \ - SymI_HasProto_deprecated(lfind) \ - SymI_HasProto_deprecated(locking) \ - SymI_HasProto_deprecated(lsearch) \ - SymI_HasProto_deprecated(lseek) \ - SymI_HasProto_deprecated(ltoa) \ - SymI_HasProto_deprecated(memccpy) \ - SymI_HasProto_deprecated(memicmp) \ - SymI_HasProto_deprecated(mkdir) \ - SymI_HasProto_deprecated(mktemp) \ - SymI_HasProto_deprecated(open) \ - SymI_HasProto_deprecated(outp) \ - SymI_HasProto_deprecated(outpw) \ - SymI_HasProto_deprecated(putch) \ - SymI_HasProto_deprecated(putenv) \ - SymI_HasProto_deprecated(putw) \ - SymI_HasProto_deprecated(read) \ - SymI_HasProto_deprecated(rmdir) \ - SymI_HasProto_deprecated(rmtmp) \ - SymI_HasProto_deprecated(setmode) \ - SymI_HasProto_deprecated(sopen) \ - SymI_HasProto_deprecated(spawnl) \ - SymI_HasProto_deprecated(spawnle) \ - SymI_HasProto_deprecated(spawnlp) \ - SymI_HasProto_deprecated(spawnlpe) \ - SymI_HasProto_deprecated(spawnv) \ - SymI_HasProto_deprecated(spawnve) \ - SymI_HasProto_deprecated(spawnvp) \ - SymI_HasProto_deprecated(spawnvpe) \ - SymI_HasProto_deprecated(strcmpi) \ - SymI_HasProto_deprecated(strdup) \ - SymI_HasProto_deprecated(stricmp) \ - SymI_HasProto_deprecated(strlwr) \ - SymI_HasProto_deprecated(strnicmp) \ - SymI_HasProto_deprecated(strnset) \ - SymI_HasProto_deprecated(strrev) \ - SymI_HasProto_deprecated(strset) \ - SymI_HasProto_deprecated(strupr) \ - SymI_HasProto_deprecated(swab) \ - SymI_HasProto_deprecated(tell) \ - SymI_HasProto_deprecated(tempnam) \ - SymI_HasProto_deprecated(toascii) \ - SymI_HasProto_deprecated(tzset) \ - SymI_HasProto_deprecated(ultoa) \ - SymI_HasProto_deprecated(umask) \ - SymI_HasProto_deprecated(ungetch) \ - SymI_HasProto_deprecated(unlink) \ - SymI_HasProto_deprecated(wcsdup) \ - SymI_HasProto_deprecated(wcsicmp) \ - SymI_HasProto_deprecated(wcsicoll) \ - SymI_HasProto_deprecated(wcslwr) \ - SymI_HasProto_deprecated(wcsnicmp) \ - SymI_HasProto_deprecated(wcsnset) \ - SymI_HasProto_deprecated(wcsrev) \ - SymI_HasProto_deprecated(wcsset) \ - SymI_HasProto_deprecated(wcsupr) \ - SymI_HasProto_deprecated(write) \ - SymI_HasProto_deprecated(y0) \ - SymI_HasProto_deprecated(y1) \ - SymI_HasProto_deprecated(yn) #else #define RTS_MINGW_ONLY_SYMBOLS /**/ -#define RTS_MINGW_COMPAT_SYMBOLS /**/ #endif @@ -1121,7 +985,6 @@ extern char **environ; #define SymI_HasProto(vvv) /**/ #define SymI_HasDataProto(vvv) /**/ #define SymI_HasProto_redirect(vvv,xxx,strength,ty) /**/ -#define SymI_HasProto_deprecated(vvv) /**/ RTS_SYMBOLS RTS_RET_SYMBOLS @@ -1139,7 +1002,6 @@ RTS_LIBFFI_SYMBOLS #undef SymI_HasProto #undef SymI_HasDataProto #undef SymI_HasProto_redirect -#undef SymI_HasProto_deprecated #undef SymE_HasProto #undef SymE_HasDataProto #undef SymE_NeedsProto @@ -1165,22 +1027,11 @@ RTS_LIBFFI_SYMBOLS { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \ (void*)(&(xxx)), strength, ty }, -// SymI_HasProto_deprecated allows us to redirect references from their deprecated -// names to the undeprecated ones. e.g. access -> _access. -// We use the hexspeak for unallocated memory 0xBAADF00D to signal the RTS -// that this needs to be loaded from somewhere else. -// These are inserted as weak symbols to prevent us overriding packages that do -// define them, since on Windows these functions shouldn't be in the top level -// namespace, but we have them for POSIX compatibility. -#define SymI_HasProto_deprecated(vvv) \ - { #vvv, (void*)0xBAADF00D, STRENGTH_WEAK, SYM_TYPE_CODE }, - RtsSymbolVal rtsSyms[] = { RTS_SYMBOLS RTS_RET_SYMBOLS RTS_POSIX_ONLY_SYMBOLS RTS_MINGW_ONLY_SYMBOLS - RTS_MINGW_COMPAT_SYMBOLS RTS_DARWIN_ONLY_SYMBOLS RTS_OPENBSD_ONLY_SYMBOLS RTS_LIBGCC_SYMBOLS diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index 8e2ce984cae9841c651559a7943e0399443a7754..8d5238f792b1277390a88c68e90b4494aca2f0af 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -2171,21 +2171,7 @@ SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl, ObjectCode *dependent, SymType } else { if (type) *type = pinfo->type; - // If Windows, perform initialization of uninitialized - // Symbols from the C runtime which was loaded above. - // We do this on lookup to prevent the hit when - // The symbol isn't being used. - if (pinfo->value == (void*)0xBAADF00D) - { - char symBuffer[50]; - const char *crt_impl = "ucrtbase"; - sprintf(symBuffer, "_%s", lbl); - static HMODULE crt = NULL; - if (!crt) crt = GetModuleHandle(crt_impl); - pinfo->value = GetProcAddress(crt, symBuffer); - return pinfo->value; - } - else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl)) + if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl)) { /* See Note [BFD import library]. */ HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, dependent, type); diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in index d10ee390e4c186130a45e31759eb017ca905a695..b2e1e970bc333a3636f84b0372bf569303ce73ac 100644 --- a/rts/rts.cabal.in +++ b/rts/rts.cabal.in @@ -24,8 +24,6 @@ flag need-pthread default: @CabalNeedLibpthread@ flag libbfd default: @CabalHaveLibbfd@ -flag mingwex - default: @CabalMingwex@ flag need-atomic default: @CabalNeedLibatomic@ flag libdw @@ -68,7 +66,6 @@ library exposed: True exposed-modules: - if os(ghcjs) include-dirs: include @@ -194,8 +191,6 @@ library if flag(libbfd) -- for debugging extra-libraries: bfd iberty - if flag(mingwex) - extra-libraries: mingwex if flag(libdw) -- for backtraces extra-libraries: elf dw