@@ -30,8 +30,11 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
30
30
_Unwind_Personality_Fn );
31
31
#endif
32
32
33
- #if __has_feature (ptrauth_qualifier )
33
+ #if __has_feature (ptrauth_calls ) || defined( __PTRAUTH__ )
34
34
#include <ptrauth.h>
35
+
36
+ #define __gcc_personality_has_ptrauth 1
37
+
35
38
#if __has_feature (ptrauth_restricted_intptr_qualifier )
36
39
#define __ptrauth_gcc_personality_intptr (key , addressDiscriminated , \
37
40
discriminator ) \
@@ -42,6 +45,7 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
42
45
__ptrauth(key, addressDiscriminated, discriminator)
43
46
#endif
44
47
#else
48
+ #define __gcc_personality_has_ptrauth 0
45
49
#define __ptrauth_gcc_personality_intptr (...)
46
50
#endif
47
51
@@ -283,7 +287,7 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
283
287
_Unwind_SetGR (context , __builtin_eh_return_data_regno (1 ), 0 );
284
288
size_t __ptrauth_gcc_personality_lpad landingPad =
285
289
funcStart + landingPadOffset ;
286
- #if __has_feature ( ptrauth_qualifier )
290
+ #if __gcc_personality_has_ptrauth
287
291
uintptr_t stackPointer = _Unwind_GetGR (context , -2 );
288
292
const uintptr_t existingDiscriminator =
289
293
ptrauth_blend_discriminator (& landingPad ,
0 commit comments