summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-04-07 22:33:21 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-09 22:56:18 -0400
commit0472f0f6a92395d478e9644c0dbd12948518099f (patch)
tree811e61b4be392fbd68e7b3df24a82a6df74f89e5 /rts/PrimOps.cmm
parentfb43bddc771094632bd08a4eab28fd3e714affd0 (diff)
downloadhaskell-0472f0f6a92395d478e9644c0dbd12948518099f.tar.gz
Remove most uses of TARGET platform macros
These prevent multi-target builds. They were gotten rid of in 3 ways: 1. In the compiler itself, replacing `#if` with runtime `if`. In these cases, we care about the target platform still, but the target platform is dynamic so we must delay the elimination to run time. 2. In the compiler itself, replacing `TARGET` with `HOST`. There was just one bit of this, in some code splitting strings representing lists of paths. These paths are used by GHC itself, and not by the compiled binary. (They are compiler lookup paths, rather than RPATHS or something that does matter to the compiled binary, and thus would legitamentally be target-sensative.) As such, the path-splitting method only depends on where GHC runs and not where code it produces runs. This should have been `HOST` all along. 3. Changing the RTS. The RTS doesn't care about the target platform, full stop. 4. `includes/stg/HaskellMachRegs.h` This file is also included in the genapply executable. This is tricky because the RTS's host platform really is that utility's target platform. so that utility really really isn't multi-target either. But at least it isn't an installed part of GHC, but just a one-off tool when building the RTS. Lying with the `HOST` to a one-off program (genapply) that isn't installed doesn't seem so bad. It's certainly better than the other way around of lying to the RTS though not to genapply. The RTS is more important, and it is installed, *and* this header is installed as part of the RTS.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index afb990dda5..d9a28d7396 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -2440,7 +2440,7 @@ stg_traceEventzh ( W_ msg )
// We should go through the macro HASKELLEVENT_USER_MSG_ENABLED from
// RtsProbes.h, but that header file includes unistd.h, which doesn't
// work in Cmm
-#if !defined(solaris2_TARGET_OS)
+#if !defined(solaris2_HOST_OS)
(enabled) = ccall __dtrace_isenabled$HaskellEvent$user__msg$v1();
#else
// Solaris' DTrace can't handle the
@@ -2482,7 +2482,7 @@ stg_traceMarkerzh ( W_ msg )
W_ enabled;
-#if !defined(solaris2_TARGET_OS)
+#if !defined(solaris2_HOST_OS)
(enabled) = ccall __dtrace_isenabled$HaskellEvent$user__marker$v1();
#else
enabled = 1;