Skip to content

Commit

Permalink
[sanitizer] Handle Gentoo's libstdc++ path
Browse files Browse the repository at this point in the history
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 llvm#78534 (comment).

Reviewed by: mgorny
Closes: llvm#79264

Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit e8f882f)
  • Loading branch information
thesamesam authored and tstellar committed Feb 14, 2024
1 parent d919f54 commit 29b4097
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
return true;
const char *file = frame->info.file;
const char *module = frame->info.module;
// On Gentoo, the path is g++-*, so there's *not* a missing /.
if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
internal_strstr(file, "/include/c++/")))
internal_strstr(file, "/include/c++/") ||
internal_strstr(file, "/include/g++")))
return true;
if (module && (internal_strstr(module, "libclang_rt.")))
return true;
Expand Down

0 comments on commit 29b4097

Please sign in to comment.