Aggressive inlining breaks static detach
Created by: Carrotman42
For static detach, we decide when to stop interpretting and start running code natively based on whether the App PC the next basic block to run is in a static set of PCs:
Unfortunately, when DR is compiled statically and link-time-optimizations are enabled, the application is not guaranteed to actually run that code at that location: internally we call dr_app_stop_and_cleanup_with_stats in a helper function, and in some cases it is inlined into our helper function, causing our helper to be the one who calls directly into detach_on_permanent_stack. This ends up causing self-interp and crashes when we hit a TLS action while using drcachesim.
My first thought is to disable inlining for all of the relevant stopping points.