Commit a18e7dfa authored by Simon Marlow's avatar Simon Marlow
Browse files

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
parent bb3fa2d1
...@@ -174,6 +174,11 @@ ld-options: ...@@ -174,6 +174,11 @@ ld-options:
#if WORD_SIZE_IN_BITS == 64 #if WORD_SIZE_IN_BITS == 64
, "-Wl,-u,_hs_atomicwrite64" , "-Wl,-u,_hs_atomicwrite64"
#endif #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 #else
"-Wl,-u,base_GHCziTopHandler_runIO_closure" "-Wl,-u,base_GHCziTopHandler_runIO_closure"
, "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" , "-Wl,-u,base_GHCziTopHandler_runNonIO_closure"
...@@ -272,6 +277,11 @@ ld-options: ...@@ -272,6 +277,11 @@ ld-options:
#if WORD_SIZE_IN_BITS == 64 #if WORD_SIZE_IN_BITS == 64
, "-Wl,-u,hs_atomicwrite64" , "-Wl,-u,hs_atomicwrite64"
#endif #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 #endif
/* Pick up static libraries in preference over dynamic if in earlier search /* Pick up static libraries in preference over dynamic if in earlier search
......
...@@ -250,6 +250,9 @@ library ...@@ -250,6 +250,9 @@ library
"-Wl,-u,_hs_atomicwrite8" "-Wl,-u,_hs_atomicwrite8"
"-Wl,-u,_hs_atomicwrite16" "-Wl,-u,_hs_atomicwrite16"
"-Wl,-u,_hs_atomicwrite32" "-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 else
ld-options: ld-options:
"-Wl,-u,base_GHCziTopHandler_runIO_closure" "-Wl,-u,base_GHCziTopHandler_runIO_closure"
...@@ -320,6 +323,9 @@ library ...@@ -320,6 +323,9 @@ library
"-Wl,-u,hs_atomicwrite8" "-Wl,-u,hs_atomicwrite8"
"-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite16"
"-Wl,-u,hs_atomicwrite32" "-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) if os(osx)
ld-options: "-Wl,-search_paths_first" ld-options: "-Wl,-search_paths_first"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment