diff --git a/lib/common/portability_macros.h b/lib/common/portability_macros.h index 2143817f..23a65088 100644 --- a/lib/common/portability_macros.h +++ b/lib/common/portability_macros.h @@ -134,4 +134,15 @@ # define ZSTD_ENABLE_ASM_X86_64_BMI2 0 #endif +/* + * For x86 ELF targets, add .note.gnu.property section for Intel CET in + * assembly sources when CET is enabled. + */ +#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__)) \ + && defined(__has_include) +# if __has_include() +# include +# endif +#endif + #endif /* ZSTD_PORTABILITY_MACROS_H */