fix asm on x86_64 macos

This commit is contained in:
Brent Cook 2023-05-26 21:51:56 -05:00
parent 76d053c3a8
commit 419fbd6fba
3 changed files with 11 additions and 2 deletions

View File

@ -344,7 +344,7 @@ if(ENABLE_ASM)
endif()
add_definitions(-DHAVE_GNU_STACK)
elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(ENABLE_ASM false)
set(HOST_ASM_MACOSX_X86_64 true)
elseif(MSVC AND ("${CMAKE_GENERATOR}" MATCHES "Win64" OR "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64"))
set(HOST_ASM_MASM_X86_64 true)
ENABLE_LANGUAGE(ASM_MASM)

View File

@ -122,7 +122,7 @@ AM_CONDITIONAL([HOST_ASM_ELF_MIPS64],
AM_CONDITIONAL([HOST_ASM_ELF_X86_64],
[test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64],
[test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" == "xenabled"])
[test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
AM_CONDITIONAL([HOST_ASM_MASM_X86_64],
[test "x$HOST_ABI" = "xmasm" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"])
AM_CONDITIONAL([HOST_ASM_MINGW64_X86_64],

View File

@ -194,6 +194,11 @@ fixup_masm() {
> $2
}
fixup_macosx() {
echo Fixing up $2
sed -e 's/endbr64//' $1 > $2
}
# generate assembly crypto algorithms
asm_src=$libcrypto_src
gen_asm_stdout() {
@ -205,6 +210,8 @@ gen_asm_stdout() {
EOF
if [ $1 = "masm" ]; then
fixup_masm crypto/$3.tmp crypto/$3
elif [ $1 = "macosx" ]; then
fixup_macosx crypto/$3.tmp crypto/$3
else
$MV crypto/$3.tmp crypto/$3
fi
@ -231,6 +238,8 @@ gen_asm() {
EOF
if [ $1 = "masm" ]; then
fixup_masm crypto/$3.tmp crypto/$3
elif [ $1 = "macosx" ]; then
fixup_macosx crypto/$3.tmp crypto/$3
else
$MV crypto/$3.tmp crypto/$3
fi