From 419fbd6fba15beaea3f3e6d22ef9e161f032f460 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Fri, 26 May 2023 21:51:56 -0500 Subject: [PATCH] fix asm on x86_64 macos --- CMakeLists.txt | 2 +- configure.ac | 2 +- update.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e05221c316..7847830a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/configure.ac b/configure.ac index 6fe2ff426a..51e096bd90 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/update.sh b/update.sh index d42cd5867c..abf2097be1 100755 --- a/update.sh +++ b/update.sh @@ -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