Skip to content

Commit e8f882f

Browse files
committed
[sanitizer] Handle Gentoo's libstdc++ path
On Gentoo, libc++ is indeed in /usr/include/c++/*, but libstdc++ is at e.g. /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14. Use '/include/g++' as it should be unique enough. Note that the omission of a trailing slash is intentional to match g++-*. See #78534 (comment). Reviewed by: mgorny Closes: #79264 Signed-off-by: Sam James <[email protected]>
1 parent faef68b commit e8f882f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
3434
return true;
3535
const char *file = frame->info.file;
3636
const char *module = frame->info.module;
37+
// On Gentoo, the path is g++-*, so there's *not* a missing /.
3738
if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
38-
internal_strstr(file, "/include/c++/")))
39+
internal_strstr(file, "/include/c++/") ||
40+
internal_strstr(file, "/include/g++")))
3941
return true;
4042
if (module && (internal_strstr(module, "libclang_rt.")))
4143
return true;

0 commit comments

Comments
 (0)