Skip to content

Commit 22eaf4c

Browse files
committed
New package: electron39-39.2.3
1 parent 6afd95d commit 22eaf4c

File tree

46 files changed

+1809
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1809
-0
lines changed

srcpkgs/electron39-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
electron39
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/buildtools/third_party/libc++/__config_site
2+
+++ b/buildtools/third_party/libc++/__config_site
3+
@@ -25,7 +25,7 @@
4+
#define _LIBCPP_HAS_THREADS 1
5+
#define _LIBCPP_HAS_MONOTONIC_CLOCK 1
6+
#define _LIBCPP_HAS_TERMINAL 1
7+
-#define _LIBCPP_HAS_MUSL_LIBC 0
8+
+#define _LIBCPP_HAS_MUSL_LIBC 1
9+
10+
#ifdef _WIN32
11+
#define _LIBCPP_HAS_THREAD_API_PTHREAD 0
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
Source: https://git.alpinelinux.org/aports/tree/community/chromium/musl-sandbox.patch
2+
musl uses different syscalls from glibc for some functions, so the sandbox has
3+
to account for that
4+
--
5+
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
6+
index ff5a1c0..da56b9b 100644
7+
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
8+
+++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
9+
@@ -139,21 +139,11 @@ namespace sandbox {
10+
// present (as in newer versions of posix_spawn).
11+
ResultExpr RestrictCloneToThreadsAndEPERMFork() {
12+
const Arg<unsigned long> flags(0);
13+
-
14+
- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
15+
- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
16+
- CLONE_SIGHAND | CLONE_THREAD |
17+
- CLONE_SYSVSEM;
18+
- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
19+
-
20+
- const uint64_t kGlibcPthreadFlags =
21+
- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
22+
- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
23+
- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
24+
-
25+
- const BoolExpr android_test =
26+
- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
27+
- flags == kGlibcPthreadFlags);
28+
+ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
29+
+ CLONE_THREAD | CLONE_SYSVSEM;
30+
+ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
31+
+ CLONE_DETACHED;
32+
+ const BoolExpr thread_clone_ok = (flags&~safe)==required;
33+
34+
// The following two flags are the two important flags in any vfork-emulating
35+
// clone call. EPERM any clone call that contains both of them.
36+
@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
37+
AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
38+
(flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
39+
40+
- return If(IsAndroid() ? android_test : glibc_test, Allow())
41+
+ return If(thread_clone_ok, Allow())
42+
.ElseIf(is_fork_or_clone_vfork, Error(EPERM))
43+
.Else(CrashSIGSYSClone());
44+
}
45+
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
46+
index d9d1882..0567557 100644
47+
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
48+
+++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
49+
@@ -392,6 +392,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
50+
#if defined(__i386__)
51+
case __NR_waitpid:
52+
#endif
53+
+ case __NR_set_tid_address:
54+
return true;
55+
case __NR_clone: // Should be parameter-restricted.
56+
case __NR_setns: // Privileged.
57+
@@ -404,7 +405,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
58+
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
59+
case __NR_set_thread_area:
60+
#endif
61+
- case __NR_set_tid_address:
62+
case __NR_unshare:
63+
#if !defined(__mips__) && !defined(__aarch64__)
64+
case __NR_vfork:
65+
@@ -514,6 +514,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
66+
case __NR_munlock:
67+
case __NR_munmap:
68+
case __NR_mseal:
69+
+ case __NR_mremap:
70+
+ case __NR_membarrier:
71+
return true;
72+
case __NR_madvise:
73+
case __NR_mincore:
74+
@@ -531,7 +533,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
75+
case __NR_modify_ldt:
76+
#endif
77+
case __NR_mprotect:
78+
- case __NR_mremap:
79+
case __NR_msync:
80+
case __NR_munlockall:
81+
case __NR_readahead:
82+
diff --git a/sandbox/linux/system_headers/linux_syscalls.h ./sandbox/linux/system_headers/linux_syscalls.h
83+
index 2b78a0c..b6fedb5 100644
84+
--- a/sandbox/linux/system_headers/linux_syscalls.h
85+
+++ b/sandbox/linux/system_headers/linux_syscalls.h
86+
@@ -10,6 +10,7 @@
87+
#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
88+
89+
#include "build/build_config.h"
90+
+#include <sys/syscall.h>
91+
92+
#if defined(__x86_64__)
93+
#include "sandbox/linux/system_headers/x86_64_linux_syscalls.h"
94+
--- a/sandbox/policy/linux/bpf_renderer_policy_linux.cc
95+
+++ b/sandbox/policy/linux/bpf_renderer_policy_linux.cc
96+
@@ -94,6 +94,9 @@
97+
case __NR_pwrite64:
98+
case __NR_sched_get_priority_max:
99+
case __NR_sched_get_priority_min:
100+
+ case __NR_sched_getparam:
101+
+ case __NR_sched_getscheduler:
102+
+ case __NR_sched_setscheduler:
103+
case __NR_sysinfo:
104+
case __NR_times:
105+
case __NR_uname:
106+
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
107+
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
108+
@@ -225,10 +225,15 @@
109+
if (sysno == __NR_getpriority || sysno ==__NR_setpriority)
110+
return RestrictGetSetpriority(current_pid);
111+
112+
+ // XXX: hacks for musl sandbox, calls needed?
113+
+ if (sysno == __NR_sched_getparam || sysno == __NR_sched_getscheduler ||
114+
+ sysno == __NR_sched_setscheduler) {
115+
+ return Allow();
116+
+ }
117+
+
118+
// The scheduling syscalls are used in threading libraries and also heavily in
119+
// abseil. See for example https://crbug.com/1370394.
120+
- if (sysno == __NR_sched_getaffinity || sysno == __NR_sched_getparam ||
121+
- sysno == __NR_sched_getscheduler || sysno == __NR_sched_setscheduler) {
122+
+ if (sysno == __NR_sched_getaffinity) {
123+
return RestrictSchedTarget(current_pid, sysno);
124+
}
125+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Source: https://git.alpinelinux.org/aports/plain/community/chromium/musl-tid-caching.patch
2+
the sandbox caching of thread id's only works with glibc
3+
see: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/32356
4+
see: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13579
5+
--
6+
--- a/sandbox/linux/services/namespace_sandbox.cc
7+
+++ b/sandbox/linux/services/namespace_sandbox.cc
8+
@@ -209,6 +209,72 @@
9+
return base::LaunchProcess(argv, launch_options_copy);
10+
}
11+
12+
+#if !defined(LIBC_GLIBC)
13+
+#if defined(__aarch64__)
14+
+#define TLS_ABOVE_TP
15+
+#endif
16+
+
17+
+struct musl_pthread
18+
+{
19+
+ /* Part 1 -- these fields may be external or
20+
+ * internal (accessed via asm) ABI. Do not change. */
21+
+ struct pthread *self;
22+
+#ifndef TLS_ABOVE_TP
23+
+ uintptr_t *dtv;
24+
+#endif
25+
+ struct pthread *prev, *next; /* non-ABI */
26+
+ uintptr_t sysinfo;
27+
+#ifndef TLS_ABOVE_TP
28+
+#ifdef CANARY_PAD
29+
+ uintptr_t canary_pad;
30+
+#endif
31+
+ uintptr_t canary;
32+
+#endif
33+
+
34+
+/* Part 2 -- implementation details, non-ABI. */
35+
+ int tid;
36+
+ int errno_val;
37+
+ volatile int detach_state;
38+
+ volatile int cancel;
39+
+ volatile unsigned char canceldisable, cancelasync;
40+
+ unsigned char tsd_used:1;
41+
+ unsigned char dlerror_flag:1;
42+
+ unsigned char *map_base;
43+
+ size_t map_size;
44+
+ void *stack;
45+
+ size_t stack_size;
46+
+ size_t guard_size;
47+
+ void *result;
48+
+ struct __ptcb *cancelbuf;
49+
+ void **tsd;
50+
+ struct {
51+
+ volatile void *volatile head;
52+
+ long off;
53+
+ volatile void *volatile pending;
54+
+ } robust_list;
55+
+ int h_errno_val;
56+
+ volatile int timer_id;
57+
+ locale_t locale;
58+
+ volatile int killlock[1];
59+
+ char *dlerror_buf;
60+
+ void *stdio_locks;
61+
+
62+
+ /* Part 3 -- the positions of these fields relative to
63+
+ * the end of the structure is external and internal ABI. */
64+
+#ifdef TLS_ABOVE_TP
65+
+ uintptr_t canary;
66+
+ uintptr_t *dtv;
67+
+#endif
68+
+};
69+
+
70+
+void MaybeUpdateMuslTidCache()
71+
+{
72+
+ pid_t real_tid = sys_gettid();
73+
+ pid_t* cached_tid_location = &reinterpret_cast<struct musl_pthread*>(pthread_self())->tid;
74+
+ *cached_tid_location = real_tid;
75+
+}
76+
+#endif
77+
+
78+
// static
79+
pid_t NamespaceSandbox::ForkInNewPidNamespace(bool drop_capabilities_in_child) {
80+
const pid_t pid =
81+
@@ -226,6 +292,8 @@
82+
#if defined(LIBC_GLIBC)
83+
MaybeUpdateGlibcTidCache();
84+
-#endif
85+
+#else
86+
+ MaybeUpdateMuslTidCache();
87+
+#endif
88+
return 0;
89+
}
90+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Source: https://git.alpinelinux.org/aports/plain/community/chromium/no-res-ninit-nclose.patch
2+
similar to dns-resolver.patch, musl doesn't have res_ninit and so on
3+
--
4+
--- a/net/dns/public/scoped_res_state.cc
5+
+++ b/net/dns/public/scoped_res_state.cc
6+
@@ -13,7 +13,7 @@
7+
namespace net {
8+
9+
ScopedResState::ScopedResState() {
10+
-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
11+
+#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || defined(_GNU_SOURCE)
12+
// Note: res_ninit in glibc always returns 0 and sets RES_INIT.
13+
// res_init behaves the same way.
14+
memset(&_res, 0, sizeof(_res));
15+
@@ -25,16 +25,8 @@
16+
}
17+
18+
ScopedResState::~ScopedResState() {
19+
-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
20+
-
21+
- // Prefer res_ndestroy where available.
22+
-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
23+
- res_ndestroy(&res_);
24+
-#else
25+
- res_nclose(&res_);
26+
-#endif // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
27+
-
28+
-#endif // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
29+
+ // musl res_init() doesn't actually do anything
30+
+ // no destruction is necessary as no memory has been allocated
31+
}
32+
33+
bool ScopedResState::IsValid() const {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/./electron/shell/browser/ui/file_dialog.h b/./electron/shell/browser/ui/file_dialog.h
2+
index 6cdfc7b..f7757da 100644
3+
--- a/shell/browser/ui/file_dialog.h
4+
+++ b/shell/browser/ui/file_dialog.h
5+
@@ -13,10 +13,6 @@
6+
#include "base/files/file_path.h"
7+
#include "base/memory/raw_ptr_exclusion.h"
8+
9+
-#if BUILDFLAG(IS_LINUX)
10+
-#include <bits/stdint-uintn.h>
11+
-#endif
12+
-
13+
namespace electron {
14+
class NativeWindow;
15+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--- a/build/config/rust.gni
2+
+++ b/build/config/rust.gni
3+
@@ -196,7 +196,18 @@
4+
# a cargo project that dumps the `CARGO_CFG_TARGET_ABI` from its build.rs. See
5+
# https://issues.chromium.org/u/1/issues/372512092#comment5 for an example.
6+
rust_abi_target = ""
7+
-if (is_linux || is_chromeos) {
8+
+if (is_musl) {
9+
+ if (current_cpu == "arm64") {
10+
+ rust_abi_target = "aarch64-unknown-linux-musl"
11+
+ cargo_target_abi = ""
12+
+ } else if (current_cpu == "x86") {
13+
+ rust_abi_target = "i686-unknown-linux-musl"
14+
+ cargo_target_abi = ""
15+
+ } else if (current_cpu == "x64") {
16+
+ rust_abi_target = "x86_64-unknown-linux-musl"
17+
+ cargo_target_abi = ""
18+
+ }
19+
+} else if (is_linux || is_chromeos) {
20+
if (current_cpu == "arm64") {
21+
rust_abi_target = "aarch64-unknown-linux-gnu"
22+
cargo_target_abi = ""
23+
--- a/build/rust/known-target-triples.txt
24+
+++ b/build/rust/known-target-triples.txt
25+
@@ -17,6 +17,7 @@
26+
aarch64-pc-windows-msvc
27+
aarch64-unknown-fuchsia
28+
aarch64-unknown-linux-gnu
29+
+aarch64-unknown-linux-musl
30+
arm64e-apple-ios
31+
arm-unknown-linux-gnueabi
32+
arm-unknown-linux-gnueabihf
33+
@@ -28,6 +29,7 @@
34+
i686-linux-android
35+
i686-pc-windows-msvc
36+
i686-unknown-linux-gnu
37+
+i686-unknown-linux-musl
38+
loongarch64-unknown-linux-gnu
39+
riscv64-linux-android
40+
riscv64gc-unknown-linux-gnu
41+
@@ -41,5 +43,6 @@
42+
x86_64-pc-windows-msvc
43+
x86_64-unknown-fuchsia
44+
x86_64-unknown-linux-gnu
45+
+x86_64-unknown-linux-musl
46+
powerpc64le-unknown-linux-gnu
47+
s390x-unknown-linux-gnu
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 98338d64fff786f366b209c14735ff73b2c353bd Mon Sep 17 00:00:00 2001
2+
From: LN Liberda <[email protected]>
3+
Date: Tue, 2 Sep 2025 23:49:49 +0200
4+
Subject: [PATCH] musl/linux: Don't import conflicting libc and kernel headers
5+
6+
/usr/include/sys/prctl.h:88:8: error: redefinition of 'prctl_mm_map'
7+
/usr/include/linux/prctl.h:134:8: note: previous definition is here
8+
---
9+
rtc_base/platform_thread_types.cc | 2 ++
10+
1 file changed, 2 insertions(+)
11+
12+
diff --git a/third_party/webrtc/rtc_base/platform_thread_types.cc b/third_party/webrtcrtc_base/platform_thread_types.cc
13+
index 20bf4afc44..5b26c120e4 100644
14+
--- a/third_party/webrtc/rtc_base/platform_thread_types.cc
15+
+++ b/third_party/webrtcrtc_base/platform_thread_types.cc
16+
@@ -12,7 +12,9 @@
17+
18+
// IWYU pragma: begin_keep
19+
#if defined(WEBRTC_LINUX)
20+
+#if defined(__GLIBC__)
21+
#include <linux/prctl.h>
22+
+#endif
23+
#include <sys/prctl.h>
24+
#include <sys/syscall.h>
25+

0 commit comments

Comments
 (0)