From a9f23793126251844944e00bca8e84370c759aa7 Mon Sep 17 00:00:00 2001 From: Andreas Klebinger Date: Sun, 21 Feb 2021 16:04:20 +0100 Subject: Move absentError into ghc-prim. When using -fdicts-strict we generate references to absentError while compiling ghc-prim. However we always load ghc-prim before base so this caused linker errors. We simply solve this by moving absentError into ghc-prim. This does mean it's now a panic instead of an exception which can no longer be caught. But given that it should only be thrown if there is a compiler error that seems acceptable, and in fact we already do this for absentSumFieldError which has similar constraints. --- rts/Exception.cmm | 6 ++++++ rts/RtsSymbols.c | 1 + rts/linker/PEi386.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'rts') diff --git a/rts/Exception.cmm b/rts/Exception.cmm index 3216edbcc4..edbd657251 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -660,3 +660,9 @@ stg_paniczh (W_ str) { ccall barf(str) never returns; } + +// See Note [Compiler error functions] in GHC.Prim.Panic +stg_absentErrorzh (W_ str) +{ + ccall barf("Oops! Entered absent arg %s", str) never returns; +} diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index a3ee8505ae..7ea833ce55 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -747,6 +747,7 @@ SymI_HasProto(stg_raiseOverflowzh) \ SymI_HasProto(stg_raiseIOzh) \ SymI_HasProto(stg_paniczh) \ + SymI_HasProto(stg_absentErrorzh) \ SymI_HasProto(stg_readTVarzh) \ SymI_HasProto(stg_readTVarIOzh) \ SymI_HasProto(resumeThread) \ diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index 32efdec471..f39930c8c5 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -1836,7 +1836,7 @@ ocResolve_PEi386 ( ObjectCode* oc ) /* ToDo: should be variable-sized? But is at least safe in the sense of buffer-overrun-proof. */ uint8_t symbol[1000]; - /* debugBelch("resolving for %s\n", oc->fileName); */ + /* debugBelch("resolving for %"PATH_FMT "\n", oc->fileName); */ /* Such libraries have been partially freed and can't be resolved. */ if (oc->status == OBJECT_DONT_RESOLVE) -- cgit v1.2.1