Skip to content

Commit

Permalink
Show warning when trying to combine -dynamic and -prof.
Browse files Browse the repository at this point in the history
because in that case we omit `-dynamic`, so the user should know.
  • Loading branch information
mboes committed Nov 22, 2018
1 parent 59ece2d commit c2e8bc9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions haskell/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ def link_binary(
# sure that GHC dynamically links Haskell code too. The one exception to
# this is when we are compiling for profiling, which currently does not play
# nicely with dynamic linking.
if dynamic and not with_profiling:
args.add(["-pie", "-dynamic"])
if dynamic:
if with_profiling:
print("WARNING: dynamic linking and profiling don't mix. Omitting -dynamic.\nSee https://ghc.haskell.org/trac/ghc/ticket/15394")
else:
args.add(["-pie", "-dynamic"])

# When compiling with `-threaded`, GHC needs to link against
# the pthread library when linking against static archives (.a).
Expand Down

0 comments on commit c2e8bc9

Please sign in to comment.