firefox/0003-fix-build-failure-due-to-arc4random-feature-activated.patch

52 lines
1.8 KiB
Diff

From 782e0bd5d5b00a95833a1f187b856f9632331e84 Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Tue, 14 Feb 2023 16:19:03 +0800
Subject: [PATCH] fix build failure due to arc4random feature activated
---
ipc/chromium/src/third_party/libevent/arc4random.c | 2 +-
old-configure | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ipc/chromium/src/third_party/libevent/arc4random.c b/ipc/chromium/src/third_party/libevent/arc4random.c
index a2338e6..0dee5b4 100644
--- a/ipc/chromium/src/third_party/libevent/arc4random.c
+++ b/ipc/chromium/src/third_party/libevent/arc4random.c
@@ -494,7 +494,7 @@ arc4random(void)
}
#endif
-ARC4RANDOM_EXPORT void
+void
arc4random_buf(void *buf_, size_t n)
{
unsigned char *buf = buf_;
diff --git a/old-configure b/old-configure
index d37324e..a175081 100644
--- a/old-configure
+++ b/old-configure
@@ -6504,6 +6504,11 @@ fi
for ac_func in stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize gmtime_r localtime_r arc4random arc4random_buf mallinfo gettid lchown setpriority strerror syscall
do
+if [ "$ac_func" == "arc4random" ] || [ "$ac_func" == "arc4random_buf" ];then
+ ac_exeext_addend=t
+else
+ ac_exeext_addend=
+fi
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6509: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
@@ -6537,7 +6542,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}${ac_exeext_addend}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
--
2.27.0