Skip to content

Commit 3c59f15

Browse files
knyipablicy183
authored andcommitted
new package: tor-browser
1 parent e7aad74 commit 3c59f15

30 files changed

+797
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/build/moz.configure/init.configure
2+
+++ b/build/moz.configure/init.configure
3+
@@ -500,7 +500,7 @@
4+
abi = None
5+
sub_configure_alias = triplet
6+
if "android" in os:
7+
- canonical_os = "Android"
8+
+ canonical_os = "GNU"
9+
canonical_kernel = "Linux"
10+
elif os.startswith("linux"):
11+
canonical_os = "GNU"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/build/moz.configure/arm.configure
2+
+++ b/build/moz.configure/arm.configure
3+
@@ -7,7 +7,7 @@
4+
5+
@depends(target.os)
6+
def arm_option_defaults(os):
7+
- if os == "Android":
8+
+ if True:
9+
arch = "armv7-a"
10+
thumb = "yes"
11+
fpu = "neon"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--- a/build/moz.configure/rust.configure
2+
+++ b/build/moz.configure/rust.configure
3+
@@ -514,17 +514,27 @@
4+
assert_rust_compile(host, rustc_target, rustc)
5+
return rustc_target
6+
7+
+option("--custom-rust-target-triple", nargs=1, help="Customize Rust Target Triple")
8+
+
9+
+@depends("--custom-rust-target-triple")
10+
+def get_custom_rust_target_triple(custom_rust_target_triple):
11+
+ if custom_rust_target_triple:
12+
+ return custom_rust_target_triple[0]
13+
+ return None
14+
15+
@depends(
16+
- rustc, target, c_compiler, rust_supported_targets, arm_target, when=rust_compiler
17+
+ get_custom_rust_target_triple, rustc, target, c_compiler, rust_supported_targets, arm_target, when=rust_compiler
18+
)
19+
@checking("for rust target triplet")
20+
def rust_target_triple(
21+
- rustc, target, compiler_info, rust_supported_targets, arm_target
22+
+ custom_rust_target_triple, rustc, target, compiler_info, rust_supported_targets, arm_target
23+
):
24+
- rustc_target = detect_rustc_target(
25+
- target, compiler_info, arm_target, rust_supported_targets
26+
- )
27+
+ if custom_rust_target_triple:
28+
+ rustc_target = custom_rust_target_triple
29+
+ else:
30+
+ rustc_target = detect_rustc_target(
31+
+ target, compiler_info, arm_target, rust_supported_targets
32+
+ )
33+
assert_rust_compile(target, rustc_target, rustc)
34+
return rustc_target
35+
36+
@@ -599,8 +609,6 @@
37+
38+
# ==============================================================
39+
40+
-option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags")
41+
-set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags))
42+
43+
44+
# Rust compiler flags
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- a/build/moz.configure/toolchain.configure
2+
+++ b/build/moz.configure/toolchain.configure
3+
@@ -1981,17 +1981,7 @@
4+
5+
@depends(cxx_compiler, target)
6+
def needs_libstdcxx_newness_check(cxx_compiler, target):
7+
- # We only have to care about this on Linux and MinGW.
8+
- if cxx_compiler.type == "clang-cl":
9+
- return
10+
-
11+
- if target.kernel not in ("Linux", "WINNT"):
12+
- return
13+
-
14+
- if target.os == "Android":
15+
- return
16+
-
17+
- return True
18+
+ return
19+
20+
21+
def die_on_old_libstdcxx():
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- a/build/moz.configure/toolchain.configure
2+
+++ b/build/moz.configure/toolchain.configure
3+
@@ -1256,7 +1256,7 @@
4+
):
5+
wrapper = list(compiler_wrapper or ())
6+
flags = []
7+
- if sysroot.path:
8+
+ if False:
9+
if host_or_target.kernel == "Darwin":
10+
# While --sysroot and -isysroot are roughly equivalent, when not using
11+
# -isysroot on mac, clang takes the SDKROOT environment variable into
12+
--- a/build/moz.configure/pkg.configure
13+
+++ b/build/moz.configure/pkg.configure
14+
@@ -56,7 +56,7 @@
15+
@imports(_from="os", _import="environ")
16+
@imports(_from="os", _import="pathsep")
17+
def pkg_config_vars(target, sysroot_path, multiarch_dir):
18+
- if sysroot_path and target.kernel != "Darwin":
19+
+ if False:
20+
pkgconfig_dirs = [
21+
"usr/lib/pkgconfig",
22+
"usr/lib/{}/pkgconfig".format(multiarch_dir),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/toolkit/moz.configure
2+
+++ b/toolkit/moz.configure
3+
@@ -174,7 +174,7 @@
4+
@depends(target)
5+
def midir_linux_support(target):
6+
return (
7+
- target.kernel == "Linux" and target.os != "Android" and target.cpu != "riscv64"
8+
+ False
9+
)
10+
11+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
https://bugzilla.mozilla.org/show_bug.cgi?id=1874059
2+
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276746
3+
4+
--- a/build/moz.configure/toolchain.configure
5+
+++ b/build/moz.configure/toolchain.configure
6+
@@ -2344,7 +2344,7 @@
7+
@depends(target, build_environment)
8+
def visibility_flags(target, env):
9+
if target.os != "WINNT":
10+
- if target.kernel == "Darwin":
11+
+ if True:
12+
return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
13+
return (
14+
"-I%s/system_wrappers" % os.path.join(env.dist),
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
--- a/dom/media/systemservices/VideoEngine.cpp
2+
+++ b/dom/media/systemservices/VideoEngine.cpp
3+
@@ -30,7 +30,7 @@
4+
#define LOG(args) MOZ_LOG(gVideoEngineLog, mozilla::LogLevel::Debug, args)
5+
#define LOG_ENABLED() MOZ_LOG_TEST(gVideoEngineLog, mozilla::LogLevel::Debug)
6+
7+
-#if defined(ANDROID)
8+
+#if defined(ANDROID) && !defined(__TERMUX__)
9+
int VideoEngine::SetAndroidObjects() {
10+
LOG(("%s", __PRETTY_FUNCTION__));
11+
12+
--- a/ipc/chromium/src/base/lock_impl_posix.cc
13+
+++ b/ipc/chromium/src/base/lock_impl_posix.cc
14+
@@ -22,7 +22,7 @@
15+
// Lock::PriorityInheritanceAvailable still must be checked as the code may
16+
// compile but the underlying platform still may not correctly support priority
17+
// inheritance locks.
18+
-#if defined(ANDROID)
19+
+#if defined(ANDROID) || defined(__TERMUX__)
20+
# define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 0
21+
#else
22+
# define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 1
23+
--- a/js/src/ctypes/libffi/src/closures.c
24+
+++ b/js/src/ctypes/libffi/src/closures.c
25+
@@ -112,7 +112,7 @@
26+
#else /* !NetBSD with PROT_MPROTECT */
27+
28+
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
29+
-# if __linux__ && !defined(__ANDROID__)
30+
+# if __linux__ && !defined(__TERMUX__)
31+
/* This macro indicates it may be forbidden to map anonymous memory
32+
with both write and execute permission. Code compiled when this
33+
option is defined will attempt to map such pages once, but if it
34+
--- a/memory/build/malloc_decls.h
35+
+++ b/memory/build/malloc_decls.h
36+
@@ -39,7 +39,7 @@
37+
// consistent declare certain functions as `throw()`, though.
38+
39+
// Bionic and OS X don't seem to care about `throw()`ness.
40+
-# if defined(ANDROID) || defined(XP_DARWIN)
41+
+# if defined(__TERMUX__) || defined(XP_DARWIN)
42+
# undef NOTHROW_MALLOC_DECL
43+
# define NOTHROW_MALLOC_DECL MALLOC_DECL
44+
// Some places don't care about the distinction.
45+
--- a/dom/media/CubebUtils.cpp
46+
+++ b/dom/media/CubebUtils.cpp
47+
@@ -57,7 +57,7 @@
48+
#define PREF_AUDIOIPC_STACK_SIZE "media.audioipc.stack_size"
49+
#define PREF_AUDIOIPC_SHM_AREA_SIZE "media.audioipc.shm_area_size"
50+
51+
-#if defined(XP_LINUX) || defined(XP_MACOSX) || defined(XP_WIN)
52+
+#if (defined(XP_LINUX) && !defined(__TERMUX__)) || defined(XP_MACOSX) || defined(XP_WIN)
53+
# define MOZ_CUBEB_REMOTING
54+
#endif
55+
56+
--- a/mozglue/misc/ConditionVariable_posix.cpp
57+
+++ b/mozglue/misc/ConditionVariable_posix.cpp
58+
@@ -23,7 +23,7 @@
59+
// Android 4.4 or earlier & macOS 10.12 has the clock functions, but not
60+
// pthread_condattr_setclock.
61+
#if defined(HAVE_CLOCK_MONOTONIC) && \
62+
- !(defined(__ANDROID__) && __ANDROID_API__ < 21) && !defined(__APPLE__)
63+
+ defined(__TERMUX__)
64+
# define CV_USE_CLOCK_API
65+
#endif
66+
67+
--- a/mozglue/misc/StackWalk.cpp
68+
+++ b/mozglue/misc/StackWalk.cpp
69+
@@ -692,7 +692,7 @@
70+
stackEnd = __libc_stack_end;
71+
# elif defined(XP_DARWIN)
72+
stackEnd = pthread_get_stackaddr_np(pthread_self());
73+
-# elif defined(ANDROID)
74+
+# elif defined(__TERMUX__)
75+
pthread_attr_t sattr;
76+
pthread_attr_init(&sattr);
77+
pthread_getattr_np(pthread_self(), &sattr);
78+
--- a/nsprpub/pr/src/pthreads/ptsynch.c
79+
+++ b/nsprpub/pr/src/pthreads/ptsynch.c
80+
@@ -953,7 +953,7 @@
81+
#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
82+
|| (defined(FREEBSD) && __FreeBSD_version < 1200059) \
83+
|| defined(OPENBSD) || defined(BSDI) \
84+
- || defined(DARWIN)
85+
+ || defined(DARWIN) || defined(__TERMUX__)
86+
/* union semun is defined by including <sys/sem.h> */
87+
#else
88+
/* according to X/OPEN we have to define it ourselves */
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
--- a/ipc/chromium/src/base/shared_memory_posix.cc
2+
+++ b/ipc/chromium/src/base/shared_memory_posix.cc
3+
@@ -40,6 +40,65 @@
4+
#include "mozilla/UniquePtrExtensions.h"
5+
#include "prenv.h"
6+
7+
+static int shm_unlink(const char *name) {
8+
+ size_t namelen;
9+
+ char *fname;
10+
+
11+
+ /* Construct the filename. */
12+
+ while (name[0] == '/') ++name;
13+
+
14+
+ if (name[0] == '\0') {
15+
+ /* The name "/" is not supported. */
16+
+ errno = EINVAL;
17+
+ return -1;
18+
+ }
19+
+
20+
+ namelen = strlen(name);
21+
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
22+
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
23+
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
24+
+
25+
+ return unlink(fname);
26+
+}
27+
+
28+
+static int shm_open(const char *name, int oflag, mode_t mode) {
29+
+ size_t namelen;
30+
+ char *fname;
31+
+ int fd;
32+
+
33+
+ /* Construct the filename. */
34+
+ while (name[0] == '/') ++name;
35+
+
36+
+ if (name[0] == '\0') {
37+
+ /* The name "/" is not supported. */
38+
+ errno = EINVAL;
39+
+ return -1;
40+
+ }
41+
+
42+
+ namelen = strlen(name);
43+
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
44+
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
45+
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
46+
+
47+
+ fd = open(fname, oflag, mode);
48+
+ if (fd != -1) {
49+
+ /* We got a descriptor. Now set the FD_CLOEXEC bit. */
50+
+ int flags = fcntl(fd, F_GETFD, 0);
51+
+ flags |= FD_CLOEXEC;
52+
+ flags = fcntl(fd, F_SETFD, flags);
53+
+
54+
+ if (flags == -1) {
55+
+ /* Something went wrong. We cannot return the descriptor. */
56+
+ int save_errno = errno;
57+
+ close(fd);
58+
+ fd = -1;
59+
+ errno = save_errno;
60+
+ }
61+
+ }
62+
+
63+
+ return fd;
64+
+}
65+
+
66+
namespace base {
67+
68+
void SharedMemory::MappingDeleter::operator()(void* ptr) {
69+
@@ -153,7 +212,7 @@
70+
// FreeBSD in version 13.
71+
72+
# if !defined(HAVE_MEMFD_CREATE) && defined(XP_LINUX) && \
73+
- defined(SYS_memfd_create)
74+
+ defined(SYS_memfd_create) && !defined(__TERMUX__)
75+
76+
// Older libc versions (e.g., glibc before 2.27) don't have the
77+
// wrapper, but we can supply our own; see `linux_memfd_defs.h`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/ipc/chromium/src/base/message_pump_libevent.cc
2+
+++ b/ipc/chromium/src/base/message_pump_libevent.cc
3+
@@ -41,7 +41,6 @@
4+
CHECK_EVENT_SIZEOF(PTHREAD_T, pthread_t);
5+
CHECK_EVENT_SIZEOF(SHORT, short);
6+
CHECK_EVENT_SIZEOF(SIZE_T, size_t);
7+
-CHECK_EVENT_SIZEOF(TIME_T, time_t);
8+
CHECK_EVENT_SIZEOF(VOID_P, void*);
9+
10+
// Lifecycle of struct event

0 commit comments

Comments
 (0)