Skip to content

Commit

Permalink
fix asm on x86_64 macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Cook committed May 27, 2023
1 parent 76d053c commit 419fbd6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
9 changes: 9 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 419fbd6

Please sign in to comment.