i2pd: backport upstream fix for i386
authorRosen Penev <rosenp@gmail.com>
Thu, 10 Dec 2020 23:00:43 +0000 (15:00 -0800)
committerRosen Penev <rosenp@gmail.com>
Sat, 12 Dec 2020 00:59:52 +0000 (16:59 -0800)
Fixes compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/i2pd/Makefile
net/i2pd/patches/010-config.patch
net/i2pd/patches/020-x86.patch [new file with mode: 0644]

index 2bcc74042d2e8c8b8ad6506f6e8f083600734661..a16ba91509cd4af82301a22ccfef9488b28847ab 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=i2pd
 PKG_VERSION:=2.35.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)?
index be0584a4cb3cae2bfd7198a1da42876223461cc0..c0d9c44d55809b721412dc0d36d552db0559efa6 100644 (file)
@@ -1,5 +1,3 @@
-diff --git a/contrib/i2pd.conf b/contrib/i2pd.conf
-index 5ef39bc9..8d5034eb 100644
 --- a/contrib/i2pd.conf
 +++ b/contrib/i2pd.conf
 @@ -8,12 +8,12 @@
diff --git a/net/i2pd/patches/020-x86.patch b/net/i2pd/patches/020-x86.patch
new file mode 100644 (file)
index 0000000..6e407f1
--- /dev/null
@@ -0,0 +1,32 @@
+From ca3b8191510c1006d031d02c50edcf6b4f6a6e8f Mon Sep 17 00:00:00 2001
+From: R4SAS <r4sas@i2pmail.org>
+Date: Thu, 10 Dec 2020 18:32:41 +0300
+Subject: [PATCH] [avx] check ig c++ target supports AVX
+
+Signed-off-by: R4SAS <r4sas@i2pmail.org>
+---
+ libi2pd/Crypto.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libi2pd/Crypto.cpp
++++ b/libi2pd/Crypto.cpp
+@@ -638,7 +638,7 @@ namespace crypto
+       {
+               uint64_t buf[256];
+               uint64_t hash[12]; // 96 bytes
+-#if defined(__x86_64__) || defined(__i386__)
++#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
+               if(i2p::cpu::avx)
+               {
+                       __asm__
+--- a/libi2pd/Identity.cpp
++++ b/libi2pd/Identity.cpp
+@@ -828,7 +828,7 @@ namespace data
+       XORMetric operator^(const IdentHash& key1, const IdentHash& key2)
+       {
+               XORMetric m;
+-#if defined(__x86_64__) || defined(__i386__)
++#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
+               if(i2p::cpu::avx)
+               {
+                       __asm__