diff --git a/libunwind/src/cet_unwind.h b/libunwind/src/cet_unwind.h index 45c11973cb7fa..47d7616a7322c 100644 --- a/libunwind/src/cet_unwind.h +++ b/libunwind/src/cet_unwind.h @@ -39,9 +39,13 @@ // need to guard any use of GCS instructions with __chkfeat though, as GCS may // not be enabled. #if defined(_LIBUNWIND_TARGET_AARCH64) && defined(__ARM_FEATURE_GCS_DEFAULT) -#define _LIBUNWIND_USE_GCS 1 #include +// We can only use GCS if arm_acle.h defines the GCS intrinsics. +#ifdef _CHKFEAT_GCS +#define _LIBUNWIND_USE_GCS 1 +#endif + #define _LIBUNWIND_POP_CET_SSP(x) \ do { \ if (__chkfeat(_CHKFEAT_GCS)) { \