Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler-rt/lib/builtins/gcc_personality_v0.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
_Unwind_Personality_Fn);
#endif

#ifndef __has_feature
#define __has_feature(__feature) 0
#endif

#if __has_feature(ptrauth_calls)
#include <ptrauth.h>

Expand Down
12 changes: 7 additions & 5 deletions libunwind/include/__libunwind_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
#endif // _LIBUNWIND_IS_NATIVE_ONLY

#if __has_feature(ptrauth_calls) && __has_feature(ptrauth_returns)
# define _LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING 1
#elif __has_feature(ptrauth_calls) != __has_feature(ptrauth_returns)
# error "Either both or none of ptrauth_calls and ptrauth_returns "\
"is allowed to be enabled"
#if defined(__has_feature)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's entirely reasonable to assume that if it's a gcc that doesn't support __has_feature it doesn't support pointer auth :D

# if __has_feature(ptrauth_calls) && __has_feature(ptrauth_returns)
# define _LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING 1
# elif __has_feature(ptrauth_calls) != __has_feature(ptrauth_returns)
# error "Either both or none of ptrauth_calls and ptrauth_returns "\
"is allowed to be enabled"
# endif
#endif

#endif // ____LIBUNWIND_CONFIG_H__
4 changes: 4 additions & 0 deletions libunwind/src/UnwindRegistersRestore.S
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ Lnovec:

#elif defined(__aarch64__)

#ifndef __has_feature
#define __has_feature(__feature) 0
#endif

#if defined(__ARM_FEATURE_GCS_DEFAULT)
.arch_extension gcs
#endif
Expand Down
4 changes: 4 additions & 0 deletions libunwind/src/UnwindRegistersSave.S
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,10 @@ LnoR2Fix:

#elif defined(__aarch64__)

#ifndef __has_feature
#define __has_feature(__feature) 0
#endif

//
// extern int __unw_getcontext(unw_context_t* thread_state)
//
Expand Down
Loading