summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-17 22:26:08 +0000
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-17 22:26:08 +0000
commitc467c3b7e4f54b09352cd3f96b78b21fe963aace (patch)
treec89a65597aeff51be0af3c84c476841a00df7675
parentcdc0eaec3add50e1424a0bcd9d054ec140c3540b (diff)
downloadinfinitytier-c467c3b7e4f54b09352cd3f96b78b21fe963aace.tar.gz
infinitytier-c467c3b7e4f54b09352cd3f96b78b21fe963aace.zip
ARM tweaks
-rw-r--r--make-linux.mk7
-rw-r--r--node/Packet.cpp8
2 files changed, 15 insertions, 0 deletions
diff --git a/make-linux.mk b/make-linux.mk
index 17bcd158..7c77f58f 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -96,6 +96,12 @@ endif
ifeq ($(CC_MACH),arm)
ZT_ARCHITECTURE=3
endif
+ifeq ($(CC_MACH),armel)
+ ZT_ARCHITECTURE=3
+endif
+ifeq ($(CC_MACH),armhf)
+ ZT_ARCHITECTURE=3
+endif
ifeq ($(CC_MACH),armv6)
ZT_ARCHITECTURE=3
endif
@@ -114,6 +120,7 @@ DEFS+=-DZT_BUILD_PLATFORM=1 -DZT_BUILD_ARCHITECTURE=$(ZT_ARCHITECTURE) -DZT_SOFT
ifeq ($(ZT_ARCHITECTURE),3)
override CFLAGS+=-march=armv6zk -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp
override CXXFLAGS+=-march=armv6zk -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp
+ override DEFS+=-DZT_NO_TYPE_PUNNING
endif
# Define this to build a static binary, which is needed to make this runnable on a few ancient Linux distros
diff --git a/node/Packet.cpp b/node/Packet.cpp
index c825ea9b..6dfba9f3 100644
--- a/node/Packet.cpp
+++ b/node/Packet.cpp
@@ -520,6 +520,7 @@ union LZ4_streamDecode_u {
* See https://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details.
* Prefer these methods in priority order (0 > 1 > 2)
*/
+#if 0
#ifndef LZ4_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
# define LZ4_FORCE_MEMORY_ACCESS 2
@@ -528,6 +529,13 @@ union LZ4_streamDecode_u {
# define LZ4_FORCE_MEMORY_ACCESS 1
# endif
#endif
+#endif
+
+#ifdef ZT_NO_TYPE_PUNNING
+#define LZ4_FORCE_MEMORY_ACCESS 0
+#else
+#define LZ4_FORCE_MEMORY_ACCESS 2
+#endif
/*
* LZ4_FORCE_SW_BITCOUNT