Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sanitizer] Handle Gentoo's libstdc++ path #79264

Closed
wants to merge 1 commit into from

Conversation

thesamesam
Copy link
Member

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.

See #78534 (comment).

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 24, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Sam James (thesamesam)

Changes

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.

See #78534 (comment).


Full diff: https://github.com/llvm/llvm-project/pull/79264.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp (+2-1)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index 8438e019591b58..b700eca3b7beb0 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -35,7 +35,8 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
   const char *file = frame->info.file;
   const char *module = frame->info.module;
   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;

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).
Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this fixes the test failures for me. Thanks!

@mgorny mgorny added this to the LLVM 18.0.X Release milestone Jan 24, 2024
@thesamesam
Copy link
Member Author

I'll merge this probably later today or tomorrow, just want to give @vitalybuka a chance to object if he does not like the pattern I used etc.

@thesamesam thesamesam deleted the gentoo-sanitizer branch January 27, 2024 06:56
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jan 29, 2024
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)
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Jan 30, 2024
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)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
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)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
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)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
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)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants