diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-05-09 13:37:30 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2018-05-16 09:24:38 +0100 |
commit | a18e7dfabd234af8b55d3280f9375e5e83facca1 (patch) | |
tree | fc75f2fa94bd2190386e73f56736b6704c9a0904 /rts | |
parent | bb3fa2d18686d0c08b57c66a90a9ea1b4e4482ee (diff) | |
download | haskell-a18e7dfabd234af8b55d3280f9375e5e83facca1.tar.gz |
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
Diffstat (limited to 'rts')
-rw-r--r-- | rts/package.conf.in | 10 | ||||
-rw-r--r-- | rts/rts.cabal.in | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/rts/package.conf.in b/rts/package.conf.in index af5c282852..b5ed26d39e 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 a82deb0205..aae1dd4334 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" |