Skip to content

Commit

Permalink
[compiler-rt] Avoid pulling in __cxa_pure_virtual
Browse files Browse the repository at this point in the history
When building optimized versions of the runtime libraries the compiler
is generally able to elide these references, but when building them
for maximum debug info (with -O0), these references remain which causes
the test suite to fail for tests that do not pull in the C++ standard
library.

Reviewed By: vitalybuka

Pull Request: #84613
  • Loading branch information
arichardson committed Mar 21, 2024
1 parent e470ca8 commit b8e5363
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ class StackTracePrinter {

virtual void RenderFrame(InternalScopedString *buffer, const char *format,
int frame_no, uptr address, const AddressInfo *info,
bool vs_style,
const char *strip_path_prefix = "") = 0;
bool vs_style, const char *strip_path_prefix = "") {
// Should be pure virtual, but we can't depend on __cxa_pure_virtual.
UNIMPLEMENTED();
}

virtual bool RenderNeedsSymbolization(const char *format) = 0;
virtual bool RenderNeedsSymbolization(const char *format) {
// Should be pure virtual, but we can't depend on __cxa_pure_virtual.
UNIMPLEMENTED();
}

void RenderSourceLocation(InternalScopedString *buffer, const char *file,
int line, int column, bool vs_style,
Expand All @@ -44,7 +49,10 @@ class StackTracePrinter {
const char *strip_path_prefix);
virtual void RenderData(InternalScopedString *buffer, const char *format,
const DataInfo *DI,
const char *strip_path_prefix = "") = 0;
const char *strip_path_prefix = "") {
// Should be pure virtual, but we can't depend on __cxa_pure_virtual.
UNIMPLEMENTED();
}

private:
// To be called from StackTracePrinter::GetOrInit
Expand Down

0 comments on commit b8e5363

Please sign in to comment.