summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-29 20:25:07 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-29 20:40:55 -0400
commit204ee72013d746962136ea24c19a74dfbc0f800c (patch)
treeaea155c9d6104850292029f1fe576052d676cb13
parentdda46e2da13268c239db3290720b014cef00c01d (diff)
downloadhaskell-wip/proper-salted-unit-ids.tar.gz
Stop hard-coding simplified unit IDs for wired-in packageswip/proper-salted-unit-ids
This is needed for #20647, and also something we perhaps want anyways, as somewhat discussed in #20742.
-rw-r--r--compiler/ghc.cabal.in4
-rw-r--r--libraries/base/base.cabal4
-rw-r--r--libraries/ghc-bignum/ghc-bignum.cabal5
-rw-r--r--libraries/ghc-prim/ghc-prim.cabal4
-rw-r--r--libraries/template-haskell/template-haskell.cabal.in4
-rw-r--r--rts/ghc.mk8
-rw-r--r--rts/rts.cabal.in5
7 files changed, 5 insertions, 29 deletions
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 9aae391a1b..734d32f772 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -136,10 +136,6 @@ Library
Include-Dirs: .
- -- We need to set the unit id to ghc (without a version number)
- -- as it's magic.
- GHC-Options: -this-unit-id ghc
-
c-sources:
cbits/cutils.c
cbits/genSym.c
diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
index 195e32083f..a3b68bd02a 100644
--- a/libraries/base/base.cabal
+++ b/libraries/base/base.cabal
@@ -445,9 +445,5 @@ Library
if os(freebsd)
cc-options: -DLIBICONV_PLUG
- -- We need to set the unit id to base (without a version number)
- -- as it's magic.
- ghc-options: -this-unit-id base
-
-- Make sure we don't accidentally regress into anti-patterns
ghc-options: -Wcompat -Wnoncanonical-monad-instances
diff --git a/libraries/ghc-bignum/ghc-bignum.cabal b/libraries/ghc-bignum/ghc-bignum.cabal
index 59ba847272..f3ed9c865d 100644
--- a/libraries/ghc-bignum/ghc-bignum.cabal
+++ b/libraries/ghc-bignum/ghc-bignum.cabal
@@ -84,11 +84,6 @@ library
ghc-options: -Wall
cc-options: -std=c99 -Wall
- -- GHC has wired-in IDs from the ghc-bignum package. Hence the unit-id
- -- of the package should not contain the version: i.e. it must be
- -- "ghc-bignum" and not "ghc-bignum-1.0".
- ghc-options: -this-unit-id ghc-bignum
-
include-dirs: include
if flag(gmp)
diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
index dbe5d18667..800cd4676f 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
@@ -87,7 +87,3 @@ Library
cbits/pext.c
cbits/popcnt.c
cbits/word2float.c
-
- -- We need to set the unit ID to ghc-prim (without a version number)
- -- as it's magic.
- ghc-options: -this-unit-id ghc-prim
diff --git a/libraries/template-haskell/template-haskell.cabal.in b/libraries/template-haskell/template-haskell.cabal.in
index 097e5bae24..6735c76af5 100644
--- a/libraries/template-haskell/template-haskell.cabal.in
+++ b/libraries/template-haskell/template-haskell.cabal.in
@@ -63,10 +63,6 @@ Library
ghc-options: -Wall
- -- We need to set the unit ID to template-haskell (without a
- -- version number) as it's magic.
- ghc-options: -this-unit-id template-haskell
-
-- This should match the default-extensions used in 'ghc.cabal'. This way,
-- GHCi can be used to load it along with the compiler.
Default-Extensions:
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 4c7a54977f..d2a2352cc9 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -262,7 +262,7 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/dist-install/libs.depe
# $$9 = create delay load import lib
# $$10 = SxS Name
# $$11 = SxS Version
- $$(gen-dll_INPLACE) link "rts/dist-install/build" "rts/dist-install/build" "" "" "$$(ALL_RTS_DEF_LIBS)" "$$(rts_$1_OBJS)" "$$@" "$$(rts_dist-install_HC) -this-unit-id rts -no-hs-main -shared -dynamic -dynload deploy \
+ $$(gen-dll_INPLACE) link "rts/dist-install/build" "rts/dist-install/build" "" "" "$$(ALL_RTS_DEF_LIBS)" "$$(rts_$1_OBJS)" "$$@" "$$(rts_dist-install_HC) -this-unit-id $$(rts_COMPONENT_ID) -no-hs-main -shared -dynamic -dynload deploy \
-no-auto-link-packages -Lrts/dist-install/build -l$$(LIBFFI_NAME) \
`cat rts/dist-install/libs.depend | tr '\n' ' '` \
$$(rts_dist-install_$1_GHC_LD_OPTS)" "NO" \
@@ -284,7 +284,7 @@ LIBFFI_LIBS =
endif
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/dist-install/libs.depend $$(rts_dist-install_FFI_SO)
"$$(RM)" $$(RM_OPTS) $$@
- "$$(rts_dist-install_HC)" -this-unit-id rts -shared -dynamic -dynload deploy \
+ "$$(rts_dist-install_HC)" -this-unit-id $$(rts_COMPONENT_ID) -shared -dynamic -dynload deploy \
-no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/dist-install/libs.depend` $$(rts_$1_OBJS) \
$$(rts_dist-install_$1_GHC_LD_OPTS) \
$$(rts_$1_DTRACE_OBJS) -o $$@
@@ -402,7 +402,9 @@ rts_CPP_OPTS += -DCOMPILING_RTS -DFS_NAMESPACE=rts
rts_CC_OPTS += $(WARNING_OPTS)
-rts_HC_OPTS += -this-unit-id rts
+rts_COMPONENT_ID = rts
+
+rts_HC_OPTS += -this-unit-id $$(rts_COMPONENT_ID)
ifneq "$(GhcWithSMP)" "YES"
rts_CC_OPTS += -DNOSMP
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index 641fccc437..84291bd6fb 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -61,11 +61,6 @@ flag thread-sanitizer
default: False
library
- -- rts is a wired in package and
- -- expects the unit-id to be
- -- set without version
- ghc-options: -this-unit-id rts
-
-- If we are using an in-tree libffi then we must declare it as a bundled
-- library to ensure that Cabal installs it.
if !flag(use-system-libffi)