[commit: ghc] master: Force findPtr to be included in the binary (a18e7df)
git at git.haskell.org
git at git.haskell.org
Wed May 16 08:25:19 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a18e7dfabd234af8b55d3280f9375e5e83facca1/ghc
>---------------------------------------------------------------
commit a18e7dfabd234af8b55d3280f9375e5e83facca1
Author: Simon Marlow <marlowsd at gmail.com>
Date: Wed May 9 13:37:30 2018 +0100
Force findPtr to be included in the binary
Summary: A better alternative to D4657.
Test Plan:
```
cd testsuite/tests/codeGen/should_run
../../../../inplace/bin/ghc-stage2 -debug cgrun001
nm cgrun001 | grep findPtr
```
Reviewers: bgamari, Phyx, erikd
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4683
>---------------------------------------------------------------
a18e7dfabd234af8b55d3280f9375e5e83facca1
rts/package.conf.in | 10 ++++++++++
rts/rts.cabal.in | 6 ++++++
2 files changed, 16 insertions(+)
diff --git a/rts/package.conf.in b/rts/package.conf.in
index af5c282..b5ed26d 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -174,6 +174,11 @@ ld-options:
#if WORD_SIZE_IN_BITS == 64
, "-Wl,-u,_hs_atomicwrite64"
#endif
+#if defined(DEBUG)
+ /* This symbol is useful in gdb, but not referred to anywhere,
+ * so we need to force it to be included in the binary. */
+ , "-Wl,-u,_findPtr"
+#endif
#else
"-Wl,-u,base_GHCziTopHandler_runIO_closure"
, "-Wl,-u,base_GHCziTopHandler_runNonIO_closure"
@@ -272,6 +277,11 @@ ld-options:
#if WORD_SIZE_IN_BITS == 64
, "-Wl,-u,hs_atomicwrite64"
#endif
+#if defined(DEBUG)
+ /* This symbol is useful in gdb, but not referred to anywhere,
+ * so we need to force it to be included in the binary. */
+ , "-Wl,-u,findPtr"
+#endif
#endif
/* Pick up static libraries in preference over dynamic if in earlier search
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index a82deb0..aae1dd4 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -250,6 +250,9 @@ library
"-Wl,-u,_hs_atomicwrite8"
"-Wl,-u,_hs_atomicwrite16"
"-Wl,-u,_hs_atomicwrite32"
+ -- This symbol is useful in gdb, but not referred to anywhere,
+ -- so we need to force it to be included in the binary.
+ "-Wl,-u,_findPtr"
else
ld-options:
"-Wl,-u,base_GHCziTopHandler_runIO_closure"
@@ -320,6 +323,9 @@ library
"-Wl,-u,hs_atomicwrite8"
"-Wl,-u,hs_atomicwrite16"
"-Wl,-u,hs_atomicwrite32"
+ -- This symbol is useful in gdb, but not referred to anywhere,
+ -- so we need to force it to be included in the binary.
+ "-Wl,-u,findPtr"
if os(osx)
ld-options: "-Wl,-search_paths_first"
More information about the ghc-commits
mailing list