commit 83bb7f7ee98c29a5aa65d65c423baa6d4a27adf7
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sun May 21 16:05:00 2023 +0100
fix
2011.patch | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
zerotier-one.spec | 6 +--
2 files changed, 124 insertions(+), 4 deletions(-)
---
diff --git a/2011.patch b/2011.patch
new file mode 100644
index 0000000..d89f983
--- /dev/null
+++ b/2011.patch
@@ -0,0 +1,122 @@
+From 8ea09ba6bde0629d4cd1ab4681a5d96744b718fc Mon Sep 17 00:00:00 2001
+From: Michael C <michael(a)mchang.name>
+Date: Fri, 19 May 2023 13:41:02 -0400
+Subject: [PATCH 1/3] remove rustc --release flag
+
+---
+ make-linux.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/make-linux.mk b/make-linux.mk
+index 3b448afb0..9670bbbf8 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -71,7 +71,7 @@ else
+ CXXFLAGS?=-O3 -fstack-protector
+ override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG
$(DEFS)
+ LDFLAGS=-pie -Wl,-z,relro,-z,now
+- RUSTFLAGS=--release
++ RUSTFLAGS=
+ endif
+
+ ifeq ($(ZT_QNAP), 1)
+
+From 30c726826721e94c1624abe4ce4b1da39f66bc89 Mon Sep 17 00:00:00 2001
+From: Michael C <michael(a)mchang.name>
+Date: Fri, 19 May 2023 14:44:41 -0400
+Subject: [PATCH 2/3] add CARGOFLAGS
+
+---
+ make-linux.mk | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/make-linux.mk b/make-linux.mk
+index 9670bbbf8..00a557504 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -62,6 +62,7 @@ ifeq ($(ZT_DEBUG),1)
+ override CXXFLAGS+=-Wall -Wno-deprecated -g -O -std=c++17 -pthread $(INCLUDES) $(DEFS)
+ ZT_TRACE=1
+ RUSTFLAGS=
++ CARGOFLAGS=
+ # The following line enables optimization for the crypto code, since
+ # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
+ node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g
-pthread $(INCLUDES) $(DEFS)
+@@ -72,6 +73,7 @@ else
+ override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG
$(DEFS)
+ LDFLAGS=-pie -Wl,-z,relro,-z,now
+ RUSTFLAGS=
++ CARGOFLAGS=--release
+ endif
+
+ ifeq ($(ZT_QNAP), 1)
+@@ -410,8 +412,8 @@ debug: FORCE
+ ifeq ($(ZT_SSO_SUPPORTED), 1)
+ ifeq ($(ZT_EMBEDDED),)
+ zeroidc: FORCE
+-# export PATH=/root/.cargo/bin:$$PATH; cd zeroidc && cargo build -j1
$(RUSTFLAGS)
+- export PATH=/${HOME}/.cargo/bin:$$PATH; cd zeroidc && cargo build $(RUSTFLAGS)
++# export PATH=/root/.cargo/bin:$$PATH; cd zeroidc && cargo build -j1
$(CARGOFLAGS)
++ export PATH=/${HOME}/.cargo/bin:$$PATH; cd zeroidc && cargo build
$(CARGOFLAGS)
+ endif
+ else
+ zeroidc:
+@@ -474,6 +476,7 @@ echo_flags:
+ @echo "echo_flags :: CXXFLAGS=$(CXXFLAGS)"
+ @echo "echo_flags :: LDFLAGS=$(LDFLAGS)"
+ @echo "echo_flags :: RUSTFLAGS=$(RUSTFLAGS)"
++ @echo "echo_flags :: CARGOFLAGS=$(CARGOFLAGS)"
+ @echo "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~"
+
+ debian: echo_flags
+
+From 688808dc6303405e2e58a4c6592c8275c5b820e9 Mon Sep 17 00:00:00 2001
+From: Michael C <michael(a)mchang.name>
+Date: Fri, 19 May 2023 15:13:07 -0400
+Subject: [PATCH 3/3] switch to cargo rustc for compiler flags
+
+---
+ make-linux.mk | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/make-linux.mk b/make-linux.mk
+index 00a557504..06107c49a 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -62,7 +62,6 @@ ifeq ($(ZT_DEBUG),1)
+ override CXXFLAGS+=-Wall -Wno-deprecated -g -O -std=c++17 -pthread $(INCLUDES) $(DEFS)
+ ZT_TRACE=1
+ RUSTFLAGS=
+- CARGOFLAGS=
+ # The following line enables optimization for the crypto code, since
+ # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
+ node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g
-pthread $(INCLUDES) $(DEFS)
+@@ -72,8 +71,7 @@ else
+ CXXFLAGS?=-O3 -fstack-protector
+ override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG
$(DEFS)
+ LDFLAGS=-pie -Wl,-z,relro,-z,now
+- RUSTFLAGS=
+- CARGOFLAGS=--release
++ RUSTFLAGS=--release
+ endif
+
+ ifeq ($(ZT_QNAP), 1)
+@@ -412,8 +410,8 @@ debug: FORCE
+ ifeq ($(ZT_SSO_SUPPORTED), 1)
+ ifeq ($(ZT_EMBEDDED),)
+ zeroidc: FORCE
+-# export PATH=/root/.cargo/bin:$$PATH; cd zeroidc && cargo build -j1
$(CARGOFLAGS)
+- export PATH=/${HOME}/.cargo/bin:$$PATH; cd zeroidc && cargo build
$(CARGOFLAGS)
++# export PATH=/root/.cargo/bin:$$PATH; cd zeroidc && cargo rustc -j1
$(RUSTFLAGS)
++ export PATH=/${HOME}/.cargo/bin:$$PATH; cd zeroidc && cargo rustc $(RUSTFLAGS)
+ endif
+ else
+ zeroidc:
+@@ -476,7 +474,6 @@ echo_flags:
+ @echo "echo_flags :: CXXFLAGS=$(CXXFLAGS)"
+ @echo "echo_flags :: LDFLAGS=$(LDFLAGS)"
+ @echo "echo_flags :: RUSTFLAGS=$(RUSTFLAGS)"
+- @echo "echo_flags :: CARGOFLAGS=$(CARGOFLAGS)"
+ @echo "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~"
+
+ debian: echo_flags
diff --git a/zerotier-one.spec b/zerotier-one.spec
index 09170a3..287a59a 100644
--- a/zerotier-one.spec
+++ b/zerotier-one.spec
@@ -1,8 +1,5 @@
#global toolchain clang
-# /usr/bin/debugedit: Cannot handle 8-byte build ID
-%ifarch %{arm}
-%global debug_package %{nil}
-%endif
+%global _default_patch_fuzz 1
Name: zerotier-one
Version: 1.10.6
@@ -47,6 +44,7 @@ Source2: zerotier-one-sysusers
# for use vendor directory for build
Patch0: zerotier-use-vendor-archive.patch
+Patch1:
https://github.com/zerotier/ZeroTierOne/pull/2011.patch
BuildRequires: cargo
BuildRequires: gcc-c++