mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
x86-64: Compile huf_decompress_amd64.S with CMAKE_C_FLAGS
Compile huf_decompress_amd64.S with CMAKE_C_FLAGS to support Intel CET: 1. Define ZSTD_CET_ENDBRANCH to endbr64 for IBT. 2. Add IBT and SHSTK markers to huf_decompress_amd64.S.o. This fixes issue #4535. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
parent
5233c58e6c
commit
c67e038c1d
1 changed files with 5 additions and 0 deletions
|
|
@ -42,6 +42,11 @@ else ()
|
|||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|AMD64.*|x86_64.*|X86_64.*" AND ${ZSTD_HAS_NOEXECSTACK})
|
||||
enable_language(ASM)
|
||||
set(DecompressSources ${DecompressSources} ${LIBRARY_DIR}/decompress/huf_decompress_amd64.S)
|
||||
# Compile huf_decompress_amd64.S with CMAKE_C_FLAGS to support
|
||||
# Intel CET:
|
||||
# 1. Define ZSTD_CET_ENDBRANCH to endbr64 for IBT.
|
||||
# 2. Add IBT and SHSTK markers to huf_decompress_amd64.S.o.
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}")
|
||||
else()
|
||||
add_compile_options(-DZSTD_DISABLE_ASM)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue