From a30e5cc062be863bdacb5babadd33e72d0679dbf Mon Sep 17 00:00:00 2001 From: Lucas Jones Date: Thu, 6 Aug 2015 16:52:53 +0100 Subject: [PATCH] Fix compilation on ARM --- Makefile.am | 6 +----- README.md | 2 +- aesb-arm.S | 19 +++++++++++++++++++ cpu-miner.c | 6 ++++++ 4 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 aesb-arm.S diff --git a/Makefile.am b/Makefile.am index b5687d37c..a44d14193 100644 --- a/Makefile.am +++ b/Makefile.am @@ -66,7 +66,7 @@ if ARCH_x86_64 minerd_SOURCES += sha2-x64.S scrypt-x64.S aesb-x64.S endif if ARCH_ARM -minerd_SOURCES += sha2-arm.S scrypt-arm.S +minerd_SOURCES += sha2-arm.S scrypt-arm.S aesb-arm.S crypto/aesb-x86-impl.c endif endif @@ -74,7 +74,3 @@ minerd_LDFLAGS = $(PTHREAD_FLAGS) minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@ minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@ minerd_CFLAGS = -Ofast -flto -fuse-linker-plugin - -if HAVE_WINDOWS -minerd_CFLAGS += -Wl,--stack,10485760 -endif diff --git a/README.md b/README.md index 65a763207..7ce7c1cf7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ CPUMiner-Multi ============== -[![Build Status](https://travis-ci.org/LucasJones/cpuminer-multi.svg?branch=master)](https://travis-ci.org/LucasJones/cpuminer-multi) +[![Build Status](https://travis-ci.org/lucasjones/cpuminer-multi.svg?branch=master)](https://travis-ci.org/LucasJones/cpuminer-multi) This is a multi-threaded CPU miner, fork of [pooler](//github.com/pooler)'s cpuminer (see AUTHORS for list of contributors). diff --git a/aesb-arm.S b/aesb-arm.S new file mode 100644 index 000000000..c91e3dfb3 --- /dev/null +++ b/aesb-arm.S @@ -0,0 +1,19 @@ +#include "cpuminer-config.h" + +#if defined(__linux__) && defined(__ELF__) + .section .note.GNU-stack,"",%progbits +#endif + + .text + .p2align 6 + .globl fast_aesb_single_round + .globl _fast_aesb_single_round +fast_aesb_single_round: +_fast_aesb_single_round: + + .text + .p2align 6 + .globl fast_aesb_pseudo_round_mut + .globl _fast_aesb_pseudo_round_mut +fast_aesb_pseudo_round_mut: +_fast_aesb_pseudo_round_mut: diff --git a/cpu-miner.c b/cpu-miner.c index 555c8ba0e..1652a281f 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -1818,17 +1818,23 @@ static void signal_handler(int sig) { } #endif +#ifndef __arm__ static inline int cpuid(int code, uint32_t where[4]) { asm volatile("cpuid":"=a"(*where),"=b"(*(where+1)), "=c"(*(where+2)),"=d"(*(where+3)):"a"(code)); return (int)where[0]; } +#endif static bool has_aes_ni() { + #ifdef __arm__ + return false; + #else uint32_t cpu_info[4]; cpuid(1, cpu_info); return cpu_info[2] & (1 << 25); + #endif } int main(int argc, char *argv[]) {