From 8732b205858318d0e2bd6d2ad4ae93664297380d Mon Sep 17 00:00:00 2001
From: Reid Barton <rwbarton@gmail.com>
Date: Tue, 1 Jul 2014 01:04:18 -0400
Subject: [PATCH] Mark HPC ticks labels as dynamic

This enables GHC's PIC machinery for accessing tickboxes of other
packages correctly when building dynamic libraries. Previously
GHC was doing strange and wrong things in that situation. See #9012.

(cherry picked from commit 3285a3d5bc7419464f5d2e6cef7c3adb9bca65c3)
---
 compiler/cmm/CLabel.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 1b86f3d6b41c..65c597cb69d5 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -876,6 +876,8 @@ labelDynamic dflags this_pkg this_mod lbl =
 
    PlainModuleInitLabel m -> not (gopt Opt_Static dflags) && this_pkg /= (modulePackageId m)
 
+   HpcTicksLabel m        -> not (gopt Opt_Static dflags) && this_pkg /= (modulePackageId m)
+
    -- Note that DynamicLinkerLabels do NOT require dynamic linking themselves.
    _                 -> False
   where os = platformOS (targetPlatform dflags)
-- 
GitLab