0031-compiler-rt-Use-uintptr_t-instead-of-_Unwind_Word.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 978029dc7aabc1bda62f4c9c9c4633c2d147a491 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:59:58 +0800
  4. Subject: [PATCH 31/34] compiler-rt: Use uintptr_t instead of _Unwind_Word
  5. _Unwind_Word is defined in compiler specific unwind.h but not in
  6. libunwind provided unwind.h header, it works in most cases because
  7. compilers search compiler headers ahead of system headers but for some
  8. systems e.g. musl bases systems the compiler provided versions are not
  9. preferred over system headers and therefore relying on _Unwind_Word
  10. means its expecting this define in all unwind.h headers which is not the
  11. case, using uintptr_t means we don't need this from unwind.h
  12. See https://reviews.llvm.org/D65699
  13. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  14. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  15. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  16. ---
  17. compiler-rt/lib/hwasan/hwasan_exceptions.cpp | 4 ++--
  18. 1 file changed, 2 insertions(+), 2 deletions(-)
  19. diff --git a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp
  20. index 169e7876cb58..6ed1da335428 100644
  21. --- a/compiler-rt/lib/hwasan/hwasan_exceptions.cpp
  22. +++ b/compiler-rt/lib/hwasan/hwasan_exceptions.cpp
  23. @@ -29,8 +29,8 @@ typedef _Unwind_Reason_Code PersonalityFn(int version, _Unwind_Action actions,
  24. // is statically linked and the sanitizer runtime and the program are linked
  25. // against different unwinders. The _Unwind_Context data structure is opaque so
  26. // it may be incompatible between unwinders.
  27. -typedef _Unwind_Word GetGRFn(_Unwind_Context* context, int index);
  28. -typedef _Unwind_Word GetCFAFn(_Unwind_Context* context);
  29. +typedef uintptr_t GetGRFn(_Unwind_Context* context, int index);
  30. +typedef uintptr_t GetCFAFn(_Unwind_Context* context);
  31. extern "C" SANITIZER_INTERFACE_ATTRIBUTE _Unwind_Reason_Code
  32. __hwasan_personality_wrapper(int version, _Unwind_Action actions,
  33. --
  34. 2.33.1