aboutsummaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2021-06-15 08:41:07 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2021-06-15 08:41:07 +0000
commitdd5b5fe1a47fe18a4a753711435750fdae1ce353 (patch)
tree607c3f3a071144a11c05ca80770a6b4d48814292 /devel
parentb072fc2c5dbd37cea71ca9b672ddc829e98700f5 (diff)
downloadports-dd5b5fe1a47fe18a4a753711435750fdae1ce353.tar.gz
ports-dd5b5fe1a47fe18a4a753711435750fdae1ce353.zip
devel/simdjson: fix build on powerpc64
FreeBSD uses sys/endian.h header instead of byteswap.h and bswap64() instead of bswap_64(). -mpower8-vector is necessary because the port uses new SIMD introduced in POWER8. /wrkdirs/usr/ports/devel/simdjson/work/simdjson-0.9.5/include/simdjson/ppc64/numberparsing.h:4:10: fatal error: 'byteswap.h' file not found
Diffstat (limited to 'devel')
-rw-r--r--devel/simdjson/Makefile1
-rw-r--r--devel/simdjson/files/patch-include_simdjson_ppc64_numberparsing.h20
2 files changed, 21 insertions, 0 deletions
diff --git a/devel/simdjson/Makefile b/devel/simdjson/Makefile
index 269d92484b4b..d2b048bf386e 100644
--- a/devel/simdjson/Makefile
+++ b/devel/simdjson/Makefile
@@ -10,6 +10,7 @@ LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN_i386= does not build (error: unknown type name '__uint128_t')
+CXXFLAGS_powerpc64= -mpower8-vector
USES= cmake compiler:c++17-lang
USE_GITHUB= yes
diff --git a/devel/simdjson/files/patch-include_simdjson_ppc64_numberparsing.h b/devel/simdjson/files/patch-include_simdjson_ppc64_numberparsing.h
new file mode 100644
index 000000000000..225292a389e9
--- /dev/null
+++ b/devel/simdjson/files/patch-include_simdjson_ppc64_numberparsing.h
@@ -0,0 +1,20 @@
+--- include/simdjson/ppc64/numberparsing.h.orig 2021-06-13 11:45:59 UTC
++++ include/simdjson/ppc64/numberparsing.h
+@@ -1,7 +1,7 @@
+ #ifndef SIMDJSON_PPC64_NUMBERPARSING_H
+ #define SIMDJSON_PPC64_NUMBERPARSING_H
+
+-#include <byteswap.h>
++#include <sys/endian.h>
+
+ namespace simdjson {
+ namespace SIMDJSON_IMPLEMENTATION {
+@@ -14,7 +14,7 @@ parse_eight_digits_unrolled(const uint8_t *chars) {
+ uint64_t val;
+ std::memcpy(&val, chars, sizeof(uint64_t));
+ #ifdef __BIG_ENDIAN__
+- val = bswap_64(val);
++ val = bswap64(val);
+ #endif
+ val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8;
+ val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16;