Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 495886d9 by Rodrigo Mesquita at 2025-09-24T09:50:35-04:00 cleanup: Delete historical artifact of COMPILING_WINDOWS_DLL Namely, drop the obsolete - DLL_IMPORT_RTS - DLL_IMPORT_DATA_VAR - DLL_IMPORT_DATA_VARNAME - DLL_IMPORT_DATA_REF These macros were not doing anything and placed inconsistently Looking at the git logs reveal these macros were used to support dynamic libraries on Win32, a feature that was dropped in b8cfa8f741729ef123569fb321c4b2ab4a1a941c This allows us to get rid of the rts/DLL.h file too. - - - - - 13 changed files: - rts/CloneStack.h - rts/Prelude.h - rts/RtsSymbols.c - rts/include/Rts.h - rts/include/RtsAPI.h - rts/include/Stg.h - rts/include/rts/Flags.h - rts/include/rts/NonMoving.h - rts/include/rts/StableName.h - rts/include/rts/StablePtr.h - − rts/include/stg/DLL.h - rts/include/stg/MiscClosures.h - rts/rts.cabal Changes: ===================================== rts/CloneStack.h ===================================== @@ -8,8 +8,8 @@ #pragma once -extern StgClosure DLL_IMPORT_DATA_VARNAME(ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure); -#define StackSnapshot_constructor_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure) +extern StgClosure ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure; +#define StackSnapshot_constructor_closure (&(ghczminternal_GHCziInternalziStackziCloneStack_StackSnapshot_closure)) StgStack* cloneStack(Capability* capability, const StgStack* stack); ===================================== rts/Prelude.h ===================================== @@ -15,8 +15,8 @@ #define PRELUDE_INFO(i) extern W_(i)[] #define PRELUDE_CLOSURE(i) extern W_(i)[] #else -#define PRELUDE_INFO(i) extern const StgInfoTable DLL_IMPORT_DATA_VARNAME(i) -#define PRELUDE_CLOSURE(i) extern StgClosure DLL_IMPORT_DATA_VARNAME(i) +#define PRELUDE_INFO(i) extern const StgInfoTable (i) +#define PRELUDE_CLOSURE(i) extern StgClosure (i) #endif /* See Note [Wired-in exceptions are not CAFfy] in GHC.Core.Make. */ @@ -87,58 +87,58 @@ PRELUDE_INFO(ghczminternal_GHCziInternalziWord_W32zh_con_info); PRELUDE_INFO(ghczminternal_GHCziInternalziWord_W64zh_con_info); PRELUDE_INFO(ghczminternal_GHCziInternalziStable_StablePtr_con_info); -#define Unit_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTuple_Z0T_closure) -#define True_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_True_closure) -#define False_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_False_closure) -#define unpackCString_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziPack_unpackCString_closure) -#define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziWeakziFinalizze_runFinalizzerBatch_closure) +#define Unit_closure (&(ghczminternal_GHCziInternalziTuple_Z0T_closure)) +#define True_closure (&(ghczminternal_GHCziInternalziTypes_True_closure)) +#define False_closure (&(ghczminternal_GHCziInternalziTypes_False_closure)) +#define unpackCString_closure (&(ghczminternal_GHCziInternalziPack_unpackCString_closure)) +#define runFinalizerBatch_closure (&(ghczminternal_GHCziInternalziWeakziFinalizze_runFinalizzerBatch_closure)) #define mainIO_closure (&ZCMain_main_closure) -#define runSparks_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziConcziSync_runSparks_closure) -#define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziConcziIO_ensureIOManagerIsRunning_closure) -#define interruptIOManager_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziConcziIO_interruptIOManager_closure) -#define ioManagerCapabilitiesChanged_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziConcziIO_ioManagerCapabilitiesChanged_closure) -#define runHandlersPtr_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziConcziSignal_runHandlersPtr_closure) +#define runSparks_closure (&(ghczminternal_GHCziInternalziConcziSync_runSparks_closure)) +#define ensureIOManagerIsRunning_closure (&(ghczminternal_GHCziInternalziConcziIO_ensureIOManagerIsRunning_closure)) +#define interruptIOManager_closure (&(ghczminternal_GHCziInternalziConcziIO_interruptIOManager_closure)) +#define ioManagerCapabilitiesChanged_closure (&(ghczminternal_GHCziInternalziConcziIO_ioManagerCapabilitiesChanged_closure)) +#define runHandlersPtr_closure (&(ghczminternal_GHCziInternalziConcziSignal_runHandlersPtr_closure)) #if defined(mingw32_HOST_OS) -#define processRemoteCompletion_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziEventziWindows_processRemoteCompletion_closure) +#define processRemoteCompletion_closure (&(ghczminternal_GHCziInternalziEventziWindows_processRemoteCompletion_closure)) #endif -#define runAllocationLimitHandler_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziAllocationLimitHandler_runAllocationLimitHandler_closure) - -#define flushStdHandles_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_flushStdHandles_closure) -#define runMainIO_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_runMainIO_closure) - -#define stackOverflow_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_stackOverflow_closure) -#define heapOverflow_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_heapOverflow_closure) -#define allocationLimitExceeded_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_allocationLimitExceeded_closure) -#define blockedIndefinitelyOnMVar_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOnMVar_closure) -#define blockedIndefinitelyOnSTM_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOnSTM_closure) -#define cannotCompactFunction_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_cannotCompactFunction_closure) -#define cannotCompactPinned_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_cannotCompactPinned_closure) -#define cannotCompactMutable_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_cannotCompactMutable_closure) -#define nonTermination_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziControlziExceptionziBase_nonTermination_closure) -#define nestedAtomically_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure) -#define absentSumFieldError_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziPrimziPanic_absentSumFieldError_closure) -#define underflowException_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziExceptionziType_underflowException_closure) -#define overflowException_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziExceptionziType_overflowException_closure) -#define divZeroException_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziExceptionziType_divZZeroException_closure) - -#define blockedOnBadFD_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziEventziThread_blockedOnBadFD_closure) - -#define Czh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_Czh_con_info) -#define Izh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_Izh_con_info) -#define Fzh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_Fzh_con_info) -#define Dzh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_Dzh_con_info) -#define Wzh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTypes_Wzh_con_info) -#define W8zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziWord_W8zh_con_info) -#define W16zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziWord_W16zh_con_info) -#define W32zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziWord_W32zh_con_info) -#define W64zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziWord_W64zh_con_info) -#define I8zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziInt_I8zh_con_info) -#define I16zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziInt_I16zh_con_info) -#define I32zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziInt_I32zh_con_info) -#define I64zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziInt_I64zh_con_info) -#define I64zh_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziInt_I64zh_con_info) -#define Ptr_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziPtr_Ptr_con_info) -#define FunPtr_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziPtr_FunPtr_con_info) -#define StablePtr_static_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziStable_StablePtr_static_info) -#define StablePtr_con_info DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziStable_StablePtr_con_info) +#define runAllocationLimitHandler_closure (&(ghczminternal_GHCziInternalziAllocationLimitHandler_runAllocationLimitHandler_closure)) + +#define flushStdHandles_closure (&(ghczminternal_GHCziInternalziTopHandler_flushStdHandles_closure)) +#define runMainIO_closure (&(ghczminternal_GHCziInternalziTopHandler_runMainIO_closure)) + +#define stackOverflow_closure (&(ghczminternal_GHCziInternalziIOziException_stackOverflow_closure)) +#define heapOverflow_closure (&(ghczminternal_GHCziInternalziIOziException_heapOverflow_closure)) +#define allocationLimitExceeded_closure (&(ghczminternal_GHCziInternalziIOziException_allocationLimitExceeded_closure)) +#define blockedIndefinitelyOnMVar_closure (&(ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOnMVar_closure)) +#define blockedIndefinitelyOnSTM_closure (&(ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOnSTM_closure)) +#define cannotCompactFunction_closure (&(ghczminternal_GHCziInternalziIOziException_cannotCompactFunction_closure)) +#define cannotCompactPinned_closure (&(ghczminternal_GHCziInternalziIOziException_cannotCompactPinned_closure)) +#define cannotCompactMutable_closure (&(ghczminternal_GHCziInternalziIOziException_cannotCompactMutable_closure)) +#define nonTermination_closure (&(ghczminternal_GHCziInternalziControlziExceptionziBase_nonTermination_closure)) +#define nestedAtomically_closure (&(ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure)) +#define absentSumFieldError_closure (&(ghczminternal_GHCziInternalziPrimziPanic_absentSumFieldError_closure)) +#define underflowException_closure (&(ghczminternal_GHCziInternalziExceptionziType_underflowException_closure)) +#define overflowException_closure (&(ghczminternal_GHCziInternalziExceptionziType_overflowException_closure)) +#define divZeroException_closure (&(ghczminternal_GHCziInternalziExceptionziType_divZZeroException_closure)) + +#define blockedOnBadFD_closure (&(ghczminternal_GHCziInternalziEventziThread_blockedOnBadFD_closure)) + +#define Czh_con_info (&(ghczminternal_GHCziInternalziTypes_Czh_con_info)) +#define Izh_con_info (&(ghczminternal_GHCziInternalziTypes_Izh_con_info)) +#define Fzh_con_info (&(ghczminternal_GHCziInternalziTypes_Fzh_con_info)) +#define Dzh_con_info (&(ghczminternal_GHCziInternalziTypes_Dzh_con_info)) +#define Wzh_con_info (&(ghczminternal_GHCziInternalziTypes_Wzh_con_info)) +#define W8zh_con_info (&(ghczminternal_GHCziInternalziWord_W8zh_con_info)) +#define W16zh_con_info (&(ghczminternal_GHCziInternalziWord_W16zh_con_info)) +#define W32zh_con_info (&(ghczminternal_GHCziInternalziWord_W32zh_con_info)) +#define W64zh_con_info (&(ghczminternal_GHCziInternalziWord_W64zh_con_info)) +#define I8zh_con_info (&(ghczminternal_GHCziInternalziInt_I8zh_con_info)) +#define I16zh_con_info (&(ghczminternal_GHCziInternalziInt_I16zh_con_info)) +#define I32zh_con_info (&(ghczminternal_GHCziInternalziInt_I32zh_con_info)) +#define I64zh_con_info (&(ghczminternal_GHCziInternalziInt_I64zh_con_info)) +#define I64zh_con_info (&(ghczminternal_GHCziInternalziInt_I64zh_con_info)) +#define Ptr_con_info (&(ghczminternal_GHCziInternalziPtr_Ptr_con_info)) +#define FunPtr_con_info (&(ghczminternal_GHCziInternalziPtr_FunPtr_con_info)) +#define StablePtr_static_info (&(ghczminternal_GHCziInternalziStable_StablePtr_static_info)) +#define StablePtr_con_info (&(ghczminternal_GHCziInternalziStable_StablePtr_con_info)) ===================================== rts/RtsSymbols.c ===================================== @@ -1054,9 +1054,9 @@ RTS_ARM_OUTLINE_ATOMIC_SYMBOLS #define SymI_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \ (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA }, #define SymE_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \ - (void*)DLL_IMPORT_DATA_REF(vvv), STRENGTH_NORMAL, SYM_TYPE_CODE }, + (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE }, #define SymE_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \ - (void*)DLL_IMPORT_DATA_REF(vvv), STRENGTH_NORMAL, SYM_TYPE_DATA }, + (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA }, #define SymI_NeedsProto(vvv) SymI_HasProto(vvv) #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv) ===================================== rts/include/Rts.h ===================================== @@ -265,9 +265,9 @@ void _warnFail(const char *filename, unsigned int linenum); #include "rts/LibdwPool.h" /* Misc stuff without a home */ -DLL_IMPORT_RTS extern char **prog_argv; /* so we can get at these from Haskell */ -DLL_IMPORT_RTS extern int prog_argc; -DLL_IMPORT_RTS extern char *prog_name; +extern char **prog_argv; /* so we can get at these from Haskell */ +extern int prog_argc; +extern char *prog_name; void reportStackOverflow(StgTSO* tso); void reportHeapOverflow(void); ===================================== rts/include/RtsAPI.h ===================================== @@ -587,8 +587,8 @@ void rts_done (void); extern StgClosure ghczminternal_GHCziInternalziTopHandler_runIO_closure; extern StgClosure ghczminternal_GHCziInternalziTopHandler_runNonIO_closure; -#define runIO_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_runIO_closure) -#define runNonIO_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_runNonIO_closure) +#define runIO_closure (&(ghczminternal_GHCziInternalziTopHandler_runIO_closure)) +#define runNonIO_closure (&(ghczminternal_GHCziInternalziTopHandler_runNonIO_closure)) /* ------------------------------------------------------------------------ */ ===================================== rts/include/Stg.h ===================================== @@ -332,7 +332,6 @@ external prototype return neither of these types to workaround #11395. Other Stg stuff... -------------------------------------------------------------------------- */ -#include "stg/DLL.h" #include "stg/MachRegsForHost.h" #include "stg/Regs.h" #include "stg/Ticky.h" ===================================== rts/include/rts/Flags.h ===================================== @@ -358,7 +358,7 @@ typedef struct _RTS_FLAGS { } RTS_FLAGS; #if defined(COMPILING_RTS_MAIN) -extern DLLIMPORT RTS_FLAGS RtsFlags; +extern RTS_FLAGS RtsFlags; #elif IN_STG_CODE /* Note [RtsFlags is a pointer in STG code] * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== rts/include/rts/NonMoving.h ===================================== @@ -19,10 +19,10 @@ struct StgThunk_; struct Capability_; /* This is called by the code generator */ -extern DLL_IMPORT_RTS +extern void updateRemembSetPushClosure_(StgRegTable *reg, struct StgClosure_ *p); -extern DLL_IMPORT_RTS +extern void updateRemembSetPushThunk_(StgRegTable *reg, struct StgThunk_ *p); // Forward declaration for unregisterised backend. @@ -31,7 +31,7 @@ EF_(stg_copyArray_barrier); // Note that RTS code should not condition on this directly by rather // use the IF_NONMOVING_WRITE_BARRIER_ENABLED macro to ensure that // the barrier is eliminated in the non-threaded RTS. -extern StgWord DLL_IMPORT_DATA_VAR(nonmoving_write_barrier_enabled); +extern StgWord nonmoving_write_barrier_enabled; // A similar macro is defined in rts/include/Cmm.h for C-- code. #if defined(THREADED_RTS) ===================================== rts/include/rts/StableName.h ===================================== @@ -29,4 +29,4 @@ typedef struct { // free } snEntry; -extern DLL_IMPORT_RTS snEntry *stable_name_table; +extern snEntry *stable_name_table; ===================================== rts/include/rts/StablePtr.h ===================================== @@ -26,7 +26,7 @@ typedef struct { // otherwise. } spEntry; -extern DLL_IMPORT_RTS spEntry *stable_ptr_table; +extern spEntry *stable_ptr_table; ATTR_ALWAYS_INLINE EXTERN_INLINE StgPtr deRefStablePtr(StgStablePtr sp) ===================================== rts/include/stg/DLL.h deleted ===================================== @@ -1,35 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * (c) The GHC Team, 1998-2009 - * - * Support for Windows DLLs. - * - * Do not #include this file directly: #include "Rts.h" instead. - * - * To understand the structure of the RTS headers, see the wiki: - * https://gitlab.haskell.org/ghc/ghc/wikis/commentary/source-tree/includes - * - * ---------------------------------------------------------------------------*/ - -#pragma once - -# define DLL_IMPORT_DATA_REF(x) (&(x)) -# define DLL_IMPORT_DATA_VARNAME(x) x -# define DLLIMPORT - -/* The view of the rts/include/ header files differ ever so - slightly depending on whether the RTS is being compiled - or not - so we're forced to distinguish between two. - [oh, you want details :) : Data symbols defined by the RTS - have to be accessed through an extra level of indirection - when compiling generated .hc code compared to when the RTS - sources are being processed. This is only the case when - using Win32 DLLs. ] -*/ -#if defined(COMPILING_RTS) -#define DLL_IMPORT_RTS -#define DLL_IMPORT_DATA_VAR(x) x -#else -#define DLL_IMPORT_RTS DLLIMPORT -#define DLL_IMPORT_DATA_VAR(x) x -#endif ===================================== rts/include/stg/MiscClosures.h ===================================== @@ -25,14 +25,14 @@ # define RTS_THUNK_INFO(i) extern const W_(i)[] # define RTS_INFO(i) extern const W_(i)[] # define RTS_CLOSURE(i) extern W_(i)[] -# define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void) +# define RTS_FUN_DECL(f) extern StgFunPtr f(void) #else -# define RTS_RET_INFO(i) extern DLL_IMPORT_RTS const StgRetInfoTable i -# define RTS_FUN_INFO(i) extern DLL_IMPORT_RTS const StgFunInfoTable i -# define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable i -# define RTS_INFO(i) extern DLL_IMPORT_RTS const StgInfoTable i -# define RTS_CLOSURE(i) extern DLL_IMPORT_RTS StgClosure i -# define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void) +# define RTS_RET_INFO(i) extern const StgRetInfoTable i +# define RTS_FUN_INFO(i) extern const StgFunInfoTable i +# define RTS_THUNK_INFO(i) extern const StgThunkInfoTable i +# define RTS_INFO(i) extern const StgInfoTable i +# define RTS_CLOSURE(i) extern StgClosure i +# define RTS_FUN_DECL(f) extern StgFunPtr f(void) #endif #if defined(TABLES_NEXT_TO_CODE) @@ -274,11 +274,11 @@ RTS_CLOSURE(stg_NO_TREC_closure); RTS_ENTRY(stg_NO_FINALIZER); #if IN_STG_CODE -extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure; -extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure; +extern StgWordArray stg_CHARLIKE_closure; +extern StgWordArray stg_INTLIKE_closure; #else -extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[]; -extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[]; +extern StgIntCharlikeClosure stg_CHARLIKE_closure[]; +extern StgIntCharlikeClosure stg_INTLIKE_closure[]; #endif /* StgStartup */ ===================================== rts/rts.cabal ===================================== @@ -334,7 +334,6 @@ library rts/storage/InfoTables.h rts/storage/MBlock.h rts/storage/TSO.h - stg/DLL.h stg/MachRegs.h stg/MachRegs/arm32.h stg/MachRegs/arm64.h View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/495886d9d92def9e39234cfa18ba8303... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/495886d9d92def9e39234cfa18ba8303... You're receiving this email because of your account on gitlab.haskell.org.