- Include <cet.h> in sanitizer_common/sanitizer_asm.h, if it exists, to mark Intel CET support when Intel CET is enabled.
- Define _CET_ENDBR as empty if it isn't defined.
- Add _CET_ENDBR to function entries in assembly codes so that ENDBR instruction will be generated when Intel CET is enabled.
Tested on Intel Tiger Lake with Intel CET enabled.
Hi, @hjl.tools
We had better guard the cet.h header using "linux" macro, since CET is only implemented on x86.x86_64 linux platforms currently.
Thanks very much.