Skip to content

Commit a67e0e9

Browse files
committed
firefox: fix build with glibc-2.34 II
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 parent b3d0600 commit a67e0e9

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From a8bbe99b671e5f751201e3eae8a114d87c2f08b2 Mon Sep 17 00:00:00 2001
2+
From: Martin Jansa <Martin.Jansa@gmail.com>
3+
Date: Thu, 2 Sep 2021 14:59:03 +0200
4+
Subject: [PATCH] security: Fix build with glibc-2.34
5+
6+
From https://bugzilla.redhat.com/attachment.cgi?id=1803524&action=diff
7+
8+
Fixes:
9+
0:03.15 In file included from /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/firefox-build-dir/security/sandbox/linux/launch/Unified_cpp_linux_launch0.cpp:11:
10+
0:03.15 /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/security/sandbox/linux/launch/SandboxLaunch.cpp:415:20: error: no matching function for call to 'ArrayEnd'
11+
0:03.15 void* stackPtr = ArrayEnd(miniStack);
12+
0:03.15 ^~~~~~~~
13+
14+
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15+
---
16+
security/sandbox/linux/launch/SandboxLaunch.cpp | 12 +++++++++---
17+
1 file changed, 9 insertions(+), 3 deletions(-)
18+
19+
diff --git a/security/sandbox/linux/launch/SandboxLaunch.cpp b/security/sandbox/linux/launch/SandboxLaunch.cpp
20+
index 2c179c0659..ee3bbad747 100644
21+
--- a/security/sandbox/linux/launch/SandboxLaunch.cpp
22+
+++ b/security/sandbox/linux/launch/SandboxLaunch.cpp
23+
@@ -408,7 +408,7 @@ static int CloneCallee(void* aPtr) {
24+
// we don't currently support sandboxing under valgrind.
25+
MOZ_NEVER_INLINE MOZ_ASAN_BLACKLIST static pid_t DoClone(int aFlags,
26+
jmp_buf* aCtx) {
27+
- uint8_t miniStack[PTHREAD_STACK_MIN];
28+
+ uint8_t miniStack[4096];
29+
#ifdef __hppa__
30+
void* stackPtr = miniStack;
31+
#else
32+
@@ -429,13 +429,19 @@ static pid_t ForkWithFlags(int aFlags) {
33+
CLONE_CHILD_CLEARTID;
34+
MOZ_RELEASE_ASSERT((aFlags & kBadFlags) == 0);
35+
36+
+ // Block signals due to small stack in DoClone.
37+
+ sigset_t oldSigs;
38+
+ BlockAllSignals(&oldSigs);
39+
+
40+
+ int ret = 0;
41+
jmp_buf ctx;
42+
if (setjmp(ctx) == 0) {
43+
// In the parent and just called setjmp:
44+
- return DoClone(aFlags | SIGCHLD, &ctx);
45+
+ ret = DoClone(aFlags | SIGCHLD, &ctx);
46+
}
47+
+ RestoreSignals(&oldSigs);
48+
// In the child and have longjmp'ed:
49+
- return 0;
50+
+ return ret;
51+
}
52+
53+
static bool WriteStringToFile(const char* aPath, const char* aStr,

meta-firefox/recipes-browser/firefox/firefox_68.9.0esr.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SRC_URI = "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${P
3131
file://fixes/pre-generated-old-configure.patch \
3232
file://fixes/link-with-libpangoft.patch \
3333
file://fixes/0001-Bug-1721326-Fix-build-with-glibc-2.34.patch \
34+
file://fixes/0002-security-Fix-build-with-glibc-2.34.patch \
3435
file://porting/Add-xptcall-support-for-SH4-processors.patch \
3536
file://porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch \
3637
file://porting/Work-around-Debian-bug-844357.patch \

0 commit comments

Comments
 (0)