summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/Packages.lhs14
-rw-r--r--includes/rts/Config.h3
-rw-r--r--includes/stg/Ticky.h3
-rw-r--r--rts/Ticky.c34
4 files changed, 32 insertions, 22 deletions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index 077a4ebca0..4b1446280f 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -801,12 +801,20 @@ collectLinkOpts dflags ps = concat (map all_opts ps)
packageHsLibs :: DynFlags -> PackageConfig -> [String]
packageHsLibs dflags p = map (mkDynName . addSuffix) (hsLibraries p)
where
- non_dyn_ways = filter ((/= WayDyn) . wayName) (ways dflags)
+ ways0 = ways dflags
+
+ ways1 = filter ((/= WayDyn) . wayName) ways0
-- the name of a shared library is libHSfoo-ghc<version>.so
-- we leave out the _dyn, because it is superfluous
- tag = mkBuildTag (filter (not . wayRTSOnly) non_dyn_ways)
- rts_tag = mkBuildTag non_dyn_ways
+ -- debug RTS includes support for -ticky and -eventlog
+ ways2 | WayDebug `elem` map wayName ways1
+ = filter ((`notElem` [WayTicky,WayEventLog]) . wayName) ways1
+ | otherwise
+ = ways1
+
+ tag = mkBuildTag (filter (not . wayRTSOnly) ways2)
+ rts_tag = mkBuildTag ways2
mkDynName | opt_Static = id
| otherwise = (++ ("-ghc" ++ cProjectVersion))
diff --git a/includes/rts/Config.h b/includes/rts/Config.h
index b8aa24634c..c67b53039c 100644
--- a/includes/rts/Config.h
+++ b/includes/rts/Config.h
@@ -27,10 +27,11 @@
#define USING_LIBBFD 1
#endif
-/* DEBUG implies TRACING
+/* DEBUG implies TRACING and TICKY_TICKY
*/
#if defined(DEBUG)
#define TRACING
+#define TICKY_TICKY
#endif
/* -----------------------------------------------------------------------------
diff --git a/includes/stg/Ticky.h b/includes/stg/Ticky.h
index 001ab973f7..b66c8b23e5 100644
--- a/includes/stg/Ticky.h
+++ b/includes/stg/Ticky.h
@@ -19,7 +19,6 @@
keep them consistent with the macros that use them (which are
defined in Cmm.h. */
-#ifdef TICKY_TICKY
/* same trick as in the former StgTicky.h: recycle the same declarations
for both extern decls (which are included everywhere)
and initializations (which only happen once) */
@@ -164,8 +163,6 @@ EXTERN StgInt RET_SEMI_loads_avoided INIT(0);
/* End of counter declarations. */
-#endif /* TICKY_TICKY */
-
/* This is ugly, but the story is:
We got rid of StgTicky.h, which was previously
defining these macros for the benefit of C code
diff --git a/rts/Ticky.c b/rts/Ticky.c
index c874d1a19c..ff700df234 100644
--- a/rts/Ticky.c
+++ b/rts/Ticky.c
@@ -6,12 +6,29 @@
* Ticky-ticky profiling
*-------------------------------------------------------------------------- */
-#if defined(TICKY_TICKY)
-
#define TICKY_C /* define those variables */
#include "PosixSource.h"
#include "Rts.h"
+/* Catch-all top-level counter struct. Allocations from CAFs will go
+ * here.
+ */
+StgEntCounter top_ct
+ = { 0, 0, 0,
+ "TOP", "",
+ 0, 0, NULL };
+
+/* Data structure used in ``registering'' one of these counters. */
+
+StgEntCounter *ticky_entry_ctrs = NULL; /* root of list of them */
+
+/* We want Haskell code compiled with -ticky to be linkable with any
+ * version of the RTS, so we have to make sure all the symbols that
+ * ticky-compiled code may refer to are defined by every RTS. (#3439)
+ * Hence the #ifdef is here, rather than up above.
+ */
+#if defined(TICKY_TICKY)
+
#include "Ticky.h"
/* -----------------------------------------------------------------------------
@@ -553,10 +570,6 @@ PrintTickyInfo(void)
PR_CTR(GC_WORDS_COPIED_ctr);
}
-/* Data structure used in ``registering'' one of these counters. */
-
-StgEntCounter *ticky_entry_ctrs = NULL; /* root of list of them */
-
/* To print out all the registered-counter info: */
static void
@@ -585,14 +598,5 @@ printRegisteredCounterInfo (FILE *tf)
}
}
-
-/* Catch-all top-level counter struct. Allocations from CAFs will go
- * here.
- */
-StgEntCounter top_ct
- = { 0, 0, 0,
- "TOP", "",
- 0, 0, NULL };
-
#endif /* TICKY_TICKY */