Thursday, June 17, 2021

[base-gcc] fix build of net/tor

gcc 4.2.1 doesn't like the initialization with a const int (which is not
really a constant):

http://build-failures.rhaalovely.net/sparc64/2021-06-15/net/tor.log

This fixes the build on sparc64, same fix is probably needed for
-stable.

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/tor/Makefile,v
retrieving revision 1.135
diff -u -p -r1.135 Makefile
--- Makefile 15 Jun 2021 15:14:00 -0000 1.135
+++ Makefile 17 Jun 2021 05:53:44 -0000
@@ -5,6 +5,7 @@ COMMENT= anonymity service using onion r
DISTNAME= tor-0.4.6.5
CATEGORIES= net
HOMEPAGE= https://www.torproject.org/
+REVISION= 0

MAINTAINER= Pascal Stumpf <pascal@stumpf.co>

Index: patches/patch-src_feature_dirclient_dirclient_c
===================================================================
RCS file: patches/patch-src_feature_dirclient_dirclient_c
diff -N patches/patch-src_feature_dirclient_dirclient_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_feature_dirclient_dirclient_c 17 Jun 2021 05:53:31 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+src/feature/dirclient/dirclient.c:1877: error: initializer element is not constant
+
+Index: src/feature/dirclient/dirclient.c
+--- src/feature/dirclient/dirclient.c.orig
++++ src/feature/dirclient/dirclient.c
+@@ -1873,8 +1873,7 @@ dir_client_decompress_response_body(char **bodyp, size
+ /* If we're pretty sure that we have a compressed directory, and
+ * we didn't manage to uncompress it, then warn and bail. */
+ if (!plausible && !new_body) {
+- const int LOG_INTERVAL = 3600;
+- static ratelim_t warning_limit = RATELIM_INIT(LOG_INTERVAL);
++ static ratelim_t warning_limit = RATELIM_INIT(3600);
+ log_fn_ratelim(&warning_limit, LOG_WARN, LD_HTTP,
+ "Unable to decompress HTTP body (tried %s%s%s, on %s).",
+ description1,

No comments:

Post a Comment