- libunwind does not build with GCC due to a change introduced in adf1561d6ce8 which uses the clang-only __has_feature macro.
- The problem is resolved by defining an "Is asan present?" macro that works across different compilers
Details
Details
- Reviewers
compnerd - Group Reviewers
Restricted Project - Commits
- rGe03be2efe564: unwind: allow building with GCC
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Hi all :)
I am new to contributing to LLVM. This change fixes a broken build when bootstrapping with gcc. Both gcc and msvc define the SANITIZE_ADDRESS macro when using asan.
Please give me any and all feedback. I am happy to make changes.
libunwind/src/libunwind.cpp | ||
---|---|---|
24 | I think that I would rather see this as: #if !defined(__has_feature) #define __has_feature(feature) 0 #endif Then you can use # if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) below. That along with a comment would be sufficient. The GCC check would still be insufficient as it doesn't cover KASAN, but I don't believe that GCC supports that currently. |
Comment Actions
Responded to comments from Saleem. Apologies for the noise in getting the diff correct. I had not used arc before.
I think that I would rather see this as:
Then you can use # if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) below.
That along with a comment would be sufficient. The GCC check would still be insufficient as it doesn't cover KASAN, but I don't believe that GCC supports that currently.