You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i#3161: Add pure-static-client-DR-app support (#7177)
Adds support for statically linking a client and DR into a pure-static
application.
The code support for this involves expecting to not find symbols via
dlsym and to instead directly invoke dr_client_main(). A weak copy of
dr_client_main() is added to avoid problems with static DR used in
standalone mode.
Since even static client libraries today pull in the shared DR library,
getting CMake to build a pure static binary with a client occupies the
bulk of the changes here:
+ A new cmake routine configure_DynamoRIO_static_client() is added which
links with dynamorio_static instead of dynamorio.
+ Static libz libraries are identified in an admittedly hacky manner.
+ A new client library variant "_drstatic" is added (alongside today's
base shared library and "_static" variant) for all the ext/ libraries.
This is identical to "_static" except it uses
configure_DynamoRIO_static_client(). A drmemtrace_drstatic variant is
also added, which also links with static libz.
+ The drmemtrace weak dr_client_main no longer works with the new
dynamorio_static weak symbol so it is instead made strong and removed
completely when DRMEMTRACE_NO_MAIN is defined; a drmemtrace_nomain
variant is created with this set.
A new test tool.drcacheoff.purestatic is added which verifies that a
static client and DR linked into a pure-static binary all work together.
It is difficult to get it to link on Ubuntu20, when cross-compiling, and
in other setups due to the need for a static libpthread and other
requirements, so the test is limited to Ubuntu22 64-bit where it is
added to the test list there and confirmed to be built and run:
```
8/11 Test #414: code_api|tool.drcacheoff.purestatic ... Passed 2.04 sec
```
Fixes#3161
0 commit comments