File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ macro(sdl_gnu_common_ccxx_flags var gnu_version)
36
36
else ()
37
37
append (${var} "-fstack-protector-strong" )
38
38
if (NOT (${gnu_version} VERSION_LESS 8.0) AND (DNNL_TARGET_ARCH STREQUAL "X64" ))
39
- append (${var} "-fcf-protection=full" )
39
+ check_toolchain_for_endbr64()
40
+ if (ENDBR64_SUPPORT_FLAG)
41
+ append (${var} "-fcf-protection=full" )
42
+ endif ()
40
43
endif ()
41
44
endif ()
42
45
endmacro ()
Original file line number Diff line number Diff line change @@ -174,3 +174,8 @@ function(find_libm var)
174
174
find_library (${var} m REQUIRED)
175
175
endif ()
176
176
endfunction ()
177
+
178
+ include (CheckCXXSourceCompiles)
179
+ function (check_toolchain_for_endbr64)
180
+ check_cxx_source_compiles("int main() { asm volatile(\" endbr64\" ); return 0; }" ENDBR64_SUPPORT_FLAG)
181
+ endfunction ()
You can’t perform that action at this time.
0 commit comments