x86: Enable Intel CET
When Intel CET is enabled, we need to include <cet.h> in assembly codes to mark Intel CET support and place _CET_ENDBR at the function entry.
This commit is contained in:
parent
dc6b04c375
commit
53ee0b76bb
9
common.h
9
common.h
|
@ -416,6 +416,15 @@ please https://github.com/xianyi/OpenBLAS/issues/246
|
||||||
#include "common_alpha.h"
|
#include "common_alpha.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && defined(__CET__) && defined(__has_include)
|
||||||
|
#if __has_include(<cet.h>)
|
||||||
|
#include <cet.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef _CET_ENDBR
|
||||||
|
#define _CET_ENDBR
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
#include "common_x86.h"
|
#include "common_x86.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -340,7 +340,8 @@ REALNAME:
|
||||||
.align 16; \
|
.align 16; \
|
||||||
.globl REALNAME ;\
|
.globl REALNAME ;\
|
||||||
.type REALNAME, @function; \
|
.type REALNAME, @function; \
|
||||||
REALNAME:
|
REALNAME: \
|
||||||
|
_CET_ENDBR
|
||||||
|
|
||||||
#ifdef PROFILE
|
#ifdef PROFILE
|
||||||
#define PROFCODE call mcount
|
#define PROFCODE call mcount
|
||||||
|
|
|
@ -451,7 +451,8 @@ REALNAME:
|
||||||
.align 512; \
|
.align 512; \
|
||||||
.globl REALNAME ;\
|
.globl REALNAME ;\
|
||||||
.type REALNAME, @function; \
|
.type REALNAME, @function; \
|
||||||
REALNAME:
|
REALNAME: \
|
||||||
|
_CET_ENDBR
|
||||||
|
|
||||||
#ifdef PROFILE
|
#ifdef PROFILE
|
||||||
#define PROFCODE call *mcount@GOTPCREL(%rip)
|
#define PROFCODE call *mcount@GOTPCREL(%rip)
|
||||||
|
|
Loading…
Reference in New Issue