Skip to content

Commit

Permalink
Fix compilation on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjones committed Aug 6, 2015
1 parent 231be03 commit a30e5cc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
6 changes: 1 addition & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ 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

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
19 changes: 19 additions & 0 deletions aesb-arm.S
Original file line number Diff line number Diff line change
@@ -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:
6 changes: 6 additions & 0 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[]) {
Expand Down

0 comments on commit a30e5cc

Please sign in to comment.