From ac0d93b4a0088d0a2c6487f0800621c9dcf4928e Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Wed, 22 Jan 2020 23:02:11 -0500 Subject: [PATCH 1/5] New upstream release 20.5 --- cjdns.fuzz.patch | 7 ------- cjdns.python3.patch | 18 ------------------ cjdns.spec | 11 +++++++---- cjdns.warnings.patch | 9 --------- 4 files changed, 7 insertions(+), 38 deletions(-) diff --git a/cjdns.fuzz.patch b/cjdns.fuzz.patch index 3faaed6..878f7c6 100644 --- a/cjdns.fuzz.patch +++ b/cjdns.fuzz.patch @@ -12,10 +12,3 @@ diff -up ./test/Main_fuzz_test.c.fuzz ./test/Main_fuzz_test.c } } -@@ -185,4 +185,4 @@ void CJDNS_FUZZ_MAIN(void* vctx, struct - TestFramework_assertLastMessageUnaltered(ctx->nodeA); - - EventBase_beginLoop(ctx->base); --} -\ No newline at end of file -+} diff --git a/cjdns.python3.patch b/cjdns.python3.patch index f7d6464..415cdd7 100644 --- a/cjdns.python3.patch +++ b/cjdns.python3.patch @@ -23,21 +23,3 @@ diff -up ./node_build/dependencies/libuv/gyp_uv.py.python3 ./node_build/dependen - print gyp_args + print(gyp_args) run_gyp(gyp_args) -diff -up ./node_build/FindPython2.js.python3 ./node_build/FindPython2.js ---- ./node_build/FindPython2.js.python3 2019-09-19 13:14:40.677573302 -0400 -+++ ./node_build/FindPython2.js 2019-09-19 13:15:15.796056265 -0400 -@@ -16,12 +16,12 @@ var nThen = require('nthen'); - var Spawn = require('child_process').spawn; - var Fs = require('fs'); - --var PYTHONS = ["python", "python2", "python2.7", "python2.6", "python2.5"]; -+var PYTHONS = ["python", "python2", "python2.7", "python2.6", "python3"]; - - var SCRIPT = [ - 'import sys;', - 'print(sys.version_info);', -- 'exit(sys.version_info[0] != 2 or sys.version_info[1] < 7);' -+ 'exit(sys.version_info[0] < 2 or sys.version_info[1] < 6);' - ].join('\n'); - - var find = module.exports.find = function (tempFile, callback) { diff --git a/cjdns.spec b/cjdns.spec index 28899c7..27dcb1c 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -80,8 +80,8 @@ Name: cjdns # major version is cjdns protocol version: -Version: 20.4 -Release: 2%{?dist} +Version: 20.5 +Release: 1%{?dist} Summary: The privacy-friendly network without borders # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC # cnacl is unused except when use_embedded is true @@ -143,7 +143,7 @@ Patch12: cjdns.sign.patch # included in cjdns-20.1 #Patch15: cjdns.benc.patch # Specify python2 for systems that default to python3 -Patch16: cjdns.python3.patch +#Patch16: cjdns.python3.patch # s390x support for embedded cnacl library from Dan HorĂ¡k # Included upstream since 20.3 #Patch17: cjdns.s390x.patch @@ -322,7 +322,7 @@ fi #patch13 -b .ppc64 #patch14 -b .entropy #patch15 -b .benc -%patch16 -b .python3 +#patch16 -b .python3 %if 0%{use_libuv} %patch18 -p1 -b .libuv rm -rf node_build/dependencies/libuv @@ -741,6 +741,9 @@ fi %{_bindir}/graphStats %changelog +* Wed Jan 22 2020 Stuart Gathman - 20.5-1 +- New upstream release + * Wed Oct 2 2019 Stuart Gathman - 20.4-2 - Add python3 support for python API diff --git a/cjdns.warnings.patch b/cjdns.warnings.patch index 706786b..d470667 100644 --- a/cjdns.warnings.patch +++ b/cjdns.warnings.patch @@ -87,15 +87,6 @@ diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/net #endif #include #include -@@ -78,7 +79,7 @@ static int socketForIfName(const char* i - } - - memset(ifRequestOut, 0, sizeof(struct ifreq)); -- strncpy(ifRequestOut->ifr_name, interfaceName, IFNAMSIZ); -+ strncpy(ifRequestOut->ifr_name, interfaceName, IFNAMSIZ - 1); - - if (ioctl(s, SIOCGIFINDEX, ifRequestOut) < 0) { - int err = errno; @@ -167,7 +168,7 @@ void NetPlatform_addAddress(const char* Except_throw(eh, "ioctl(SIOCSIFADDR) failed: [%s]", strerror(err)); } From d6597d74b746eb63cbcd6385024994b9fc39e094 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Thu, 23 Jan 2020 00:27:52 -0500 Subject: [PATCH 2/5] New upstream source --- .gitignore | 1 + sources | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ed64f81..d2b88d7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /marked-man-0.7.0.tar.gz /cjdns-v20.4.tar.gz /python-cjdns-0.1.tar.gz +/cjdns-v20.5.tar.gz diff --git a/sources b/sources index c0f52f8..57c705f 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (cjdns-v20.4.tar.gz) = 5a6bd36b2edd07fa883efa4b14dd8a7ba0189bf43404e27ab6ae3b0c2f1e63ce738c52b34416f51f93c9752f6654ea95eac2c71897d2a1e19f4a6d1ca3bad46d SHA512 (python-cjdns-0.1.tar.gz) = f3b7c9afe6bc2f8b0b872cc7fbe9e997657ecf1cbb1f7e8e417099f1265541af919e965be2508a8613f3a2223020ac077473fe48c78f9553dda1a927364bb256 +SHA512 (cjdns-v20.5.tar.gz) = 36ae20182b9e9601ae64630cb0fa96caccbe5279be48520ea8b457a15437da5c9b48a5ae5588bd76ef819efe696b5a582a906a50e4dbe7760bb96fa7d1d63ea3 From fecb983adb68dac630bc59cab6c3615a18877fca Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Thu, 23 Jan 2020 00:53:32 -0500 Subject: [PATCH 3/5] Fix dup externs for gcc-10 --- cjdns.gcc10.patch | 48 +++++++++++++++++++++++++++++++++++++++++++++++ cjdns.spec | 3 +++ 2 files changed, 51 insertions(+) create mode 100644 cjdns.gcc10.patch diff --git a/cjdns.gcc10.patch b/cjdns.gcc10.patch new file mode 100644 index 0000000..c1dd51a --- /dev/null +++ b/cjdns.gcc10.patch @@ -0,0 +1,48 @@ +diff -up ./interface/tuntap/test/TUNTools.h.gcc10 ./interface/tuntap/test/TUNTools.h +--- ./interface/tuntap/test/TUNTools.h.gcc10 2020-01-23 00:49:32.396175244 -0500 ++++ ./interface/tuntap/test/TUNTools.h 2020-01-23 00:50:00.026580841 -0500 +@@ -29,9 +29,9 @@ typedef Iface_DEFUN (* TUNTools_Callback + + Iface_DEFUN TUNTools_genericIP6Echo(struct Message* msg, struct TUNTools* tt); + +-const uint8_t* TUNTools_testIP6AddrA; +-const uint8_t* TUNTools_testIP6AddrB; +-const uint8_t* TUNTools_testIP6AddrC; ++extern const uint8_t* TUNTools_testIP6AddrA; ++extern const uint8_t* TUNTools_testIP6AddrB; ++extern const uint8_t* TUNTools_testIP6AddrC; + + struct TUNTools + { +diff -up ./util/platform/Sockaddr.h.gcc10 ./util/platform/Sockaddr.h +--- ./util/platform/Sockaddr.h.gcc10 2019-11-25 06:38:10.000000000 -0500 ++++ ./util/platform/Sockaddr.h 2020-01-23 00:41:54.026444061 -0500 +@@ -50,11 +50,11 @@ struct Sockaddr_storage + }; + + /** 127.0.0.1 and ::1 addresses for building from. */ +-const struct Sockaddr* const Sockaddr_LOOPBACK_be; +-const struct Sockaddr* const Sockaddr_LOOPBACK_le; ++extern const struct Sockaddr* const Sockaddr_LOOPBACK_be; ++extern const struct Sockaddr* const Sockaddr_LOOPBACK_le; + #define Sockaddr_LOOPBACK (Endian_isBigEndian() ? Sockaddr_LOOPBACK_be : Sockaddr_LOOPBACK_le) + +-const struct Sockaddr* const Sockaddr_LOOPBACK6; ++extern const struct Sockaddr* const Sockaddr_LOOPBACK6; + + int Sockaddr_getPrefix(struct Sockaddr* addr); + +diff -up ./util/platform/Socket.h.gcc10 ./util/platform/Socket.h +--- ./util/platform/Socket.h.gcc10 2020-01-23 00:45:55.522991656 -0500 ++++ ./util/platform/Socket.h 2020-01-23 00:46:13.753259267 -0500 +@@ -39,8 +39,8 @@ int Socket_recvfrom(int fd, + + int Socket_connect(int fd, const struct Sockaddr* sa, struct Allocator* alloc); + +-const int Socket_SOCK_DGRAM; +-const int Socket_SOCK_STREAM; ++extern const int Socket_SOCK_DGRAM; ++extern const int Socket_SOCK_STREAM; + int Socket_socket(int af, int type, int protocol, struct Allocator* alloc); + + int Socket_bind(int fd, const struct Sockaddr* sa); diff --git a/cjdns.spec b/cjdns.spec index 27dcb1c..3bafa43 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -154,6 +154,8 @@ Patch19: cjdns.fuzz.patch Patch20: cjdns.sysctl.patch # Patch ronn to stop using deprecated util.puts and util.debug Patch21: cjdns.puts.patch +# gcc-10 no longer allows duplicate globals +Patch22: cjdns.gcc10.patch %if %{use_marked} BuildRequires: nodejs, nodejs-marked, python3 @@ -332,6 +334,7 @@ sed -i -e '/optimizeLevel:/ s/-O0/-O3/' node_build/make.js %endif %patch19 -p1 -b .fuzz #patch20 -p1 -b .sysctl +%patch22 -b .gcc10 cp %{SOURCE1} README_Fedora.md From 3518bccda1584987eac6605e8f94e14f391b5307 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Fri, 24 Jan 2020 14:39:59 -0500 Subject: [PATCH 4/5] Reduce optimization level to avoid bugs exposed by gcc-10 --- cjdns.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cjdns.spec b/cjdns.spec index 3bafa43..766df0f 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -330,7 +330,7 @@ fi rm -rf node_build/dependencies/libuv %else rm -rf node_build/dependencies/libuv/build/gyp # use system gyp -sed -i -e '/optimizeLevel:/ s/-O0/-O3/' node_build/make.js +sed -i -e '/optimizeLevel:/ s/-O0/-O2/' node_build/make.js %endif %patch19 -p1 -b .fuzz #patch20 -p1 -b .sysctl From f1233d711c8d911095497a283ebfd98abe0d3773 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Fri, 24 Jan 2020 15:04:46 -0500 Subject: [PATCH 5/5] Reduce optimization even more for s390x --- cjdns.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cjdns.spec b/cjdns.spec index 766df0f..333d7e6 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -330,8 +330,12 @@ fi rm -rf node_build/dependencies/libuv %else rm -rf node_build/dependencies/libuv/build/gyp # use system gyp +%ifarch s390x +sed -i -e '/optimizeLevel:/ s/-O0/-O1/' node_build/make.js +%else sed -i -e '/optimizeLevel:/ s/-O0/-O2/' node_build/make.js %endif +%endif %patch19 -p1 -b .fuzz #patch20 -p1 -b .sysctl %patch22 -b .gcc10