From 17eec032c8ff7b259bb24f7ac3877da86f5f0996 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 2 Jun 2014 15:33:35 +0700 Subject: [PATCH] Support 64bit_asm field on OSX --- configure.ac | 3 +++ src/field_5x52_asm.asm | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 178ccbc..29164bf 100644 --- a/configure.ac +++ b/configure.ac @@ -74,6 +74,9 @@ if test x$YASM = x; then has_64bit_asm=no else case x"$host_os" in + xdarwin*) + YASM_BINFMT=macho64 + ;; x*-gnux32) YASM_BINFMT=elfx32 ;; diff --git a/src/field_5x52_asm.asm b/src/field_5x52_asm.asm index 9237b36..5e785f7 100644 --- a/src/field_5x52_asm.asm +++ b/src/field_5x52_asm.asm @@ -10,6 +10,12 @@ BITS 64 +%ifidn __OUTPUT_FORMAT__,macho64 +%define SYM(x) _ %+ x +%else +%define SYM(x) x +%endif + ;; Procedure ExSetMult ;; Register Layout: ;; INPUT: rdi = a->n @@ -26,9 +32,9 @@ ;; rbp = Constant 0FFFFFFFFFFFFFh / t8 ;; rsi = b.n / b.n[4] / t9 - GLOBAL secp256k1_fe_mul_inner + GLOBAL SYM(secp256k1_fe_mul_inner) ALIGN 32 -secp256k1_fe_mul_inner: +SYM(secp256k1_fe_mul_inner): push rbp push rbx push r12 @@ -315,9 +321,9 @@ common_exit_norm: ;; rcx = a.n[3] / t7 ;; rbp = 0FFFFFFFFFFFFFh / t8 ;; rsi = a.n[4] / t9 - GLOBAL secp256k1_fe_sqr_inner + GLOBAL SYM(secp256k1_fe_sqr_inner) ALIGN 32 -secp256k1_fe_sqr_inner: +SYM(secp256k1_fe_sqr_inner): push rbp push rbx push r12