diff options
author | Remi Collet <remi@remirepo.net> | 2024-11-15 07:05:54 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-11-15 07:05:54 +0100 |
commit | 496ff0ba3bc63105e17e0f7af961b109396e56fb (patch) | |
tree | 36d412cad0964c681e254023379be92d45d6c597 /upstream.patch | |
parent | e6e87ae1eb6dc0c96b81c3415711d2da8b61a581 (diff) |
test build for upstream patch fixing build failure on EL-10
https://github.com/memcached/memcached/issues/1186
Diffstat (limited to 'upstream.patch')
-rw-r--r-- | upstream.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/upstream.patch b/upstream.patch new file mode 100644 index 0000000..6cac41c --- /dev/null +++ b/upstream.patch @@ -0,0 +1,52 @@ +From 08b00579fd9d2abd5d5116bbda27f8eceaba6038 Mon Sep 17 00:00:00 2001 +From: dormando <dormando@rydia.net> +Date: Thu, 14 Nov 2024 10:04:12 -0800 +Subject: [PATCH] proxy: fix compilation issue on beta RHEL/GCC + +Apparently _rotl no-go as a function name. no idea why but we generally +use the mcp_ and _mcp namespace anyway. + +Fixes #1186 +--- + proxy_lua.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/proxy_lua.c b/proxy_lua.c +index 8a579d7ab..4309f0167 100644 +--- a/proxy_lua.c ++++ b/proxy_lua.c +@@ -1409,13 +1409,13 @@ static int mcplib_log_req(lua_State *L) { + return 0; + } + +-static inline uint32_t _rotl(const uint32_t x, int k) { ++static inline uint32_t _mcp_rotl(const uint32_t x, int k) { + return (x << k) | (x >> (32 - k)); + } + + // xoroshiro128++ 32bit version. +-static uint32_t _nextrand(uint32_t *s) { +- const uint32_t result = _rotl(s[0] + s[3], 7) + s[0]; ++static uint32_t _mcp_nextrand(uint32_t *s) { ++ const uint32_t result = _mcp_rotl(s[0] + s[3], 7) + s[0]; + + const uint32_t t = s[1] << 9; + +@@ -1426,7 +1426,7 @@ static uint32_t _nextrand(uint32_t *s) { + + s[2] ^= t; + +- s[3] = _rotl(s[3], 11); ++ s[3] = _mcp_rotl(s[3], 11); + + return result; + } +@@ -1474,7 +1474,7 @@ static int mcplib_log_reqsample(lua_State *L) { + } else if (rate > 0) { + // slightly biased random-to-rate without adding a loop, which is + // completely fine for this use case. +- uint32_t rnd = (uint64_t)_nextrand(t->proxy_rng) * (uint64_t)rate >> 32; ++ uint32_t rnd = (uint64_t)_mcp_nextrand(t->proxy_rng) * (uint64_t)rate >> 32; + if (rnd == 0) { + do_log = true; + } |