forked from kraj/meta-clang
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler-rt-sanitizers: Fix hwsan builds with llvm libunwind
Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
recipes-devtools/clang/clang/0034-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From fbc9b98b9f668bb6729c7f4c6cc9de9d40c674ce Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <raj.khem@gmail.com> | ||
Date: Sat, 29 May 2021 13:42:25 -0700 | ||
Subject: [PATCH] compiler-rt: Use uintptr_t instead of _Unwind_Word | ||
|
||
_Unwind_Word is defined in compiler specific unwind.h but not in | ||
libunwind provided unwind.h header, it works in most cases because | ||
compilers search compiler headers ahead of system headers but for some | ||
systems e.g. musl bases systems the compiler provided versions are not | ||
preferred over system headers and therefore relying on _Unwind_Word | ||
means its expecting this define in all unwind.h headers which is not the | ||
case, using uintptr_t means we don't need this from unwind.h | ||
|
||
See https://reviews.llvm.org/D65699 | ||
|
||
Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
--- | ||
compiler-rt/lib/hwasan/hwasan_exceptions.cpp | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp | ||
index 169e7876cb58..6ed1da335428 100644 | ||
--- a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp | ||
+++ b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp | ||
@@ -29,8 +29,8 @@ typedef _Unwind_Reason_Code PersonalityFn(int version, _Unwind_Action actions, | ||
// is statically linked and the sanitizer runtime and the program are linked | ||
// against different unwinders. The _Unwind_Context data structure is opaque so | ||
// it may be incompatible between unwinders. | ||
-typedef _Unwind_Word GetGRFn(_Unwind_Context* context, int index); | ||
-typedef _Unwind_Word GetCFAFn(_Unwind_Context* context); | ||
+typedef uintptr_t GetGRFn(_Unwind_Context* context, int index); | ||
+typedef uintptr_t GetCFAFn(_Unwind_Context* context); | ||
|
||
extern "C" SANITIZER_INTERFACE_ATTRIBUTE _Unwind_Reason_Code | ||
__hwasan_personality_wrapper(int version, _Unwind_Action actions, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters