Skip to content

Commit

Permalink
Adding support for armv7 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
feldenthorne committed Feb 21, 2015
1 parent 0a41bcd commit 0104675
Show file tree
Hide file tree
Showing 4 changed files with 620 additions and 6 deletions.
18 changes: 16 additions & 2 deletions diamond.pro
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,21 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
DEFINES += HAVE_BUILD_INFO
}

QMAKE_CXXFLAGS += -msse2
QMAKE_CFLAGS += -msse2
# If we have an arm device, we can't use sse2, so define as thumb
# Because of scrypt_mine.cpp, we also have to add a compile
# flag that states we *really* don't have SSE
# Otherwise, assume sse2 exists
!equals($$QMAKE_HOST.arch, armv7l) {
message(FOUND host = $$QMAKE_HOST.arch)
QMAKE_CXXFLAGS += -mthumb -DNOSSE
QMAKE_CFLAGS += -mthumb -DNOSSE
}
else {
QMAKE_CXXFLAGS += -msse2
QMAKE_CFLAGS += -msse2
}
#endif

QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector

# Input
Expand Down Expand Up @@ -275,6 +288,7 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/kernel.cpp \
src/scrypt-x86.S \
src/scrypt-x86_64.S \
src/scrypt-arm.S \
src/scrypt_mine.cpp \
src/pbkdf2.cpp \
src/hash.cpp \
Expand Down
17 changes: 15 additions & 2 deletions src/makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,18 @@ DEBUGFLAGS=-g

# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
xCXXFLAGS=-O2 -msse2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)

# If we have an arm device, we can't use sse2, so define as thumb
# Otherwise, assume sse2 exists
# xCPUARCH is passed in as a define (xCPUARCH=armv7l)
ifeq ($(xCPUARCH),armv7l)
xCXXFLAGS+=-mthumb -DNOSSE
else
xCXXFLAGS+=-msse2
endif

# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
# adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
Expand Down Expand Up @@ -135,7 +144,8 @@ OBJS= \
obj/pbkdf2.o \
obj/scrypt_mine.o \
obj/scrypt-x86.o \
obj/scrypt-x86_64.o
obj/scrypt-x86_64.o \
obj/scrypt-arm.o


all: diamondd
Expand All @@ -158,6 +168,9 @@ obj/scrypt-x86.o: scrypt-x86.S
obj/scrypt-x86_64.o: scrypt-x86_64.S
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<

obj/scrypt-arm.o: scrypt-arm.S
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<

obj/%.o: %.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
Expand Down

0 comments on commit 0104675

Please sign in to comment.