Compare commits
28 commits
edge
...
electron/t
| Author | SHA1 | Date | |
|---|---|---|---|
|
d773cab1ea |
|||
|
6f83ba28d0 |
|||
| cb9bb05724 | |||
|
eb53b37dce |
|||
| 1d71eb9ab5 | |||
|
0e189159fc |
|||
|
ea7d833521 |
|||
|
466899665e |
|||
| 8cedcc1790 | |||
|
74ff29cd63 |
|||
|
74990b55aa |
|||
|
e48050e78b |
|||
| d7290381bd | |||
|
e24a62da6c |
|||
|
6ade8c6b70 |
|||
|
9cf8931cb8 |
|||
|
dae4200b92 |
|||
|
d9afb2ff02 |
|||
|
21de505ee5 |
|||
| cd0cb9fdc2 | |||
| 12d2c58029 | |||
| 31739f426c | |||
|
8272443d1d |
|||
|
9c90ca5177 |
|||
|
bd5adbd57c |
|||
| c73c8be7ac | |||
| b381ae74d2 | |||
|
4cc3b914c8 |
57 changed files with 1138 additions and 2907 deletions
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
${{ github.workspace }}/.forgejo/bin/build.sh
|
||||
touch packages/dummy
|
||||
- name: Package upload
|
||||
uses: forgejo/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: package
|
||||
path: packages
|
||||
|
|
@ -49,6 +49,6 @@ jobs:
|
|||
- name: Repo pull
|
||||
uses: actions/checkout@v4
|
||||
- name: Package download
|
||||
uses: forgejo/download-artifact@v3
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Package deployment
|
||||
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
${{ github.workspace }}/.forgejo/bin/generate-cross.sh ${{ github.ref_name }} ${{ inputs.target_arch }}
|
||||
mv -v /home/buildozer/packages/main ${{ github.workspace }}/packages/cross
|
||||
- name: Package upload
|
||||
uses: forgejo/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: package
|
||||
path: packages
|
||||
|
|
@ -54,6 +54,6 @@ jobs:
|
|||
- name: Repo pull
|
||||
uses: actions/checkout@v4
|
||||
- name: Package download
|
||||
uses: forgejo/download-artifact@v3
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Package deployment
|
||||
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
${{ github.workspace }}/.forgejo/bin/build.sh
|
||||
touch packages/dummy
|
||||
- name: Package upload
|
||||
uses: forgejo/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: package
|
||||
path: packages
|
||||
|
|
@ -49,6 +49,6 @@ jobs:
|
|||
- name: Repo pull
|
||||
uses: actions/checkout@v4
|
||||
- name: Package download
|
||||
uses: forgejo/download-artifact@v3
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Package deployment
|
||||
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=caprine
|
||||
pkgver=2.60.3
|
||||
pkgrel=2
|
||||
pkgrel=5
|
||||
pkgdesc="Elegant Facebook Messenger desktop app"
|
||||
arch="x86_64 aarch64" # blocked by electron
|
||||
url="https://github.com/sindresorhus/caprine"
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=coin
|
||||
pkgver=4.0.3
|
||||
pkgrel=0
|
||||
pkgdesc="OpenGL OpenInventor compatible graphics library"
|
||||
url="https://github.com/coin3d/coin"
|
||||
license="BSD-3-Clause"
|
||||
arch="all"
|
||||
makedepends="boost-dev cmake glu-dev graphviz samurai"
|
||||
subpackages="$pkgname-dev"
|
||||
source="https://github.com/coin3d/coin/releases/download/v$pkgver/coin-$pkgver-src.tar.gz
|
||||
TestSuitePatch.patch
|
||||
"
|
||||
builddir="$srcdir/coin"
|
||||
|
||||
build() {
|
||||
cmake -B build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCOIN_BUILD_TESTS=ON
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
check() {
|
||||
cmake --build build --target test
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
b661bf2124b0de1b46e76a6699b0975abb3aed4dc9019bf32531c535179dc84a90fe4e19def6f6cda7b175470636040d0e58812d532198cf207296d37c539915 coin-4.0.3-src.tar.gz
|
||||
aab464244b13371badf0878e5bfbcce859a42756cf8c7657d1480318aa291d296eac2741219c346bae056f761c5f46857f8fd1ec1c4129f86bc10236d3869deb TestSuitePatch.patch
|
||||
"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- ./testsuite/TestSuiteUtils.cpp
|
||||
+++ ./testsuite/TestSuiteUtils.cpp
|
||||
@@ -39,7 +39,7 @@
|
||||
#elif defined(_WIN32)
|
||||
#define USE_WIN32
|
||||
#else //_WIN32
|
||||
-#error Unknown system
|
||||
+#define USE_POSIX
|
||||
#endif //POSIX
|
||||
|
||||
#include <Inventor/errors/SoDebugError.h>
|
||||
|
|
@ -1,730 +0,0 @@
|
|||
From c854a92a215d0cf39c704bbadd3611e552073d5f Mon Sep 17 00:00:00 2001
|
||||
From: Collin Baker <collinbaker@chromium.org>
|
||||
Date: Fri, 4 Apr 2025 14:08:18 -0700
|
||||
Subject: [PATCH] Reland "Use #[global_allocator] to provide Rust allocator
|
||||
implementation"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a reland of commit cfa3beef52625e03ba6ce2b2ac98e1b89dde5cdb
|
||||
|
||||
Original was reverted due to a cronet gn2bp failure. The script
|
||||
filtered out GN rules in //build/rust/std, but this caused an exception
|
||||
when //build/rust/std:allocator was referenced later.
|
||||
|
||||
Moving the rules to //build/rust/allocator sidesteps the issue.
|
||||
|
||||
Original change's description:
|
||||
> Use #[global_allocator] to provide Rust allocator implementation
|
||||
>
|
||||
> The allocator shim hack we have been using no longer works with
|
||||
> upstream Rust. Replace it with a less-unsupported method: provide a
|
||||
> https://github.com/rust-lang/rust/issues/123015, which still requires
|
||||
> us to provide a few symbol definitions.
|
||||
>
|
||||
> Bug: 408221149, 407024458
|
||||
> Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5
|
||||
>
|
||||
> Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel
|
||||
> Change-Id: If1808ca24b12dc80ead35a25521313a3d2e148d5
|
||||
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6427855
|
||||
> Reviewed-by: Alan Zhao <ayzhao@google.com>
|
||||
> Reviewed-by: Lei Zhang <thestig@chromium.org>
|
||||
> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
> Commit-Queue: Collin Baker <collinbaker@chromium.org>
|
||||
> Auto-Submit: Collin Baker <collinbaker@chromium.org>
|
||||
> Cr-Commit-Position: refs/heads/main@{#1442472}
|
||||
|
||||
Bug: 408221149, 407024458
|
||||
Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel
|
||||
Change-Id: I36fef217297bfe64ae81519be24b8c653f6fdfa1
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6432410
|
||||
Reviewed-by: Mohannad Farrag <aymanm@google.com>
|
||||
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Auto-Submit: Collin Baker <collinbaker@chromium.org>
|
||||
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1442922}
|
||||
---
|
||||
build/rust/allocator/BUILD.gn | 90 ++++++++++++++++
|
||||
build/rust/{std => allocator}/alias.cc | 4 +-
|
||||
build/rust/{std => allocator}/alias.h | 6 +-
|
||||
.../allocator_impls.cc} | 100 ++++++++----------
|
||||
build/rust/allocator/allocator_impls.h | 25 +++++
|
||||
.../allocator/allocator_shim_definitions.cc | 30 ++++++
|
||||
.../{std => allocator}/compiler_specific.h | 6 +-
|
||||
.../rust/{std => allocator}/immediate_crash.h | 6 +-
|
||||
build/rust/allocator/lib.rs | 48 +++++++++
|
||||
build/rust/cargo_crate.gni | 9 ++
|
||||
build/rust/rust_macro.gni | 3 +
|
||||
build/rust/rust_target.gni | 4 +
|
||||
build/rust/std/BUILD.gn | 41 -------
|
||||
components/cronet/android/dependencies.txt | 1 +
|
||||
third_party/breakpad/BUILD.gn | 10 +-
|
||||
15 files changed, 272 insertions(+), 111 deletions(-)
|
||||
create mode 100644 build/rust/allocator/BUILD.gn
|
||||
rename build/rust/{std => allocator}/alias.cc (87%)
|
||||
rename build/rust/{std => allocator}/alias.h (91%)
|
||||
rename build/rust/{std/remap_alloc.cc => allocator/allocator_impls.cc} (67%)
|
||||
create mode 100644 build/rust/allocator/allocator_impls.h
|
||||
create mode 100644 build/rust/allocator/allocator_shim_definitions.cc
|
||||
rename build/rust/{std => allocator}/compiler_specific.h (87%)
|
||||
rename build/rust/{std => allocator}/immediate_crash.h (97%)
|
||||
create mode 100644 build/rust/allocator/lib.rs
|
||||
|
||||
diff --git a/build/rust/allocator/BUILD.gn b/build/rust/allocator/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000..06aa47f097c9c
|
||||
--- /dev/null
|
||||
+++ b/build/rust/allocator/BUILD.gn
|
||||
@@ -0,0 +1,90 @@
|
||||
+# Copyright 2025 The Chromium Authors
|
||||
+# Use of this source code is governed by a BSD-style license that can be
|
||||
+# found in the LICENSE file.
|
||||
+
|
||||
+import("//build/buildflag_header.gni")
|
||||
+import("//build/config/rust.gni")
|
||||
+import("//build/rust/rust_static_library.gni")
|
||||
+
|
||||
+rust_allocator_uses_partition_alloc = false
|
||||
+if (build_with_chromium) {
|
||||
+ import("//base/allocator/partition_allocator/partition_alloc.gni")
|
||||
+ rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc
|
||||
+}
|
||||
+
|
||||
+buildflag_header("buildflags") {
|
||||
+ header = "buildflags.h"
|
||||
+ flags = [
|
||||
+ "RUST_ALLOCATOR_USES_PARTITION_ALLOC=$rust_allocator_uses_partition_alloc",
|
||||
+ ]
|
||||
+ visibility = [ ":*" ]
|
||||
+}
|
||||
+
|
||||
+if (toolchain_has_rust) {
|
||||
+ # All targets which depend on Rust code but are not linked by rustc must
|
||||
+ # depend on this. Usually, this dependency will come from the rust_target() GN
|
||||
+ # template. However, cargo_crate() does *not* include this dependency so any
|
||||
+ # C++ targets which directly depend on a cargo_crate() must depend on this.
|
||||
+ rust_static_library("allocator") {
|
||||
+ sources = [ "lib.rs" ]
|
||||
+ crate_root = "lib.rs"
|
||||
+ cxx_bindings = [ "lib.rs" ]
|
||||
+
|
||||
+ deps = [
|
||||
+ ":allocator_impls",
|
||||
+ ":allocator_shim_definitions",
|
||||
+ ]
|
||||
+
|
||||
+ no_chromium_prelude = true
|
||||
+ no_allocator_crate = true
|
||||
+ allow_unsafe = true
|
||||
+ }
|
||||
+
|
||||
+ static_library("allocator_impls") {
|
||||
+ public_deps = []
|
||||
+ if (rust_allocator_uses_partition_alloc) {
|
||||
+ public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ]
|
||||
+ }
|
||||
+
|
||||
+ sources = [
|
||||
+ "allocator_impls.cc",
|
||||
+ "allocator_impls.h",
|
||||
+ ]
|
||||
+
|
||||
+ deps = [
|
||||
+ ":allocator_cpp_shared",
|
||||
+ ":buildflags",
|
||||
+
|
||||
+ # TODO(crbug.com/408221149): remove the C++ -> Rust dependency for the
|
||||
+ # default allocator.
|
||||
+ "//build/rust/std",
|
||||
+ ]
|
||||
+
|
||||
+ visibility = [ ":*" ]
|
||||
+ }
|
||||
+
|
||||
+ source_set("allocator_shim_definitions") {
|
||||
+ sources = [ "allocator_shim_definitions.cc" ]
|
||||
+
|
||||
+ deps = [ ":allocator_cpp_shared" ]
|
||||
+
|
||||
+ visibility = [ ":*" ]
|
||||
+ }
|
||||
+
|
||||
+ source_set("allocator_cpp_shared") {
|
||||
+ sources = [
|
||||
+ # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been
|
||||
+ # copied from `//base`.
|
||||
+ # TODO(crbug.com/40279749): Avoid duplication / reuse code.
|
||||
+ "alias.cc",
|
||||
+ "alias.h",
|
||||
+ "compiler_specific.h",
|
||||
+ "immediate_crash.h",
|
||||
+ ]
|
||||
+
|
||||
+ visibility = [
|
||||
+ ":allocator_impls",
|
||||
+ ":allocator_shim_definitions",
|
||||
+ ]
|
||||
+ }
|
||||
+}
|
||||
diff --git a/build/rust/std/alias.cc b/build/rust/allocator/alias.cc
|
||||
similarity index 87%
|
||||
rename from build/rust/std/alias.cc
|
||||
rename to build/rust/allocator/alias.cc
|
||||
index 42febac3ed1fc..ca20986f8ed49 100644
|
||||
--- a/build/rust/std/alias.cc
|
||||
+++ b/build/rust/allocator/alias.cc
|
||||
@@ -7,9 +7,9 @@
|
||||
//
|
||||
// TODO(crbug.com/40279749): Avoid code duplication / reuse code.
|
||||
|
||||
-#include "build/rust/std/alias.h"
|
||||
+#include "build/rust/allocator/alias.h"
|
||||
|
||||
-#include "build/rust/std/compiler_specific.h"
|
||||
+#include "build/rust/allocator/compiler_specific.h"
|
||||
|
||||
namespace build_rust_std {
|
||||
namespace debug {
|
||||
diff --git a/build/rust/std/alias.h b/build/rust/allocator/alias.h
|
||||
similarity index 91%
|
||||
rename from build/rust/std/alias.h
|
||||
rename to build/rust/allocator/alias.h
|
||||
index 0eaba6766148f..80995ecfb045e 100644
|
||||
--- a/build/rust/std/alias.h
|
||||
+++ b/build/rust/allocator/alias.h
|
||||
@@ -8,8 +8,8 @@
|
||||
//
|
||||
// TODO(crbug.com/40279749): Avoid code duplication / reuse code.
|
||||
|
||||
-#ifndef BUILD_RUST_STD_ALIAS_H_
|
||||
-#define BUILD_RUST_STD_ALIAS_H_
|
||||
+#ifndef BUILD_RUST_ALLOCATOR_ALIAS_H_
|
||||
+#define BUILD_RUST_ALLOCATOR_ALIAS_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -34,4 +34,4 @@ void Alias(const void* var);
|
||||
const int line_number = __LINE__; \
|
||||
build_rust_std::debug::Alias(&line_number)
|
||||
|
||||
-#endif // BUILD_RUST_STD_ALIAS_H_
|
||||
+#endif // BUILD_RUST_ALLOCATOR_ALIAS_H_
|
||||
diff --git a/build/rust/std/remap_alloc.cc b/build/rust/allocator/allocator_impls.cc
|
||||
similarity index 67%
|
||||
rename from build/rust/std/remap_alloc.cc
|
||||
rename to build/rust/allocator/allocator_impls.cc
|
||||
index a443b11ec513d..1fde98f23cd12 100644
|
||||
--- a/build/rust/std/remap_alloc.cc
|
||||
+++ b/build/rust/allocator/allocator_impls.cc
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
+#include "build/rust/allocator/allocator_impls.h"
|
||||
+
|
||||
#ifdef UNSAFE_BUFFERS_BUILD
|
||||
// TODO(crbug.com/390223051): Remove C-library calls to fix the errors.
|
||||
#pragma allow_unsafe_libc_calls
|
||||
@@ -11,9 +13,9 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "build/build_config.h"
|
||||
-#include "build/rust/std/alias.h"
|
||||
-#include "build/rust/std/buildflags.h"
|
||||
-#include "build/rust/std/immediate_crash.h"
|
||||
+#include "build/rust/allocator/alias.h"
|
||||
+#include "build/rust/allocator/buildflags.h"
|
||||
+#include "build/rust/allocator/immediate_crash.h"
|
||||
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC)
|
||||
#include "partition_alloc/partition_alloc_constants.h" // nogncheck
|
||||
@@ -22,6 +24,11 @@
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
+// NOTE: this documentation is outdated.
|
||||
+//
|
||||
+// TODO(crbug.com/408221149): update this documentation, or replace it with docs
|
||||
+// in the Rust allocator implementation.
|
||||
+//
|
||||
// When linking a final binary, rustc has to pick between either:
|
||||
// * The default Rust allocator
|
||||
// * Any #[global_allocator] defined in *any rlib in its dependency tree*
|
||||
@@ -87,19 +94,6 @@
|
||||
// enabling it breaks Win32 APIs like CreateProcess:
|
||||
// https://issues.chromium.org/u/1/issues/368070343#comment29
|
||||
|
||||
-extern "C" {
|
||||
-
|
||||
-#ifdef COMPONENT_BUILD
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
-#define REMAP_ALLOC_ATTRIBUTES __declspec(dllexport) __attribute__((weak))
|
||||
-#else
|
||||
-#define REMAP_ALLOC_ATTRIBUTES \
|
||||
- __attribute__((visibility("default"))) __attribute__((weak))
|
||||
-#endif
|
||||
-#else
|
||||
-#define REMAP_ALLOC_ATTRIBUTES __attribute__((weak))
|
||||
-#endif // COMPONENT_BUILD
|
||||
-
|
||||
#if !BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) && BUILDFLAG(IS_WIN) && \
|
||||
defined(ADDRESS_SANITIZER)
|
||||
#define USE_WIN_ALIGNED_MALLOC 1
|
||||
@@ -107,17 +101,19 @@ extern "C" {
|
||||
#define USE_WIN_ALIGNED_MALLOC 0
|
||||
#endif
|
||||
|
||||
-// This must exist as the stdlib depends on it to prove that we know the
|
||||
-// alloc shims below are unstable. In the future we may be required to replace
|
||||
-// them with a #[global_allocator] crate (see file comment above for more).
|
||||
-//
|
||||
-// Marked as weak as when Rust drives linking it includes this symbol itself,
|
||||
-// and we don't want a collision due to C++ being in the same link target, where
|
||||
-// C++ causes us to explicitly link in the stdlib and this symbol here.
|
||||
-[[maybe_unused]]
|
||||
-__attribute__((weak)) unsigned char __rust_no_alloc_shim_is_unstable;
|
||||
+// The default allocator functions provided by the Rust standard library.
|
||||
+extern "C" void* __rdl_alloc(size_t size, size_t align);
|
||||
+extern "C" void __rdl_dealloc(void* p, size_t size, size_t align);
|
||||
+extern "C" void* __rdl_realloc(void* p,
|
||||
+ size_t old_size,
|
||||
+ size_t align,
|
||||
+ size_t new_size);
|
||||
+
|
||||
+extern "C" void* __rdl_alloc_zeroed(size_t size, size_t align);
|
||||
+
|
||||
+namespace rust_allocator_internal {
|
||||
|
||||
-REMAP_ALLOC_ATTRIBUTES void* __rust_alloc(size_t size, size_t align) {
|
||||
+unsigned char* alloc(size_t size, size_t align) {
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC)
|
||||
// PartitionAlloc will crash if given an alignment larger than this.
|
||||
if (align > partition_alloc::internal::kMaxSupportedAlignment) {
|
||||
@@ -125,19 +121,19 @@ REMAP_ALLOC_ATTRIBUTES void* __rust_alloc(size_t size, size_t align) {
|
||||
}
|
||||
|
||||
if (align <= alignof(std::max_align_t)) {
|
||||
- return allocator_shim::UncheckedAlloc(size);
|
||||
+ return static_cast<unsigned char*>(allocator_shim::UncheckedAlloc(size));
|
||||
} else {
|
||||
- return allocator_shim::UncheckedAlignedAlloc(size, align);
|
||||
+ return static_cast<unsigned char*>(
|
||||
+ allocator_shim::UncheckedAlignedAlloc(size, align));
|
||||
}
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
- return _aligned_malloc(size, align);
|
||||
+ return static_cast<unsigned char*>(_aligned_malloc(size, align));
|
||||
#else
|
||||
- extern void* __rdl_alloc(size_t size, size_t align);
|
||||
- return __rdl_alloc(size, align);
|
||||
+ return static_cast<unsigned char*>(__rdl_alloc(size, align));
|
||||
#endif
|
||||
}
|
||||
|
||||
-REMAP_ALLOC_ATTRIBUTES void __rust_dealloc(void* p, size_t size, size_t align) {
|
||||
+void dealloc(unsigned char* p, size_t size, size_t align) {
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC)
|
||||
if (align <= alignof(std::max_align_t)) {
|
||||
allocator_shim::UncheckedFree(p);
|
||||
@@ -147,54 +143,44 @@ REMAP_ALLOC_ATTRIBUTES void __rust_dealloc(void* p, size_t size, size_t align) {
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
return _aligned_free(p);
|
||||
#else
|
||||
- extern void __rdl_dealloc(void* p, size_t size, size_t align);
|
||||
__rdl_dealloc(p, size, align);
|
||||
#endif
|
||||
}
|
||||
|
||||
-REMAP_ALLOC_ATTRIBUTES void* __rust_realloc(void* p,
|
||||
- size_t old_size,
|
||||
- size_t align,
|
||||
- size_t new_size) {
|
||||
+unsigned char* realloc(unsigned char* p,
|
||||
+ size_t old_size,
|
||||
+ size_t align,
|
||||
+ size_t new_size) {
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC)
|
||||
if (align <= alignof(std::max_align_t)) {
|
||||
- return allocator_shim::UncheckedRealloc(p, new_size);
|
||||
+ return static_cast<unsigned char*>(
|
||||
+ allocator_shim::UncheckedRealloc(p, new_size));
|
||||
} else {
|
||||
- return allocator_shim::UncheckedAlignedRealloc(p, new_size, align);
|
||||
+ return static_cast<unsigned char*>(
|
||||
+ allocator_shim::UncheckedAlignedRealloc(p, new_size, align));
|
||||
}
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
- return _aligned_realloc(p, new_size, align);
|
||||
+ return static_cast<unsigned char*>(_aligned_realloc(p, new_size, align));
|
||||
#else
|
||||
- extern void* __rdl_realloc(void* p, size_t old_size, size_t align,
|
||||
- size_t new_size);
|
||||
- return __rdl_realloc(p, old_size, align, new_size);
|
||||
+ return static_cast<unsigned char*>(
|
||||
+ __rdl_realloc(p, old_size, align, new_size));
|
||||
#endif
|
||||
}
|
||||
|
||||
-REMAP_ALLOC_ATTRIBUTES void* __rust_alloc_zeroed(size_t size, size_t align) {
|
||||
+unsigned char* alloc_zeroed(size_t size, size_t align) {
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) || USE_WIN_ALIGNED_MALLOC
|
||||
// TODO(danakj): When RUST_ALLOCATOR_USES_PARTITION_ALLOC is true, it's
|
||||
// possible that a partition_alloc::UncheckedAllocZeroed() call would perform
|
||||
// better than partition_alloc::UncheckedAlloc() + memset. But there is no
|
||||
// such API today. See b/342251590.
|
||||
- void* p = __rust_alloc(size, align);
|
||||
+ unsigned char* p = alloc(size, align);
|
||||
if (p) {
|
||||
memset(p, 0, size);
|
||||
}
|
||||
return p;
|
||||
#else
|
||||
- extern void* __rdl_alloc_zeroed(size_t size, size_t align);
|
||||
- return __rdl_alloc_zeroed(size, align);
|
||||
+ return static_cast<unsigned char*>(__rdl_alloc_zeroed(size, align));
|
||||
#endif
|
||||
}
|
||||
|
||||
-REMAP_ALLOC_ATTRIBUTES void __rust_alloc_error_handler(size_t size,
|
||||
- size_t align) {
|
||||
- NO_CODE_FOLDING();
|
||||
- IMMEDIATE_CRASH();
|
||||
-}
|
||||
-
|
||||
-REMAP_ALLOC_ATTRIBUTES extern const unsigned char
|
||||
- __rust_alloc_error_handler_should_panic = 0;
|
||||
-
|
||||
-} // extern "C"
|
||||
+} // namespace rust_allocator_internal
|
||||
diff --git a/build/rust/allocator/allocator_impls.h b/build/rust/allocator/allocator_impls.h
|
||||
new file mode 100644
|
||||
index 0000000000000..afb335412faf9
|
||||
--- /dev/null
|
||||
+++ b/build/rust/allocator/allocator_impls.h
|
||||
@@ -0,0 +1,25 @@
|
||||
+// Copyright 2025 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_
|
||||
+#define BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_
|
||||
+
|
||||
+#include <cstddef>
|
||||
+
|
||||
+#include "build/build_config.h"
|
||||
+#include "build/rust/allocator/buildflags.h"
|
||||
+
|
||||
+namespace rust_allocator_internal {
|
||||
+
|
||||
+unsigned char* alloc(size_t size, size_t align);
|
||||
+void dealloc(unsigned char* p, size_t size, size_t align);
|
||||
+unsigned char* realloc(unsigned char* p,
|
||||
+ size_t old_size,
|
||||
+ size_t align,
|
||||
+ size_t new_size);
|
||||
+unsigned char* alloc_zeroed(size_t size, size_t align);
|
||||
+
|
||||
+} // namespace rust_allocator_internal
|
||||
+
|
||||
+#endif // BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_
|
||||
diff --git a/build/rust/allocator/allocator_shim_definitions.cc b/build/rust/allocator/allocator_shim_definitions.cc
|
||||
new file mode 100644
|
||||
index 0000000000000..a4d1bd77b7016
|
||||
--- /dev/null
|
||||
+++ b/build/rust/allocator/allocator_shim_definitions.cc
|
||||
@@ -0,0 +1,30 @@
|
||||
+// Copyright 2025 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include <cstddef>
|
||||
+
|
||||
+#include "build/rust/allocator/alias.h"
|
||||
+#include "build/rust/allocator/immediate_crash.h"
|
||||
+
|
||||
+extern "C" {
|
||||
+
|
||||
+// As part of rustc's contract for using `#[global_allocator]` without
|
||||
+// rustc-generated shims we must define this symbol, since we are opting in to
|
||||
+// unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
+//
|
||||
+// Mark it weak since rustc will generate it when it drives linking.
|
||||
+[[maybe_unused]]
|
||||
+__attribute__((weak)) unsigned char __rust_no_alloc_shim_is_unstable;
|
||||
+
|
||||
+__attribute__((weak)) void __rust_alloc_error_handler(size_t size,
|
||||
+ size_t align) {
|
||||
+ NO_CODE_FOLDING();
|
||||
+ IMMEDIATE_CRASH();
|
||||
+}
|
||||
+
|
||||
+__attribute__((
|
||||
+ weak)) extern const unsigned char __rust_alloc_error_handler_should_panic =
|
||||
+ 0;
|
||||
+
|
||||
+} // extern "C"
|
||||
diff --git a/build/rust/std/compiler_specific.h b/build/rust/allocator/compiler_specific.h
|
||||
similarity index 87%
|
||||
rename from build/rust/std/compiler_specific.h
|
||||
rename to build/rust/allocator/compiler_specific.h
|
||||
index ea79a7a8dc284..f9079679a3e9a 100644
|
||||
--- a/build/rust/std/compiler_specific.h
|
||||
+++ b/build/rust/allocator/compiler_specific.h
|
||||
@@ -7,8 +7,8 @@
|
||||
//
|
||||
// TODO(crbug.com/40279749): Avoid code duplication / reuse code.
|
||||
|
||||
-#ifndef BUILD_RUST_STD_COMPILER_SPECIFIC_H_
|
||||
-#define BUILD_RUST_STD_COMPILER_SPECIFIC_H_
|
||||
+#ifndef BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_
|
||||
+#define BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
#define NOINLINE
|
||||
#endif
|
||||
|
||||
-#endif // BUILD_RUST_STD_COMPILER_SPECIFIC_H_
|
||||
+#endif // BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_
|
||||
diff --git a/build/rust/std/immediate_crash.h b/build/rust/allocator/immediate_crash.h
|
||||
similarity index 97%
|
||||
rename from build/rust/std/immediate_crash.h
|
||||
rename to build/rust/allocator/immediate_crash.h
|
||||
index e4fd5a09d9379..9cbf9fd65f3e0 100644
|
||||
--- a/build/rust/std/immediate_crash.h
|
||||
+++ b/build/rust/allocator/immediate_crash.h
|
||||
@@ -5,8 +5,8 @@
|
||||
// This file has been copied from //base/immediate_crash.h.
|
||||
// TODO(crbug.com/40279749): Avoid code duplication / reuse code.
|
||||
|
||||
-#ifndef BUILD_RUST_STD_IMMEDIATE_CRASH_H_
|
||||
-#define BUILD_RUST_STD_IMMEDIATE_CRASH_H_
|
||||
+#ifndef BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_
|
||||
+#define BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
@@ -168,4 +168,4 @@
|
||||
|
||||
#endif // defined(__clang__) || defined(COMPILER_GCC)
|
||||
|
||||
-#endif // BUILD_RUST_STD_IMMEDIATE_CRASH_H_
|
||||
+#endif // BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_
|
||||
diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs
|
||||
new file mode 100644
|
||||
index 0000000000000..7f4a0fc245694
|
||||
--- /dev/null
|
||||
+++ b/build/rust/allocator/lib.rs
|
||||
@@ -0,0 +1,48 @@
|
||||
+// Copyright 2025 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+//! Define the allocator that Rust code in Chrome should use.
|
||||
+//!
|
||||
+//! Any final artifact that depends on this crate, even transitively, will use
|
||||
+//! the allocator defined here. Currently this is a thin wrapper around
|
||||
+//! allocator_impls.cc's functions; see the documentation there.
|
||||
+
|
||||
+use std::alloc::{GlobalAlloc, Layout};
|
||||
+
|
||||
+struct Allocator;
|
||||
+
|
||||
+unsafe impl GlobalAlloc for Allocator {
|
||||
+ unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
+ unsafe { ffi::alloc(layout.size(), layout.align()) }
|
||||
+ }
|
||||
+
|
||||
+ unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
+ unsafe {
|
||||
+ ffi::dealloc(ptr, layout.size(), layout.align());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
||||
+ unsafe { ffi::alloc_zeroed(layout.size(), layout.align()) }
|
||||
+ }
|
||||
+
|
||||
+ unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
||||
+ unsafe { ffi::realloc(ptr, layout.size(), layout.align(), new_size) }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[global_allocator]
|
||||
+static GLOBAL: Allocator = Allocator;
|
||||
+
|
||||
+#[cxx::bridge(namespace = "rust_allocator_internal")]
|
||||
+mod ffi {
|
||||
+ extern "C++" {
|
||||
+ include!("build/rust/allocator/allocator_impls.h");
|
||||
+
|
||||
+ unsafe fn alloc(size: usize, align: usize) -> *mut u8;
|
||||
+ unsafe fn dealloc(p: *mut u8, size: usize, align: usize);
|
||||
+ unsafe fn realloc(p: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
|
||||
+ unsafe fn alloc_zeroed(size: usize, align: usize) -> *mut u8;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/build/rust/cargo_crate.gni b/build/rust/cargo_crate.gni
|
||||
index 6d11c538bf4d5..d9912722b4ecd 100644
|
||||
--- a/build/rust/cargo_crate.gni
|
||||
+++ b/build/rust/cargo_crate.gni
|
||||
@@ -259,6 +259,12 @@ template("cargo_crate") {
|
||||
# Don't import the `chromium` crate into third-party code.
|
||||
no_chromium_prelude = true
|
||||
|
||||
+ # Don't depend on the chrome-specific #[global_allocator] crate from
|
||||
+ # third-party code. This avoids some dependency cycle issues. The allocator
|
||||
+ # crate will still be used if it exists anywhere in the dependency graph for
|
||||
+ # a given linked artifact.
|
||||
+ no_allocator_crate = true
|
||||
+
|
||||
rustc_metadata = _rustc_metadata
|
||||
|
||||
# TODO(crbug.com/40259764): don't default to true. This requires changes to
|
||||
@@ -483,6 +489,9 @@ template("cargo_crate") {
|
||||
# Don't import the `chromium` crate into third-party code.
|
||||
no_chromium_prelude = true
|
||||
|
||||
+ # Build scripts do not need to link to chrome's allocator.
|
||||
+ no_allocator_crate = true
|
||||
+
|
||||
# The ${_build_script_name}_output target looks for the exe in this
|
||||
# location. Due to how the Windows component build works, this has to
|
||||
# be $root_out_dir for all EXEs. In component build, C++ links to the
|
||||
diff --git a/build/rust/rust_macro.gni b/build/rust/rust_macro.gni
|
||||
index bcbb30ed44111..41d857632ccdc 100644
|
||||
--- a/build/rust/rust_macro.gni
|
||||
+++ b/build/rust/rust_macro.gni
|
||||
@@ -16,6 +16,9 @@ template("rust_macro") {
|
||||
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
|
||||
proc_macro_configs = invoker.configs
|
||||
target_type = "rust_proc_macro"
|
||||
+
|
||||
+ # Macros are loaded by rustc and shouldn't use chrome's allocation routines.
|
||||
+ no_allocator_crate = true
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/build/rust/rust_target.gni b/build/rust/rust_target.gni
|
||||
index 1a2f96337d436..1003a7b678352 100644
|
||||
--- a/build/rust/rust_target.gni
|
||||
+++ b/build/rust/rust_target.gni
|
||||
@@ -339,6 +339,10 @@ template("rust_target") {
|
||||
_rust_deps += [ "//build/rust/std" ]
|
||||
}
|
||||
|
||||
+ if (!defined(invoker.no_allocator_crate) || !invoker.no_allocator_crate) {
|
||||
+ _rust_deps += [ "//build/rust/allocator" ]
|
||||
+ }
|
||||
+
|
||||
if (_build_unit_tests) {
|
||||
_unit_test_target = "${_target_name}_unittests"
|
||||
if (defined(invoker.unit_test_target)) {
|
||||
diff --git a/build/rust/std/BUILD.gn b/build/rust/std/BUILD.gn
|
||||
index 6b996aa1fe386..25db126076b2f 100644
|
||||
--- a/build/rust/std/BUILD.gn
|
||||
+++ b/build/rust/std/BUILD.gn
|
||||
@@ -15,51 +15,12 @@
|
||||
# allocator functions to PartitionAlloc when `use_partition_alloc_as_malloc` is
|
||||
# true, so that Rust and C++ use the same allocator backend.
|
||||
|
||||
-import("//build/buildflag_header.gni")
|
||||
import("//build/config/compiler/compiler.gni")
|
||||
import("//build/config/coverage/coverage.gni")
|
||||
import("//build/config/rust.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
|
||||
-rust_allocator_uses_partition_alloc = false
|
||||
-if (build_with_chromium) {
|
||||
- import("//base/allocator/partition_allocator/partition_alloc.gni")
|
||||
- rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc
|
||||
-}
|
||||
-
|
||||
-buildflag_header("buildflags") {
|
||||
- header = "buildflags.h"
|
||||
- flags = [
|
||||
- "RUST_ALLOCATOR_USES_PARTITION_ALLOC=$rust_allocator_uses_partition_alloc",
|
||||
- ]
|
||||
- visibility = [ ":*" ]
|
||||
-}
|
||||
-
|
||||
if (toolchain_has_rust) {
|
||||
- # If clang performs the link step, we need to provide the allocator symbols
|
||||
- # that are normally injected by rustc during linking.
|
||||
- #
|
||||
- # We also "happen to" use this to redirect allocations to PartitionAlloc,
|
||||
- # though that would be better done through a #[global_allocator] crate (see
|
||||
- # above).
|
||||
- source_set("remap_alloc") {
|
||||
- public_deps = []
|
||||
- if (rust_allocator_uses_partition_alloc) {
|
||||
- public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ]
|
||||
- }
|
||||
- deps = [ ":buildflags" ]
|
||||
- sources = [
|
||||
- # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been
|
||||
- # copied from `//base`.
|
||||
- # TODO(crbug.com/40279749): Avoid duplication / reuse code.
|
||||
- "alias.cc",
|
||||
- "alias.h",
|
||||
- "compiler_specific.h",
|
||||
- "immediate_crash.h",
|
||||
- "remap_alloc.cc",
|
||||
- ]
|
||||
- }
|
||||
-
|
||||
# List of Rust stdlib rlibs which are present in the official Rust toolchain
|
||||
# we are using from the Android team. This is usually a version or two behind
|
||||
# nightly. Generally this matches the toolchain we build ourselves, but if
|
||||
@@ -269,8 +230,6 @@ if (toolchain_has_rust) {
|
||||
foreach(libname, stdlib_files + skip_stdlib_files) {
|
||||
deps += [ "rules:$libname" ]
|
||||
}
|
||||
-
|
||||
- public_deps = [ ":remap_alloc" ]
|
||||
}
|
||||
} else {
|
||||
action("find_stdlib") {
|
||||
diff --git a/components/cronet/android/dependencies.txt b/components/cronet/android/dependencies.txt
|
||||
index bf56bc45ed41f..c0e41ef7c6766 100644
|
||||
--- a/components/cronet/android/dependencies.txt
|
||||
+++ b/components/cronet/android/dependencies.txt
|
||||
@@ -14,6 +14,7 @@
|
||||
//build/config
|
||||
//build/config/compiler
|
||||
//build/rust
|
||||
+//build/rust/allocator
|
||||
//build/rust/chromium_prelude
|
||||
//build/rust/std
|
||||
//build/rust/std/rules
|
||||
diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn
|
||||
index 007fdff16e92e..00da4fa484998 100644
|
||||
--- a/third_party/breakpad/BUILD.gn
|
||||
+++ b/third_party/breakpad/BUILD.gn
|
||||
@@ -495,7 +495,10 @@ if (is_mac) {
|
||||
defines = [ "HAVE_MACH_O_NLIST_H" ]
|
||||
|
||||
# Rust demangle support.
|
||||
- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ]
|
||||
+ deps = [
|
||||
+ "//build/rust/allocator",
|
||||
+ "//third_party/rust/rustc_demangle_capi/v0_1:lib",
|
||||
+ ]
|
||||
defines += [ "HAVE_RUSTC_DEMANGLE" ]
|
||||
include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ]
|
||||
sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ]
|
||||
@@ -743,7 +746,10 @@ if (is_linux || is_chromeos || is_android) {
|
||||
include_dirs = [ "breakpad/src" ]
|
||||
|
||||
# Rust demangle support.
|
||||
- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ]
|
||||
+ deps = [
|
||||
+ "//build/rust/allocator",
|
||||
+ "//third_party/rust/rustc_demangle_capi/v0_1:lib",
|
||||
+ ]
|
||||
defines += [ "HAVE_RUSTC_DEMANGLE" ]
|
||||
include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ]
|
||||
sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ]
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
From adbc495726382c023b755c35aea36c6e9cad1950 Mon Sep 17 00:00:00 2001
|
||||
From: LN Liberda <lauren@selfisekai.rocks>
|
||||
Date: Sat, 23 Aug 2025 03:11:09 +0200
|
||||
Subject: [PATCH] hotfix: ignore a new warning in rust 1.89
|
||||
|
||||
---
|
||||
third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs
|
||||
index 1b729621c2f47..55d392c6da72f 100644
|
||||
--- a/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs
|
||||
+++ b/third_party/rust/chromium_crates_io/vendor/qr_code-v2/src/lib.rs
|
||||
@@ -5,7 +5,6 @@
|
||||
//!
|
||||
|
||||
#![deny(missing_docs)]
|
||||
-#![deny(warnings)]
|
||||
#![allow(
|
||||
clippy::must_use_candidate, // This is just annoying.
|
||||
clippy::use_self, // Rust 1.33 doesn't support Self::EnumVariant, let's try again in 1.37.
|
||||
|
|
@ -1,319 +0,0 @@
|
|||
From 5032162442c5f2f3093cd7646f3a06f826d7f7a8 Mon Sep 17 00:00:00 2001
|
||||
From: Collin Baker <collinbaker@chromium.org>
|
||||
Date: Mon, 7 Apr 2025 12:48:17 -0700
|
||||
Subject: [PATCH] Call Rust default allocator directly from Rust
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The Chromium `#[global_allocator] crate forwarded calls to the C++
|
||||
implementation, which in turn called into the Rust standard library
|
||||
implementations in some build configurations.
|
||||
|
||||
This Rust -> C++ -> Rust round trip is unnecessary, and the references
|
||||
to these symbols is blocking a toolchain update: upstream, these
|
||||
symbol names are now mangled.
|
||||
|
||||
Instead, use Rust conditional compilation to choose between the
|
||||
Chromium and the libstd-provided allocators.
|
||||
|
||||
Additionally, the remaining internal symbols defined in C++ are moved
|
||||
to Rust.
|
||||
|
||||
Bug: 408221149, 407024458
|
||||
Change-Id: I78f8c90d51a36a73099aa7d333091d7b8aded3c0
|
||||
|
||||
Cq-Include-Trybots: luci.chromium.try:android-rust-arm32-rel,android-rust-arm64-dbg,android-rust-arm64-rel,linux-rust-x64-dbg,linux-rust-x64-rel,mac-rust-x64-dbg,win-rust-x64-dbg,win-rust-x64-rel
|
||||
Change-Id: I78f8c90d51a36a73099aa7d333091d7b8aded3c0
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6434355
|
||||
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Commit-Queue: Collin Baker <collinbaker@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1443703}
|
||||
---
|
||||
build/rust/allocator/BUILD.gn | 54 +++++++------------
|
||||
build/rust/allocator/allocator_impls.cc | 28 +++++-----
|
||||
build/rust/allocator/allocator_impls.h | 2 +
|
||||
.../allocator/allocator_shim_definitions.cc | 30 -----------
|
||||
build/rust/allocator/lib.rs | 38 +++++++++++++
|
||||
5 files changed, 73 insertions(+), 79 deletions(-)
|
||||
delete mode 100644 build/rust/allocator/allocator_shim_definitions.cc
|
||||
|
||||
diff --git a/build/rust/allocator/BUILD.gn b/build/rust/allocator/BUILD.gn
|
||||
index 06aa47f097c9c..f09314afc8158 100644
|
||||
--- a/build/rust/allocator/BUILD.gn
|
||||
+++ b/build/rust/allocator/BUILD.gn
|
||||
@@ -12,6 +12,9 @@ if (build_with_chromium) {
|
||||
rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc
|
||||
}
|
||||
|
||||
+use_cpp_allocator_impls =
|
||||
+ rust_allocator_uses_partition_alloc || (is_win && is_asan)
|
||||
+
|
||||
buildflag_header("buildflags") {
|
||||
header = "buildflags.h"
|
||||
flags = [
|
||||
@@ -30,61 +33,44 @@ if (toolchain_has_rust) {
|
||||
crate_root = "lib.rs"
|
||||
cxx_bindings = [ "lib.rs" ]
|
||||
|
||||
- deps = [
|
||||
- ":allocator_impls",
|
||||
- ":allocator_shim_definitions",
|
||||
- ]
|
||||
+ deps = [ ":allocator_impls" ]
|
||||
|
||||
no_chromium_prelude = true
|
||||
no_allocator_crate = true
|
||||
allow_unsafe = true
|
||||
+
|
||||
+ if (use_cpp_allocator_impls) {
|
||||
+ rustflags = [
|
||||
+ "--cfg",
|
||||
+ "use_cpp_allocator_impls",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+ configs -= [ "//build/config/compiler:disallow_unstable_features" ]
|
||||
}
|
||||
|
||||
+ # TODO(crbug.com/408221149): don't build this when `use_cpp_allocator_impls`
|
||||
+ # is false.
|
||||
static_library("allocator_impls") {
|
||||
public_deps = []
|
||||
if (rust_allocator_uses_partition_alloc) {
|
||||
public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ]
|
||||
}
|
||||
|
||||
- sources = [
|
||||
- "allocator_impls.cc",
|
||||
- "allocator_impls.h",
|
||||
- ]
|
||||
-
|
||||
- deps = [
|
||||
- ":allocator_cpp_shared",
|
||||
- ":buildflags",
|
||||
-
|
||||
- # TODO(crbug.com/408221149): remove the C++ -> Rust dependency for the
|
||||
- # default allocator.
|
||||
- "//build/rust/std",
|
||||
- ]
|
||||
-
|
||||
- visibility = [ ":*" ]
|
||||
- }
|
||||
-
|
||||
- source_set("allocator_shim_definitions") {
|
||||
- sources = [ "allocator_shim_definitions.cc" ]
|
||||
-
|
||||
- deps = [ ":allocator_cpp_shared" ]
|
||||
-
|
||||
- visibility = [ ":*" ]
|
||||
- }
|
||||
-
|
||||
- source_set("allocator_cpp_shared") {
|
||||
sources = [
|
||||
# `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been
|
||||
# copied from `//base`.
|
||||
# TODO(crbug.com/40279749): Avoid duplication / reuse code.
|
||||
"alias.cc",
|
||||
"alias.h",
|
||||
+ "allocator_impls.cc",
|
||||
+ "allocator_impls.h",
|
||||
"compiler_specific.h",
|
||||
"immediate_crash.h",
|
||||
]
|
||||
|
||||
- visibility = [
|
||||
- ":allocator_impls",
|
||||
- ":allocator_shim_definitions",
|
||||
- ]
|
||||
+ deps = [ ":buildflags" ]
|
||||
+
|
||||
+ visibility = [ ":*" ]
|
||||
}
|
||||
}
|
||||
diff --git a/build/rust/allocator/allocator_impls.cc b/build/rust/allocator/allocator_impls.cc
|
||||
index 1fde98f23cd12..bf3c2a301adf5 100644
|
||||
--- a/build/rust/allocator/allocator_impls.cc
|
||||
+++ b/build/rust/allocator/allocator_impls.cc
|
||||
@@ -101,16 +101,6 @@
|
||||
#define USE_WIN_ALIGNED_MALLOC 0
|
||||
#endif
|
||||
|
||||
-// The default allocator functions provided by the Rust standard library.
|
||||
-extern "C" void* __rdl_alloc(size_t size, size_t align);
|
||||
-extern "C" void __rdl_dealloc(void* p, size_t size, size_t align);
|
||||
-extern "C" void* __rdl_realloc(void* p,
|
||||
- size_t old_size,
|
||||
- size_t align,
|
||||
- size_t new_size);
|
||||
-
|
||||
-extern "C" void* __rdl_alloc_zeroed(size_t size, size_t align);
|
||||
-
|
||||
namespace rust_allocator_internal {
|
||||
|
||||
unsigned char* alloc(size_t size, size_t align) {
|
||||
@@ -129,7 +119,8 @@ unsigned char* alloc(size_t size, size_t align) {
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
return static_cast<unsigned char*>(_aligned_malloc(size, align));
|
||||
#else
|
||||
- return static_cast<unsigned char*>(__rdl_alloc(size, align));
|
||||
+ // TODO(crbug.com/408221149): don't build this file in this case.
|
||||
+ IMMEDIATE_CRASH();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -143,7 +134,8 @@ void dealloc(unsigned char* p, size_t size, size_t align) {
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
return _aligned_free(p);
|
||||
#else
|
||||
- __rdl_dealloc(p, size, align);
|
||||
+ // TODO(crbug.com/408221149): don't build this file in this case.
|
||||
+ IMMEDIATE_CRASH();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -162,8 +154,8 @@ unsigned char* realloc(unsigned char* p,
|
||||
#elif USE_WIN_ALIGNED_MALLOC
|
||||
return static_cast<unsigned char*>(_aligned_realloc(p, new_size, align));
|
||||
#else
|
||||
- return static_cast<unsigned char*>(
|
||||
- __rdl_realloc(p, old_size, align, new_size));
|
||||
+ // TODO(crbug.com/408221149): don't build this file in this case.
|
||||
+ IMMEDIATE_CRASH();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -179,8 +171,14 @@ unsigned char* alloc_zeroed(size_t size, size_t align) {
|
||||
}
|
||||
return p;
|
||||
#else
|
||||
- return static_cast<unsigned char*>(__rdl_alloc_zeroed(size, align));
|
||||
+ // TODO(crbug.com/408221149): don't build this file in this case.
|
||||
+ IMMEDIATE_CRASH();
|
||||
#endif
|
||||
}
|
||||
|
||||
+void crash_immediately() {
|
||||
+ NO_CODE_FOLDING();
|
||||
+ IMMEDIATE_CRASH();
|
||||
+}
|
||||
+
|
||||
} // namespace rust_allocator_internal
|
||||
diff --git a/build/rust/allocator/allocator_impls.h b/build/rust/allocator/allocator_impls.h
|
||||
index afb335412faf9..e90ab7cd422c1 100644
|
||||
--- a/build/rust/allocator/allocator_impls.h
|
||||
+++ b/build/rust/allocator/allocator_impls.h
|
||||
@@ -20,6 +20,8 @@ unsigned char* realloc(unsigned char* p,
|
||||
size_t new_size);
|
||||
unsigned char* alloc_zeroed(size_t size, size_t align);
|
||||
|
||||
+void crash_immediately();
|
||||
+
|
||||
} // namespace rust_allocator_internal
|
||||
|
||||
#endif // BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_
|
||||
diff --git a/build/rust/allocator/allocator_shim_definitions.cc b/build/rust/allocator/allocator_shim_definitions.cc
|
||||
deleted file mode 100644
|
||||
index a4d1bd77b7016..0000000000000
|
||||
--- a/build/rust/allocator/allocator_shim_definitions.cc
|
||||
+++ /dev/null
|
||||
@@ -1,30 +0,0 @@
|
||||
-// Copyright 2025 The Chromium Authors
|
||||
-// Use of this source code is governed by a BSD-style license that can be
|
||||
-// found in the LICENSE file.
|
||||
-
|
||||
-#include <cstddef>
|
||||
-
|
||||
-#include "build/rust/allocator/alias.h"
|
||||
-#include "build/rust/allocator/immediate_crash.h"
|
||||
-
|
||||
-extern "C" {
|
||||
-
|
||||
-// As part of rustc's contract for using `#[global_allocator]` without
|
||||
-// rustc-generated shims we must define this symbol, since we are opting in to
|
||||
-// unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
-//
|
||||
-// Mark it weak since rustc will generate it when it drives linking.
|
||||
-[[maybe_unused]]
|
||||
-__attribute__((weak)) unsigned char __rust_no_alloc_shim_is_unstable;
|
||||
-
|
||||
-__attribute__((weak)) void __rust_alloc_error_handler(size_t size,
|
||||
- size_t align) {
|
||||
- NO_CODE_FOLDING();
|
||||
- IMMEDIATE_CRASH();
|
||||
-}
|
||||
-
|
||||
-__attribute__((
|
||||
- weak)) extern const unsigned char __rust_alloc_error_handler_should_panic =
|
||||
- 0;
|
||||
-
|
||||
-} // extern "C"
|
||||
diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs
|
||||
index 7f4a0fc245694..b8b67d9c6c649 100644
|
||||
--- a/build/rust/allocator/lib.rs
|
||||
+++ b/build/rust/allocator/lib.rs
|
||||
@@ -8,10 +8,20 @@
|
||||
//! the allocator defined here. Currently this is a thin wrapper around
|
||||
//! allocator_impls.cc's functions; see the documentation there.
|
||||
|
||||
+// Required to apply weak linkage to symbols.
|
||||
+#![feature(linkage)]
|
||||
+// Required to apply `#[rustc_std_internal_symbol]` to our alloc error handler
|
||||
+// so the name is correctly mangled as rustc expects.
|
||||
+#![cfg_attr(mangle_alloc_error_handler, allow(internal_features))]
|
||||
+#![cfg_attr(mangle_alloc_error_handler, feature(rustc_attrs))]
|
||||
+
|
||||
+#[cfg(use_cpp_allocator_impls)]
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
|
||||
+#[cfg(use_cpp_allocator_impls)]
|
||||
struct Allocator;
|
||||
|
||||
+#[cfg(use_cpp_allocator_impls)]
|
||||
unsafe impl GlobalAlloc for Allocator {
|
||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
unsafe { ffi::alloc(layout.size(), layout.align()) }
|
||||
@@ -32,9 +42,36 @@ unsafe impl GlobalAlloc for Allocator {
|
||||
}
|
||||
}
|
||||
|
||||
+#[cfg(use_cpp_allocator_impls)]
|
||||
#[global_allocator]
|
||||
static GLOBAL: Allocator = Allocator;
|
||||
|
||||
+#[cfg(not(use_cpp_allocator_impls))]
|
||||
+#[global_allocator]
|
||||
+static GLOBAL: std::alloc::System = std::alloc::System;
|
||||
+
|
||||
+// As part of rustc's contract for using `#[global_allocator]` without
|
||||
+// rustc-generated shims we must define this symbol, since we are opting in to
|
||||
+// unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
+#[no_mangle]
|
||||
+#[linkage = "weak"]
|
||||
+static __rust_no_alloc_shim_is_unstable: u8 = 0;
|
||||
+
|
||||
+#[no_mangle]
|
||||
+#[linkage = "weak"]
|
||||
+static __rust_alloc_error_handler_should_panic: u8 = 0;
|
||||
+
|
||||
+// Mangle the symbol name as rustc expects.
|
||||
+#[cfg_attr(mangle_alloc_error_handler, rustc_std_internal_symbol)]
|
||||
+#[cfg_attr(not(mangle_alloc_error_handler), no_mangle)]
|
||||
+#[linkage = "weak"]
|
||||
+fn __rust_alloc_error_handler(_size: usize, _align: usize) {
|
||||
+ unsafe { ffi::crash_immediately() }
|
||||
+}
|
||||
+
|
||||
+// TODO(crbug.com/408221149): conditionally include the FFI glue based on
|
||||
+// `use_cpp_allocator_impls`
|
||||
+#[allow(dead_code)]
|
||||
#[cxx::bridge(namespace = "rust_allocator_internal")]
|
||||
mod ffi {
|
||||
extern "C++" {
|
||||
@@ -44,5 +81,6 @@ mod ffi {
|
||||
unsafe fn dealloc(p: *mut u8, size: usize, align: usize);
|
||||
unsafe fn realloc(p: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
|
||||
unsafe fn alloc_zeroed(size: usize, align: usize) -> *mut u8;
|
||||
+ unsafe fn crash_immediately();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
reduced -lnl
|
||||
|
||||
From e201e2d467b0daad6cdbbfcd5b0e34760e4099c1 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Zhao <ayzhao@google.com>
|
||||
Date: Mon, 7 Apr 2025 18:15:01 -0700
|
||||
Subject: [PATCH] Roll rust *only* f7b43542838f0a4a6cfdb17fbeadf45002042a77-1 :
|
||||
3f690c2257b7080cd3a8cce64e082fc972148990-1
|
||||
|
||||
https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/f7b43542838f..3f690c2257b7
|
||||
|
||||
Ran: ./tools/clang/scripts/upload_revision.py 5b36835df010c5813808d34e45428c624fb52ff1
|
||||
|
||||
Additionally, add fixes to the rust allocator to address https://crbug.com/407024458.
|
||||
|
||||
Bug: 404285928,407024458
|
||||
Disable-Rts: True
|
||||
Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel
|
||||
Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel
|
||||
Cq-Include-Trybots: chromium/try:linux-chromeos-dbg
|
||||
Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng
|
||||
Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng
|
||||
Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng
|
||||
Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng
|
||||
Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official
|
||||
Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel
|
||||
Cq-Include-Trybots: chromium/try:mac-official,linux-official
|
||||
Cq-Include-Trybots: chromium/try:win-official,win32-official
|
||||
Cq-Include-Trybots: chromium/try:win-swangle-try-x86
|
||||
Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg
|
||||
Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel
|
||||
Cq-Include-Trybots: chrome/try:iphone-device
|
||||
Cq-Include-Trybots: chrome/try:linux-chromeos-chrome
|
||||
Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome
|
||||
Cq-Include-Trybots: chrome/try:linux-pgo,mac-pgo,win32-pgo,win64-pgo
|
||||
Cq-Include-Trybots: luci.chromium.try:linux-cast-x64-rel
|
||||
Cq-Include-Trybots: chromium/try:android-rust-arm32-rel
|
||||
Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg
|
||||
Cq-Include-Trybots: chromium/try:android-rust-arm64-rel
|
||||
Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg
|
||||
Cq-Include-Trybots: chromium/try:linux-rust-x64-rel
|
||||
Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg
|
||||
Cq-Include-Trybots: chromium/try:win-rust-x64-dbg
|
||||
Cq-Include-Trybots: chromium/try:win-rust-x64-rel
|
||||
Change-Id: Iec99681a89deaf3f2c79c76f9c4d1c2b2b7d6fe1
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6439711
|
||||
Reviewed-by: Collin Baker <collinbaker@chromium.org>
|
||||
Commit-Queue: Alan Zhao <ayzhao@google.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1443873}
|
||||
---
|
||||
build/rust/allocator/BUILD.gn | 6 +-
|
||||
build/rust/allocator/lib.rs | 6 +-
|
||||
build/rust/std/rules/BUILD.gn | 476 +++++++++++++++++-----------------
|
||||
tools/rust/update_rust.py | 2 +-
|
||||
4 files changed, 251 insertions(+), 239 deletions(-)
|
||||
|
||||
diff --git a/build/rust/allocator/BUILD.gn b/build/rust/allocator/BUILD.gn
|
||||
index f09314afc8158..ca581630c76c9 100644
|
||||
--- a/build/rust/allocator/BUILD.gn
|
||||
+++ b/build/rust/allocator/BUILD.gn
|
||||
@@ -32,6 +32,10 @@ if (toolchain_has_rust) {
|
||||
sources = [ "lib.rs" ]
|
||||
crate_root = "lib.rs"
|
||||
cxx_bindings = [ "lib.rs" ]
|
||||
+ rustflags = [
|
||||
+ "--cfg",
|
||||
+ "mangle_alloc_error_handler",
|
||||
+ ]
|
||||
|
||||
deps = [ ":allocator_impls" ]
|
||||
|
||||
@@ -40,7 +44,7 @@ if (toolchain_has_rust) {
|
||||
allow_unsafe = true
|
||||
|
||||
if (use_cpp_allocator_impls) {
|
||||
- rustflags = [
|
||||
+ rustflags += [
|
||||
"--cfg",
|
||||
"use_cpp_allocator_impls",
|
||||
]
|
||||
diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs
|
||||
index b8b67d9c6c649..4e2dad3d542a8 100644
|
||||
--- a/build/rust/allocator/lib.rs
|
||||
+++ b/build/rust/allocator/lib.rs
|
||||
@@ -57,13 +57,17 @@ static GLOBAL: std::alloc::System = std::alloc::System;
|
||||
#[linkage = "weak"]
|
||||
static __rust_no_alloc_shim_is_unstable: u8 = 0;
|
||||
|
||||
-#[no_mangle]
|
||||
+// Mangle the symbol name as rustc expects.
|
||||
+#[cfg_attr(mangle_alloc_error_handler, rustc_std_internal_symbol)]
|
||||
+#[cfg_attr(not(mangle_alloc_error_handler), no_mangle)]
|
||||
+#[allow(non_upper_case_globals)]
|
||||
#[linkage = "weak"]
|
||||
static __rust_alloc_error_handler_should_panic: u8 = 0;
|
||||
|
||||
// Mangle the symbol name as rustc expects.
|
||||
#[cfg_attr(mangle_alloc_error_handler, rustc_std_internal_symbol)]
|
||||
#[cfg_attr(not(mangle_alloc_error_handler), no_mangle)]
|
||||
+#[allow(non_upper_case_globals)]
|
||||
#[linkage = "weak"]
|
||||
fn __rust_alloc_error_handler(_size: usize, _align: usize) {
|
||||
unsafe { ffi::crash_immediately() }
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
From 4a0377f0b847af505915b0e0a6c4178d4e7c3244 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Jolly <kangie@gentoo.org>
|
||||
Date: Mon, 14 Apr 2025 20:16:46 -0700
|
||||
Subject: [PATCH] Drop `remap_alloc` dep
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit e3a1797dbab3eaa1c808d53215b32c8759d27ac7 dropped the source set
|
||||
that this refers to, in favour of a more modern, crate-based solution.
|
||||
|
||||
This seems to have been overlooked, possibly as it only appears to
|
||||
be called if using the unbundle toolchain.
|
||||
|
||||
Bug: 408221149
|
||||
Signed-off-by: Matt Jolly <kangie@gentoo.org>
|
||||
Change-Id: I1703d8e1e456161aa2b736169eec407235847099
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6456604
|
||||
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
|
||||
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
||||
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1446912}
|
||||
---
|
||||
build/rust/std/BUILD.gn | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/build/rust/std/BUILD.gn b/build/rust/std/BUILD.gn
|
||||
index 25db126076b2f..bb2c9884520b3 100644
|
||||
--- a/build/rust/std/BUILD.gn
|
||||
+++ b/build/rust/std/BUILD.gn
|
||||
@@ -355,12 +355,6 @@ if (toolchain_has_rust) {
|
||||
":stdlib_public_dependent_libs",
|
||||
]
|
||||
deps = [ ":prebuilt_rustc_copy_to_sysroot" ]
|
||||
-
|
||||
- # The host builds tools toolchain supports Rust only and does not use
|
||||
- # the allocator remapping to point it to PartitionAlloc.
|
||||
- if (!toolchain_for_rust_host_build_tools) {
|
||||
- deps += [ ":remap_alloc" ]
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,354 +0,0 @@
|
|||
From e65cb388e5da56d1236607e0db9cadf89e50eded Mon Sep 17 00:00:00 2001
|
||||
From: Lukasz Anforowicz <lukasza@chromium.org>
|
||||
Date: Tue, 15 Apr 2025 11:10:19 -0700
|
||||
Subject: [PATCH] [rust] Clean up `//build/rust/allocator` after a Rust
|
||||
toolchain roll.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This CL makes minor tweaks and changes under `//build/rust/allocator`:
|
||||
|
||||
* Thanks to the Rust toolchain roll, we no longer need to keep two
|
||||
implementations, picking between them using the
|
||||
`mangle_alloc_error_handler` configuration knob.
|
||||
* The `#[cfg(use_cpp_allocator_impls)]` vs
|
||||
`#[cfg(not(use_cpp_allocator_impls))]` choices have been deduplicated
|
||||
by putting the related/conditional stuff under `mod cpp_allocator` and
|
||||
`rust_allocator`.
|
||||
* Closes a minor gap missed in https://crrev.com/c/6432410:
|
||||
- Moving `DEPS` file to the new source location
|
||||
|
||||
Bug: 408221149
|
||||
Change-Id: Id541797e03da113a5271b02a5f60eb2be08254a9
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6454872
|
||||
Reviewed-by: Alan Zhao <ayzhao@google.com>
|
||||
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1447241}
|
||||
---
|
||||
build/rust/allocator/BUILD.gn | 11 +-
|
||||
build/rust/{std => allocator}/DEPS | 2 +-
|
||||
build/rust/allocator/allocator_impls.cc | 65 ++----------
|
||||
build/rust/allocator/allocator_impls.h | 2 +
|
||||
build/rust/allocator/lib.rs | 132 +++++++++++++++---------
|
||||
5 files changed, 97 insertions(+), 115 deletions(-)
|
||||
rename build/rust/{std => allocator}/DEPS (76%)
|
||||
|
||||
diff --git a/build/rust/allocator/BUILD.gn b/build/rust/allocator/BUILD.gn
|
||||
index ca581630c76c9..434a61e11bdbb 100644
|
||||
--- a/build/rust/allocator/BUILD.gn
|
||||
+++ b/build/rust/allocator/BUILD.gn
|
||||
@@ -32,10 +32,6 @@ if (toolchain_has_rust) {
|
||||
sources = [ "lib.rs" ]
|
||||
crate_root = "lib.rs"
|
||||
cxx_bindings = [ "lib.rs" ]
|
||||
- rustflags = [
|
||||
- "--cfg",
|
||||
- "mangle_alloc_error_handler",
|
||||
- ]
|
||||
|
||||
deps = [ ":allocator_impls" ]
|
||||
|
||||
@@ -43,13 +39,12 @@ if (toolchain_has_rust) {
|
||||
no_allocator_crate = true
|
||||
allow_unsafe = true
|
||||
|
||||
+ rustflags = []
|
||||
if (use_cpp_allocator_impls) {
|
||||
- rustflags += [
|
||||
- "--cfg",
|
||||
- "use_cpp_allocator_impls",
|
||||
- ]
|
||||
+ rustflags += [ "--cfg=use_cpp_allocator_impls" ]
|
||||
}
|
||||
|
||||
+ # TODO(https://crbug.com/410596442): Stop using unstable features here.
|
||||
configs -= [ "//build/config/compiler:disallow_unstable_features" ]
|
||||
}
|
||||
|
||||
diff --git a/build/rust/std/DEPS b/build/rust/allocator/DEPS
|
||||
similarity index 76%
|
||||
rename from build/rust/std/DEPS
|
||||
rename to build/rust/allocator/DEPS
|
||||
index eb524c0a06acd..923a2e07c80f4 100644
|
||||
--- a/build/rust/std/DEPS
|
||||
+++ b/build/rust/allocator/DEPS
|
||||
@@ -3,7 +3,7 @@ include_rules = [
|
||||
]
|
||||
|
||||
specific_include_rules = {
|
||||
- "remap_alloc.cc" : [
|
||||
+ "allocator_impls.cc" : [
|
||||
"+partition_alloc"
|
||||
]
|
||||
}
|
||||
diff --git a/build/rust/allocator/allocator_impls.cc b/build/rust/allocator/allocator_impls.cc
|
||||
index bf3c2a301adf5..8887752f3dfad 100644
|
||||
--- a/build/rust/allocator/allocator_impls.cc
|
||||
+++ b/build/rust/allocator/allocator_impls.cc
|
||||
@@ -24,62 +24,6 @@
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
-// NOTE: this documentation is outdated.
|
||||
-//
|
||||
-// TODO(crbug.com/408221149): update this documentation, or replace it with docs
|
||||
-// in the Rust allocator implementation.
|
||||
-//
|
||||
-// When linking a final binary, rustc has to pick between either:
|
||||
-// * The default Rust allocator
|
||||
-// * Any #[global_allocator] defined in *any rlib in its dependency tree*
|
||||
-// (https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/global-allocators.html)
|
||||
-//
|
||||
-// In this latter case, this fact will be recorded in some of the metadata
|
||||
-// within the .rlib file. (An .rlib file is just a .a file, but does have
|
||||
-// additional metadata for use by rustc. This is, as far as I know, the only
|
||||
-// such metadata we would ideally care about.)
|
||||
-//
|
||||
-// In all the linked rlibs,
|
||||
-// * If 0 crates define a #[global_allocator], rustc uses its default allocator
|
||||
-// * If 1 crate defines a #[global_allocator], rustc uses that
|
||||
-// * If >1 crates define a #[global_allocator], rustc bombs out.
|
||||
-//
|
||||
-// Because rustc does these checks, it doesn't just have the __rust_alloc
|
||||
-// symbols defined anywhere (neither in the stdlib nor in any of these
|
||||
-// crates which have a #[global_allocator] defined.)
|
||||
-//
|
||||
-// Instead:
|
||||
-// Rust's final linking stage invokes dynamic LLVM codegen to create symbols
|
||||
-// for the basic heap allocation operations. It literally creates a
|
||||
-// __rust_alloc symbol at link time. Unless any crate has specified a
|
||||
-// #[global_allocator], it simply calls from __rust_alloc into
|
||||
-// __rdl_alloc, which is the default Rust allocator. The same applies to a
|
||||
-// few other symbols.
|
||||
-//
|
||||
-// We're not (always) using rustc for final linking. For cases where we're not
|
||||
-// Rustc as the final linker, we'll define those symbols here instead. This
|
||||
-// allows us to redirect allocation to PartitionAlloc if clang is doing the
|
||||
-// link.
|
||||
-//
|
||||
-// We use unchecked allocation paths in PartitionAlloc rather than going through
|
||||
-// its shims in `malloc()` etc so that we can support fallible allocation paths
|
||||
-// such as Vec::try_reserve without crashing on allocation failure.
|
||||
-//
|
||||
-// In future, we should build a crate with a #[global_allocator] and
|
||||
-// redirect these symbols back to Rust in order to use to that crate instead.
|
||||
-// This would allow Rust-linked executables to:
|
||||
-// 1. Use PartitionAlloc on Windows. The stdlib uses Windows heap functions
|
||||
-// directly that PartitionAlloc can not intercept.
|
||||
-// 2. Have `Vec::try_reserve` to fail at runtime on Linux instead of crashing in
|
||||
-// malloc() where PartitionAlloc replaces that function.
|
||||
-//
|
||||
-// They're weak symbols, because this file will sometimes end up in targets
|
||||
-// which are linked by rustc, and thus we would otherwise get duplicate
|
||||
-// definitions. The following definitions will therefore only end up being
|
||||
-// used in targets which are linked by our C++ toolchain.
|
||||
-//
|
||||
-// # On Windows ASAN
|
||||
-//
|
||||
// In ASAN builds, PartitionAlloc-Everywhere is disabled, meaning malloc() and
|
||||
// friends in C++ do not go to PartitionAlloc. So we also don't point the Rust
|
||||
// allocation functions at PartitionAlloc. Generally, this means we just direct
|
||||
@@ -93,7 +37,6 @@
|
||||
// Note that there is a runtime option to make ASAN hook HeapAlloc() but
|
||||
// enabling it breaks Win32 APIs like CreateProcess:
|
||||
// https://issues.chromium.org/u/1/issues/368070343#comment29
|
||||
-
|
||||
#if !BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) && BUILDFLAG(IS_WIN) && \
|
||||
defined(ADDRESS_SANITIZER)
|
||||
#define USE_WIN_ALIGNED_MALLOC 1
|
||||
@@ -110,6 +53,10 @@ unsigned char* alloc(size_t size, size_t align) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+ // We use unchecked allocation paths in PartitionAlloc rather than going
|
||||
+ // through its shims in `malloc()` etc so that we can support fallible
|
||||
+ // allocation paths such as Vec::try_reserve without crashing on allocation
|
||||
+ // failure.
|
||||
if (align <= alignof(std::max_align_t)) {
|
||||
return static_cast<unsigned char*>(allocator_shim::UncheckedAlloc(size));
|
||||
} else {
|
||||
@@ -144,6 +91,10 @@ unsigned char* realloc(unsigned char* p,
|
||||
size_t align,
|
||||
size_t new_size) {
|
||||
#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC)
|
||||
+ // We use unchecked allocation paths in PartitionAlloc rather than going
|
||||
+ // through its shims in `malloc()` etc so that we can support fallible
|
||||
+ // allocation paths such as Vec::try_reserve without crashing on allocation
|
||||
+ // failure.
|
||||
if (align <= alignof(std::max_align_t)) {
|
||||
return static_cast<unsigned char*>(
|
||||
allocator_shim::UncheckedRealloc(p, new_size));
|
||||
diff --git a/build/rust/allocator/allocator_impls.h b/build/rust/allocator/allocator_impls.h
|
||||
index e90ab7cd422c1..e562a877d886e 100644
|
||||
--- a/build/rust/allocator/allocator_impls.h
|
||||
+++ b/build/rust/allocator/allocator_impls.h
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "build/build_config.h"
|
||||
#include "build/rust/allocator/buildflags.h"
|
||||
|
||||
+// This header exposes PartitionAlloc to Rust
|
||||
+// (most APIs below are called from `impl GlobalAlloc` in `lib.rs`).
|
||||
namespace rust_allocator_internal {
|
||||
|
||||
unsigned char* alloc(size_t size, size_t align);
|
||||
diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs
|
||||
index 4e2dad3d542a8..a4f898f9b107f 100644
|
||||
--- a/build/rust/allocator/lib.rs
|
||||
+++ b/build/rust/allocator/lib.rs
|
||||
@@ -5,72 +5,106 @@
|
||||
//! Define the allocator that Rust code in Chrome should use.
|
||||
//!
|
||||
//! Any final artifact that depends on this crate, even transitively, will use
|
||||
-//! the allocator defined here. Currently this is a thin wrapper around
|
||||
-//! allocator_impls.cc's functions; see the documentation there.
|
||||
+//! the allocator defined here.
|
||||
+//!
|
||||
+//! List of known issues:
|
||||
+//!
|
||||
+//! 1. We'd like to use PartitionAlloc on Windows, but the stdlib uses Windows
|
||||
+//! heap functions directly that PartitionAlloc can not intercept.
|
||||
+//! 2. We'd like `Vec::try_reserve` to fail at runtime on Linux instead of
|
||||
+//! crashing in malloc() where PartitionAlloc replaces that function.
|
||||
|
||||
// Required to apply weak linkage to symbols.
|
||||
+//
|
||||
+// TODO(https://crbug.com/410596442): Stop using unstable features here.
|
||||
+// https://github.com/rust-lang/rust/issues/29603 tracks stabilization of the `linkage` feature.
|
||||
#![feature(linkage)]
|
||||
// Required to apply `#[rustc_std_internal_symbol]` to our alloc error handler
|
||||
// so the name is correctly mangled as rustc expects.
|
||||
-#![cfg_attr(mangle_alloc_error_handler, allow(internal_features))]
|
||||
-#![cfg_attr(mangle_alloc_error_handler, feature(rustc_attrs))]
|
||||
+//
|
||||
+// TODO(https://crbug.com/410596442): Stop using internal features here.
|
||||
+#![allow(internal_features)]
|
||||
+#![feature(rustc_attrs)]
|
||||
|
||||
+/// Module that provides `#[global_allocator]` / `GlobalAlloc` interface for
|
||||
+/// using an allocator from C++.
|
||||
#[cfg(use_cpp_allocator_impls)]
|
||||
-use std::alloc::{GlobalAlloc, Layout};
|
||||
+mod cpp_allocator {
|
||||
+ use super::ffi;
|
||||
+ use std::alloc::{GlobalAlloc, Layout};
|
||||
|
||||
-#[cfg(use_cpp_allocator_impls)]
|
||||
-struct Allocator;
|
||||
+ struct Allocator;
|
||||
|
||||
-#[cfg(use_cpp_allocator_impls)]
|
||||
-unsafe impl GlobalAlloc for Allocator {
|
||||
- unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
- unsafe { ffi::alloc(layout.size(), layout.align()) }
|
||||
- }
|
||||
+ unsafe impl GlobalAlloc for Allocator {
|
||||
+ unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
+ unsafe { ffi::alloc(layout.size(), layout.align()) }
|
||||
+ }
|
||||
|
||||
- unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
- unsafe {
|
||||
- ffi::dealloc(ptr, layout.size(), layout.align());
|
||||
+ unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
+ unsafe {
|
||||
+ ffi::dealloc(ptr, layout.size(), layout.align());
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
|
||||
- unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
||||
- unsafe { ffi::alloc_zeroed(layout.size(), layout.align()) }
|
||||
- }
|
||||
+ unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
||||
+ unsafe { ffi::alloc_zeroed(layout.size(), layout.align()) }
|
||||
+ }
|
||||
|
||||
- unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
||||
- unsafe { ffi::realloc(ptr, layout.size(), layout.align(), new_size) }
|
||||
+ unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
||||
+ unsafe { ffi::realloc(ptr, layout.size(), layout.align(), new_size) }
|
||||
+ }
|
||||
}
|
||||
-}
|
||||
|
||||
-#[cfg(use_cpp_allocator_impls)]
|
||||
-#[global_allocator]
|
||||
-static GLOBAL: Allocator = Allocator;
|
||||
+ #[global_allocator]
|
||||
+ static GLOBAL: Allocator = Allocator;
|
||||
+}
|
||||
|
||||
+/// Module that provides `#[global_allocator]` / `GlobalAlloc` interface for
|
||||
+/// using the default Rust allocator.
|
||||
#[cfg(not(use_cpp_allocator_impls))]
|
||||
-#[global_allocator]
|
||||
-static GLOBAL: std::alloc::System = std::alloc::System;
|
||||
-
|
||||
-// As part of rustc's contract for using `#[global_allocator]` without
|
||||
-// rustc-generated shims we must define this symbol, since we are opting in to
|
||||
-// unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
-#[no_mangle]
|
||||
-#[linkage = "weak"]
|
||||
-static __rust_no_alloc_shim_is_unstable: u8 = 0;
|
||||
-
|
||||
-// Mangle the symbol name as rustc expects.
|
||||
-#[cfg_attr(mangle_alloc_error_handler, rustc_std_internal_symbol)]
|
||||
-#[cfg_attr(not(mangle_alloc_error_handler), no_mangle)]
|
||||
-#[allow(non_upper_case_globals)]
|
||||
-#[linkage = "weak"]
|
||||
-static __rust_alloc_error_handler_should_panic: u8 = 0;
|
||||
-
|
||||
-// Mangle the symbol name as rustc expects.
|
||||
-#[cfg_attr(mangle_alloc_error_handler, rustc_std_internal_symbol)]
|
||||
-#[cfg_attr(not(mangle_alloc_error_handler), no_mangle)]
|
||||
-#[allow(non_upper_case_globals)]
|
||||
-#[linkage = "weak"]
|
||||
-fn __rust_alloc_error_handler(_size: usize, _align: usize) {
|
||||
- unsafe { ffi::crash_immediately() }
|
||||
+mod rust_allocator {
|
||||
+ #[global_allocator]
|
||||
+ static GLOBAL: std::alloc::System = std::alloc::System;
|
||||
+}
|
||||
+
|
||||
+/// Module that provides global symbols that are needed both by `cpp_allocator`
|
||||
+/// and `rust_allocator`.
|
||||
+///
|
||||
+/// When `rustc` drives linking, then it will define the symbols below. But
|
||||
+/// Chromium only uses `rustc` to link Rust-only executables (e.g. `build.rs`
|
||||
+/// scripts) and otherwise uses a non-Rust linker. This is why we have to
|
||||
+/// manually define a few symbols below. We define those symbols
|
||||
+/// as "weak" symbols, so that Rust-provided symbols "win" in case where Rust
|
||||
+/// actually does drive the linking. This hack works (not only for Chromium,
|
||||
+/// but also for google3 and other projects), but isn't officially supported by
|
||||
+/// `rustc`.
|
||||
+///
|
||||
+/// TODO(https://crbug.com/410596442): Stop using internal features here.
|
||||
+mod both_allocators {
|
||||
+ use super::ffi;
|
||||
+
|
||||
+ /// As part of rustc's contract for using `#[global_allocator]` without
|
||||
+ /// rustc-generated shims we must define this symbol, since we are opting in
|
||||
+ /// to unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
+ #[no_mangle]
|
||||
+ #[linkage = "weak"]
|
||||
+ static __rust_no_alloc_shim_is_unstable: u8 = 0;
|
||||
+
|
||||
+ // Mangle the symbol name as rustc expects.
|
||||
+ #[rustc_std_internal_symbol]
|
||||
+ #[allow(non_upper_case_globals)]
|
||||
+ #[linkage = "weak"]
|
||||
+ static __rust_alloc_error_handler_should_panic: u8 = 0;
|
||||
+
|
||||
+ // Mangle the symbol name as rustc expects.
|
||||
+ #[rustc_std_internal_symbol]
|
||||
+ #[allow(non_upper_case_globals)]
|
||||
+ #[linkage = "weak"]
|
||||
+ fn __rust_alloc_error_handler(_size: usize, _align: usize) {
|
||||
+ // TODO(lukasza): Investigate if we can just call `std::process::abort()` here.
|
||||
+ // (Not really _needed_, but it could simplify code a little bit.)
|
||||
+ unsafe { ffi::crash_immediately() }
|
||||
+ }
|
||||
}
|
||||
|
||||
// TODO(crbug.com/408221149): conditionally include the FFI glue based on
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=electron
|
||||
pkgver=35.4.0
|
||||
pkgver=38.4.0
|
||||
_gittag=v"${pkgver/_beta/-beta.}"
|
||||
pkgrel=0
|
||||
_chromium=134.0.6998.205
|
||||
_copium_tag=134.0
|
||||
pkgrel=1
|
||||
_chromium=140.0.7339.240
|
||||
_copium_tag=140.2
|
||||
_depot_tools=495b23b39aaba2ca3b55dd27cadc523f1cb17ee6
|
||||
pkgdesc="Electron cross-platform desktop toolkit"
|
||||
url="https://github.com/electron/electron"
|
||||
# armv7: Segmentation fault on builder despite building in CI
|
||||
arch="aarch64 x86_64" # same as chromium
|
||||
license="MIT"
|
||||
depends="gtk+3.0 so:libudev.so.1 xdg-utils"
|
||||
|
|
@ -24,8 +25,8 @@ makedepends="
|
|||
c-ares-dev
|
||||
cairo-dev
|
||||
clang$_llvmver-dev
|
||||
clang$_llvmver-rtlib
|
||||
clang-extra-tools
|
||||
compiler-rt
|
||||
crc32c-dev
|
||||
cups-dev
|
||||
curl-dev
|
||||
|
|
@ -74,7 +75,7 @@ makedepends="
|
|||
libxscrnsaver-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
lld
|
||||
lld$_llvmver
|
||||
llhttp-dev
|
||||
llvm$_llvmver
|
||||
mesa-dev
|
||||
|
|
@ -116,18 +117,20 @@ subpackages="$pkgname-lang $pkgname-dev"
|
|||
source="
|
||||
https://ayakael.net/api/packages/mirrors/generic/electron/$_gittag/electron-$_gittag-$_chromium.tar.zst
|
||||
copium-$_copium_tag.tar.gz::https://codeberg.org/selfisekai/copium/archive/$_copium_tag.tar.gz
|
||||
chromium-revert-drop-of-system-java.patch
|
||||
0001-hotfix-ignore-a-new-warning-in-rust-1.89.patch
|
||||
compiler.patch
|
||||
disable-dns_config_service.patch
|
||||
disable-failing-tests.patch
|
||||
fc-cache-version.patch
|
||||
fix-opus.patch
|
||||
fix-ffmpeg-codec-list.patch
|
||||
fstatat-32bit.patch
|
||||
gdbinit.patch
|
||||
generic-sensor-include.patch
|
||||
musl-auxv.patch
|
||||
headless-shell-no-license.patch
|
||||
musl-sandbox.patch
|
||||
musl-tid-caching.patch
|
||||
net-test-no-vpython.patch
|
||||
net-test-pyws3-py3.12.patch
|
||||
no-execinfo.patch
|
||||
no-mallinfo.patch
|
||||
no-res-ninit-nclose.patch
|
||||
|
|
@ -135,19 +138,13 @@ source="
|
|||
partalloc-no-tagging-arm64.patch
|
||||
pvalloc.patch
|
||||
temp-failure-retry.patch
|
||||
pipewire-1.4.patch
|
||||
gperf-3.2-fix.patch
|
||||
0001-Reland-Use-global_allocator-to-provide-Rust-allocato.patch
|
||||
0002-Call-Rust-default-allocator-directly-from-Rust.patch
|
||||
0003-Roll-rust-only-f7b43542838f0a4a6cfdb17fbeadf45002042.patch
|
||||
0004-Drop-remap_alloc-dep.patch
|
||||
0005-rust-Clean-up-build-rust-allocator-after-a-Rust-tool.patch
|
||||
|
||||
electron_icon.patch
|
||||
electron_python-jinja-3.10.patch
|
||||
electron_webpack-hash.patch
|
||||
electron_unbundle-node.patch
|
||||
electron_system-zlib-headers.patch
|
||||
electron_do-not-strip-binaries.patch
|
||||
|
||||
default.conf
|
||||
electron.desktop
|
||||
|
|
@ -157,8 +154,10 @@ _copium_patches="
|
|||
cr131-v8-non4k-pages.patch
|
||||
cr133-ffmpeg-no-noh264parse.patch
|
||||
cr133-is-musl-libcxx.patch
|
||||
cr133-mv2-still-not-dead.patch
|
||||
cr134-unbundle-simdutf.patch
|
||||
cr135-mv2-still-not-dead.patch
|
||||
cr138-node-version-check.patch
|
||||
cr140-musl-prctl.patch
|
||||
cr140-rust-pre1.89.patch
|
||||
"
|
||||
# Avoid conflicting providers
|
||||
sonameprefix="$pkgname:"
|
||||
|
|
@ -166,17 +165,19 @@ sonameprefix="$pkgname:"
|
|||
options="!check net suid"
|
||||
builddir="$srcdir/electron-$_gittag-$_chromium"
|
||||
|
||||
export CC=clang-$_llvmver
|
||||
export CXX=clang++-$_llvmver
|
||||
export CC="/usr/lib/llvm$_llvmver/bin/clang"
|
||||
export CXX="/usr/lib/llvm$_llvmver/bin/clang++"
|
||||
|
||||
# required to find the tools
|
||||
export AR=llvm-ar
|
||||
export NM=llvm-nm
|
||||
export LD=clang++-$_llvmver
|
||||
export NM="/usr/lib/llvm$_llvmver/bin/llvm-nm"
|
||||
export AR="/usr/lib/llvm$_llvmver/bin/llvm-ar"
|
||||
export LD="/usr/lib/llvm$_llvmver/bin/clang++"
|
||||
|
||||
# less log spam, reproducible
|
||||
export CFLAGS="${CFLAGS/-g/} -O2 -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-shift-count-overflow -Wno-ignored-attributes"
|
||||
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-invalid-constexpr"
|
||||
# _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE is set by project
|
||||
export CXXFLAGS="${CXXFLAGS/-D_LIBCPP_ENABLE_HARDENED_MODE=1/}"
|
||||
export CPPFLAGS="${CPPFLAGS/-g/} -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
|
||||
case "$CARCH" in
|
||||
aarch64|arm*|riscv64)
|
||||
|
|
@ -269,6 +270,8 @@ snapshot() {
|
|||
mcli cp "$SRCDEST"/$pkgname-$_gittag-$_chromium.tar.zst "$_distbucket"
|
||||
}
|
||||
|
||||
export RUSTC_BOOTSTRAP=1
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
|
|
@ -420,6 +423,8 @@ prepare() {
|
|||
third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
|
||||
third_party/libxml/chromium/*.cc
|
||||
|
||||
echo "$CTARGET" >> build/rust/known-target-triples.txt
|
||||
|
||||
_configure
|
||||
}
|
||||
|
||||
|
|
@ -453,10 +458,9 @@ _configure() {
|
|||
custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
|
||||
disable_fieldtrial_testing_config=true
|
||||
enable_hangout_services_extension=true
|
||||
enable_nacl=false
|
||||
enable_nocompile_tests=false
|
||||
enable_stripping=false
|
||||
enable_rust=true
|
||||
enable_stripping=false
|
||||
enable_vr=false
|
||||
fatal_linker_warnings=false
|
||||
ffmpeg_branding=\"Chrome\"
|
||||
|
|
@ -469,6 +473,7 @@ _configure() {
|
|||
is_musl=true
|
||||
is_official_build=true
|
||||
link_pulseaudio=true
|
||||
node_version_check=false
|
||||
proprietary_codecs=true
|
||||
rtc_link_pipewire=true
|
||||
rtc_use_pipewire=true
|
||||
|
|
@ -551,39 +556,35 @@ lang() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
30a116328f9a5af05b16cf85e31672407c51aef895b29441220f439d66af947272daa8e2ac88d9e4b8f7a9e0bb883932c36d2f1642fd18c5da885931c1c97fe0 electron-v35.4.0-134.0.6998.205.tar.zst
|
||||
c1857b5d6975650f915f3db552666f521822b857e39958ccfb54129f3878f272deaafc3dd446bc8441a5e84f075791feeeb62841b74bb555d8c546bfe231d164 copium-134.0.tar.gz
|
||||
29bb685e03356a77df5fd347cdf55194cc8b3265c421cc76e54d64edefc329dbcb052deb26b22e8f587ce68456876c071de1b7d258dd0fcc6ee66c875ec4a020 chromium-revert-drop-of-system-java.patch
|
||||
d9cc4a37a0311d23ae315a8d8124f8dbf60db8cc4a3943818638174b20387f1d770d00871f6608957b246ad956abca43c22ea0b072724287f2947e1909e47323 compiler.patch
|
||||
4057cc78f10bfd64092bc35a373869abb1d68b880cdbca70422f39ffd78a929c19c7728d4d4c40709aaba25581148a93ae5343e724849fd35323062ed68753fa disable-dns_config_service.patch
|
||||
2470904846e3adde2c9506f9e78220daca0932320b628dd3d427bf2b7c17a8f7880cb97e787b046c28de7aca642e1a8d30824d6049905976da77e7473baa64da disable-failing-tests.patch
|
||||
5fc5c012c1db6cf1ba82f38c6f3f4f5ca3a209e47ac708a74de379b018e0649b7694877c9571ef79002dde875ffc07b458a3355425f1c01867f362c66c2bc1bf fc-cache-version.patch
|
||||
f7fe8a8e5eee17310fb4c3e5de621b4b89ea0567f75033c65be970950cca62b50c5fbd004735e4ad39bdb2e1638b3b73ea614203d323f8181ae18c71edf302a0 fix-opus.patch
|
||||
127017c1b96dd3cfb438bd079e3f14338e38c646fa26d8bc0b4dabc31a615b22a88d742cb7ef8dc9c28eaeb9c38198b78b176edaec8ae81287ba3f04388377be electron-v38.4.0-140.0.7339.240.tar.zst
|
||||
472d7879560c4d62cda34b72288a2dda4917e9b5854a02eda22686a5e5cb3aeae0787f0d4e17c2b72c201178b0864a549226af57db79ad70902f3e85289a8ab6 copium-140.2.tar.gz
|
||||
69b45005451ccd69c354b4c2910e92371cb801665f5e300dbecd36f8bc4ce68e77a431b5dac07c0937787debb4e93b7aadefa0a1e76c4ae334d2547ca3ca14ff 0001-hotfix-ignore-a-new-warning-in-rust-1.89.patch
|
||||
b3eb30c66e80e8273ce180ee40ad746d819e11a18ab17dd88554ae9bd0734bfd7a9b1df2d6bac3b9d143803a3a18fe75bad4526ef8c225e29630a29827d544f0 compiler.patch
|
||||
1bee1448e409fedff635388ee6f1efa6d23c29ae3e6b6fd31452c56974adb40fcd0088c82d1e643d549154663e402942cbab9807dff5aff2d8997a09de6f5655 disable-dns_config_service.patch
|
||||
0ef9168b8b1a4779bc4c8df718735e06d29e459dcfd00f8cbf9a4edaf9fade8089225219e46dead7de81de716bddc8d745dc2069db0ee7f7e5d2f64c5236e2ab disable-failing-tests.patch
|
||||
872bea229ce2442bfd15eae89ac2559e3b3e0f72d8d6435c941774fa052706362f0d4e524a167136a970a5a8009bcf406ab2bd4d6d2b4b5098f6a7a6368caa45 fc-cache-version.patch
|
||||
87f63d83139562e058f3f649eb1f62bf100dd92c2bb6ee393fdce0c8f7d7c188a7062394647aafe4e82c0a8fbbffeb613edc5c8dd9415dd9dda777827ea371c5 fix-ffmpeg-codec-list.patch
|
||||
c63dee5044353eb306a39ca1526158c0f003ab310ecb03d1c368dc2a979454590c84b8d3c15484517d5e66bb8add9b231da9abbadf2e50850abd72ac1345c4ab fstatat-32bit.patch
|
||||
33ee60863cc438ef57ffef92ba4cf67a856a5ffc16138bce241bcf87e47b15154aa86918e793c26f7ec4dc62a445257ad5673ed7001daf22c4043cf6cc57da7f gdbinit.patch
|
||||
36a764fa73443b47d38050b52dbe6ad2fa8d67201ff4ccdbad13b52308ef165ca046aac6f9609fe35890a6485f0f3e672e78cc41e3e44f3cdc7f145e540524e8 generic-sensor-include.patch
|
||||
99bcc7dd485b404a90c606a96addab1d900852128d44fb8cea8acc7303189ef87c89a7b0e749fd0e10c5ef5f6bf1fadeb5c16a34503cab6a59938ce2653d887e musl-auxv.patch
|
||||
a94cf7a0670abf5178abba33c619cc6d41d73f2e16c7a1fd5b152152f5077df103e049d166e3b8627797c38113821d2f2e6b64cd48d132c1e90ad32d63a349f5 headless-shell-no-license.patch
|
||||
51f1959bd622af26a1c3a1f4b0ad9a5bfa461057aa4cf9960c568dddf8ac47d55989c277f5d5ab5db040a04c54925a531af7a1cc767559218b408eaa6bdd7577 musl-sandbox.patch
|
||||
e7163ac5810ac85366cef2447412287c856e3d67c6b77f219a6e5a418b1965b98e449c409424ad0704a5bded9355dd0aec3dc4585918ce5a2ab36c079707afe2 musl-tid-caching.patch
|
||||
3b7420d58d13dfc4baab5065e3017f666f51fed6de087af42a660a839d7b4444b50d1a93204322d213df36c6722eaf6b08d46d50dc374198a342da2675fafff5 net-test-no-vpython.patch
|
||||
e487662b6606ea526ddd716c31e6b9ad3d61f1bee5356cd94b78a903efb3928338cbb48e3d5840b34c3b70a71e8361a228430bd50e707ad301228a7049d59e37 net-test-pyws3-py3.12.patch
|
||||
a250cff50d282b02ce0f28880d0a2b4fb8e7df51bc072bfeeddc561c29a7c76453dbcbc7b17b82966a7b30a31409d2555720d1dcf963e1b3fb8a2a06a6abcf46 no-execinfo.patch
|
||||
0b41aeb6b212f9c3f61aa0a8d3085c9e865a2e68f3270ceec2376aab67f337ac46eaea7da36d3fd7219e2a1cb731b7aa2d3fb619a374d2b7653976b9f4f384bb no-mallinfo.patch
|
||||
e4c4e5bc6f828f9c883dd418c0ba01887949c29c311f76206a1ec29f620b0c0ba0452949dc2778a9c46ea066405857536964a36436a68eecf7da7952736333cf no-res-ninit-nclose.patch
|
||||
6dc4d8dc92e685dace62265a1ddb3aebc558aed54d20ff6d36b030be0c48d7e84662326c31363612492574d9a03c62653cdc21a60995b97dee1d75cae86a9f9b no-sandbox-settls.patch
|
||||
f2b08538ff57c50b3772a07ca91845f9d45f4a5112f608b6192d4fb5d7be48f478c0c36194d95ab7bbf933e0278e5c6d578619d8643895cdc40386eebc5b975f partalloc-no-tagging-arm64.patch
|
||||
b75908a45ee2f4f806eec8d86fca2f51fda3531b88de48ef4539c364a40d7e2897cdaf38b715682d712648e3f43aac983055e688385f85fa7b7204ffb6d617e1 partalloc-no-tagging-arm64.patch
|
||||
03f829a2da633533ef3fd0f287f5ec602d936a97a98b53cd2415553c2537ae9d571f35397ca7c9fb3f4b0806c300e3b189569f8d979ca132e1a2a4dae7206396 pvalloc.patch
|
||||
e48693e6b7aeebf69a5acbf80d9a35defe4c23835121dfeb58b051ac7c527e758a41004f4d193274fe1b01c0bfb1dbc77b09cb6a404a3fdee507a2918afb0edb temp-failure-retry.patch
|
||||
1814096bc611e7f56cc5c570214dae715a4cda1fba96a6b585a73a1abc8b9161efaa799dc83887dac531dbafe9479bbe235cabe1a61cb3081e268c53a6144908 pipewire-1.4.patch
|
||||
4bc087a1e5acbb0f8f884756b40c127df88699ecd6eb42c4aff6691b87239bb6915dd102e9ef2544502a12bff011859ad497206940473e6b0a0fd75afb562a4c gperf-3.2-fix.patch
|
||||
858f8e3c544abf3ffe0f54ba303713e9b4058e15996c8dc10bab7c999d82e1960756325a41d6bebb3a00404efb8e51c299f61f60de4feaac6b621757ab85d329 0001-Reland-Use-global_allocator-to-provide-Rust-allocato.patch
|
||||
077497c1598c7db9f4c23e000e9b86e1833de4866479fd921313543ad599e141427bf38ae687f84c3da59af68f09a776265c2a569e1a7abfa80440231baef10a 0002-Call-Rust-default-allocator-directly-from-Rust.patch
|
||||
5002aa73eb19b87c702eef5b087ecb3a2679142c28cd95a5a9571aeffe24e6944497e862058ed1d609317a723cdec1678f84543235fb93f12653a92b92309efe 0003-Roll-rust-only-f7b43542838f0a4a6cfdb17fbeadf45002042.patch
|
||||
d2e414135d2b046dd9efe277f88062bcb0a94749a17a014309260b1469305d55059931b9531572713c8e516897e30fd2f5317948ece1581ffe9b7b6c01078a6d 0004-Drop-remap_alloc-dep.patch
|
||||
fe66228c0eefe3d08e2a7955b11e6a46f58f477befceba1628765fb016f30eb0bb02723aeedcabdb1ea3b84c42b5ea65073998e0a64f5ce082120fc7e65dee9a 0005-rust-Clean-up-build-rust-allocator-after-a-Rust-tool.patch
|
||||
465107da7818b237e3c144a318ab80c3c9343b51ed38b8971ef204692d13346929becbe94cefad4c153788d3a200642143584d5ca070f6304e768ba2139c19ec electron_icon.patch
|
||||
e05180199ee1d559e4e577cedd3e589844ecf40d98a86321bf1bea5607b02eeb5feb486deddae40e1005b644550331f6b8500177aa7e79bcb3750d3c1ceb76c3 electron_python-jinja-3.10.patch
|
||||
2aa340854316f1284217c0ca17cbf44953684ad6c7da90815117df30928612eb9fb9ffb734b948dfc309cd25d1a67cd57f77aac2d052a3dd9aca07a3a58cbb30 electron_webpack-hash.patch
|
||||
c7f57929943a86f9e5f333da9d5691da88038770eeb46dd0a0719962c934deb2879f0e7a1ed714e9383e38ee4d68eb754501f362c4d7cdee76cfc2e980b21272 electron_unbundle-node.patch
|
||||
4d9287d4cdfe27fbfb7be3d4b26c0c40edbd6a0c3ff926d60f2093ca09c15bcb58e20c2ccc8c0606aafd66c6d25a54225bc329cb056d8c5b297db4c6d0e768e6 electron_system-zlib-headers.patch
|
||||
7031ddb61a858e95d83366185a53b5a2e4be9abe0aa4957543e0621cad57175ffef31bd87b8be25255184bb4cb30ec4fbced055407c6c8c7940c9e240b25d498 electron_do-not-strip-binaries.patch
|
||||
e8ea87c547546011c4c8fc2de30e4f443b85cd4cfcff92808e2521d2f9ada03feefb8e1b0cf0f6b460919c146e56ef8d5ad4bb5e2461cc5247c30d92eb4d068e default.conf
|
||||
191559fc7aa1ea0353c6fb0cc321ee1d5803a0e44848c8be941cfab96277b0de6a59962d373e2a2a1686c8f9be2bcf2d2f33706759a339a959e297d3f7fda463 electron.desktop
|
||||
5f7ba5ad005f196facec1c0f26108356b64cafb1e5cfa462ff714a33b8a4c757ac00bfcb080da09eb5b65032f8eb245d9676a61ec554515d125ed63912708648 electron-launcher.sh
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
This was dropped for some reason in 6951c37cecd05979b232a39e5c10e6346a0f74ef
|
||||
allows using /usr/bin/java instead of a downloaded one (that doesn't work on musl)
|
||||
--
|
||||
--- a/third_party/closure_compiler/compiler.py 2021-05-20 04:17:53.000000000 +0200
|
||||
+++ b/third_party/closure_compiler/compiler.py 2021-05-20 04:17:53.000000000 +0200
|
||||
@@ -13,8 +13,9 @@
|
||||
|
||||
|
||||
_CURRENT_DIR = os.path.join(os.path.dirname(__file__))
|
||||
-_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java")
|
||||
-assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds"
|
||||
+_JAVA_BIN = "java"
|
||||
+_JDK_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java")
|
||||
+_JAVA_PATH = _JDK_PATH if os.path.isfile(_JDK_PATH) else _JAVA_BIN
|
||||
|
||||
class Compiler(object):
|
||||
"""Runs the Closure compiler on given source files to typecheck them
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
--- ./build/config/compiler/BUILD.gn.orig
|
||||
+++ ./build/config/compiler/BUILD.gn
|
||||
@@ -591,24 +591,6 @@
|
||||
@@ -662,24 +662,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -25,58 +25,91 @@
|
|||
# TODO(crbug.com/40192287): Investigate why/if this should be needed.
|
||||
if (is_win) {
|
||||
cflags += [ "/clang:-ffp-contract=off" ]
|
||||
@@ -1045,20 +1027,6 @@
|
||||
# `-nodefaultlibs` from the linker invocation from Rust, which would be used
|
||||
# to compile dylibs on Android, such as for constructing unit test APKs.
|
||||
"-Cdefault-linker-libraries",
|
||||
-
|
||||
- # To make Rust .d files compatible with ninja
|
||||
- "-Zdep-info-omit-d-target",
|
||||
-
|
||||
- # If a macro panics during compilation, show which macro and where it is
|
||||
- # defined.
|
||||
- "-Zmacro-backtrace",
|
||||
-
|
||||
- # For deterministic builds, keep the local machine's current working
|
||||
- # directory from appearing in build outputs.
|
||||
- "-Zremap-cwd-prefix=.",
|
||||
-
|
||||
- # We use clang-rt sanitizer runtimes.
|
||||
- "-Zexternal-clangrt",
|
||||
]
|
||||
|
||||
if (!is_win || force_rustc_color_output) {
|
||||
@@ -1107,7 +1075,6 @@
|
||||
# Don't allow unstable features to be enabled by `#![feature()]` without
|
||||
# additional command line flags.
|
||||
config("disallow_unstable_features") {
|
||||
- rustflags = [ "-Zallow-features=" ]
|
||||
}
|
||||
|
||||
config("libcxx_hardening") {
|
||||
@@ -1242,8 +1209,8 @@
|
||||
}
|
||||
@@ -1282,8 +1264,8 @@
|
||||
# simplicity we always explicitly set the architecture.
|
||||
if (current_cpu == "x64") {
|
||||
if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
|
||||
- cflags += [ "--target=x86_64-unknown-linux-gnu" ]
|
||||
- ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
|
||||
+ cflags += [ "--target=x86_64-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=x86_64-alpine-linux-musl" ]
|
||||
} else {
|
||||
cflags += [ "-m64" ]
|
||||
ldflags += [ "-m64" ]
|
||||
@@ -1291,8 +1273,8 @@
|
||||
cflags += [ "-msse3" ]
|
||||
} else if (current_cpu == "x86") {
|
||||
if (is_clang && !is_android && !is_chromeos_device) {
|
||||
- cflags += [ "--target=i386-unknown-linux-gnu" ]
|
||||
- ldflags += [ "--target=i386-unknown-linux-gnu" ]
|
||||
+ cflags += [ "--target=i586-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=i586-alpine-linux-musl" ]
|
||||
} else {
|
||||
cflags += [ "-m32" ]
|
||||
ldflags += [ "-m32" ]
|
||||
@@ -1303,8 +1285,8 @@
|
||||
]
|
||||
} else if (current_cpu == "arm") {
|
||||
if (is_clang && !is_android && !is_nacl && !is_chromeos_device) {
|
||||
if (is_clang && !is_android && !is_chromeos_device) {
|
||||
- cflags += [ "--target=arm-linux-gnueabihf" ]
|
||||
- ldflags += [ "--target=arm-linux-gnueabihf" ]
|
||||
+ cflags += [ "--target=armv7-alpine-linux-musleabihf" ]
|
||||
+ ldflags += [ "--target=armv7-alpine-linux-musleabihf" ]
|
||||
}
|
||||
if (!is_nacl) {
|
||||
cflags += [
|
||||
@@ -1257,8 +1224,8 @@
|
||||
cflags += [
|
||||
"-march=$arm_arch",
|
||||
@@ -1315,8 +1297,8 @@
|
||||
}
|
||||
} else if (current_cpu == "arm64") {
|
||||
if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
|
||||
!is_chromeos_device) {
|
||||
if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
|
||||
- cflags += [ "--target=aarch64-linux-gnu" ]
|
||||
- ldflags += [ "--target=aarch64-linux-gnu" ]
|
||||
+ cflags += [ "--target=aarch64-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=aarch64-alpine-linux-musl" ]
|
||||
}
|
||||
} else if (current_cpu == "mipsel" && !is_nacl) {
|
||||
} else if (current_cpu == "mipsel") {
|
||||
ldflags += [ "-Wl,--hash-style=sysv" ]
|
||||
@@ -2086,7 +2053,7 @@
|
||||
@@ -1560,22 +1542,22 @@
|
||||
ldflags += [ "-maix64" ]
|
||||
}
|
||||
} else if (is_clang) {
|
||||
- cflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
|
||||
- ldflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
|
||||
+ cflags += [ "--target=powerpc64le-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=powerpc64le-alpine-linux-musl" ]
|
||||
} else {
|
||||
cflags += [ "-m64" ]
|
||||
ldflags += [ "-m64" ]
|
||||
}
|
||||
} else if (current_cpu == "riscv64") {
|
||||
if (is_clang && !is_android) {
|
||||
- cflags += [ "--target=riscv64-linux-gnu" ]
|
||||
- ldflags += [ "--target=riscv64-linux-gnu" ]
|
||||
+ cflags += [ "--target=riscv64-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=riscv64-alpine-linux-musl" ]
|
||||
}
|
||||
cflags += [ "-mabi=lp64d" ]
|
||||
} else if (current_cpu == "loong64") {
|
||||
if (is_clang) {
|
||||
- cflags += [ "--target=loongarch64-linux-gnu" ]
|
||||
- ldflags += [ "--target=loongarch64-linux-gnu" ]
|
||||
+ cflags += [ "--target=loongarch64-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=loongarch64-alpine-linux-musl" ]
|
||||
}
|
||||
cflags += [
|
||||
"-mabi=lp64d",
|
||||
@@ -1583,8 +1565,8 @@
|
||||
]
|
||||
} else if (current_cpu == "s390x") {
|
||||
if (is_clang) {
|
||||
- cflags += [ "--target=s390x-unknown-linux-gnu" ]
|
||||
- ldflags += [ "--target=s390x-unknown-linux-gnu" ]
|
||||
+ cflags += [ "--target=s390x-alpine-linux-musl" ]
|
||||
+ ldflags += [ "--target=s390x-alpine-linux-musl" ]
|
||||
}
|
||||
cflags += [ "-m64" ]
|
||||
ldflags += [ "-m64" ]
|
||||
@@ -2290,7 +2272,7 @@
|
||||
defines = [ "_HAS_NODISCARD" ]
|
||||
}
|
||||
} else {
|
||||
|
|
@ -87,7 +120,7 @@
|
|||
cflags += [ "-Wextra" ]
|
||||
--- ./build/config/rust.gni.orig
|
||||
+++ ./build/config/rust.gni
|
||||
@@ -198,13 +198,13 @@
|
||||
@@ -188,13 +188,13 @@
|
||||
rust_abi_target = ""
|
||||
if (is_linux || is_chromeos) {
|
||||
if (current_cpu == "arm64") {
|
||||
|
|
@ -104,11 +137,15 @@
|
|||
cargo_target_abi = ""
|
||||
} else if (current_cpu == "arm") {
|
||||
if (arm_float_abi == "hard") {
|
||||
@@ -214,18 +214,18 @@
|
||||
}
|
||||
if (arm_arch == "armv7-a" || arm_arch == "armv7") {
|
||||
# No way to inform Rust about the -a suffix.
|
||||
- rust_abi_target = "armv7-unknown-linux-gnueabi" + float_suffix
|
||||
@@ -213,31 +213,27 @@
|
||||
# The thumbv7 vs. armv7 distinction is for legacy reasons and both
|
||||
# targets in fact target Thumb, see:
|
||||
# https://github.com/rust-lang/rust/issues/44722
|
||||
- if (arm_use_neon) {
|
||||
- rust_abi_target = "thumbv7neon-unknown-linux-gnueabi" + float_suffix
|
||||
- } else {
|
||||
- rust_abi_target = "armv7-unknown-linux-gnueabi" + float_suffix
|
||||
- }
|
||||
+ rust_abi_target = "armv7-alpine-linux-musleabi" + float_suffix
|
||||
cargo_target_abi = "eabi" + float_suffix
|
||||
} else {
|
||||
|
|
@ -120,18 +157,30 @@
|
|||
- rust_abi_target = "riscv64gc-unknown-linux-gnu"
|
||||
+ rust_abi_target = "riscv64-alpine-linux-musl"
|
||||
cargo_target_abi = ""
|
||||
} else if (current_cpu == "ppc64") {
|
||||
- rust_abi_target = "powerpc64le-unknown-linux-gnu"
|
||||
+ rust_abi_target = "powerpc64le-alpine-linux-musl"
|
||||
cargo_target_abi = ""
|
||||
} else if (current_cpu == "s390x") {
|
||||
- rust_abi_target = "s390x-unknown-linux-gnu"
|
||||
+ rust_abi_target = "s390x-alpine-linux-musl"
|
||||
cargo_target_abi = ""
|
||||
} else if (current_cpu == "loong64") {
|
||||
- rust_abi_target = "loongarch64-unknown-linux-gnu"
|
||||
+ rust_abi_target = "loongarch64-alpine-linux-musl"
|
||||
cargo_target_abi = ""
|
||||
} else {
|
||||
# Best guess for other future platforms.
|
||||
- rust_abi_target = current_cpu + "-unknown-linux-gnu"
|
||||
+ rust_abi_target = current_cpu + "-alpine-linux-musl"
|
||||
+ rust_abi_target = current_cpu + "-unknown-linux-musl"
|
||||
cargo_target_abi = ""
|
||||
}
|
||||
} else if (is_android) {
|
||||
--- ./build/config/clang/BUILD.gn.orig
|
||||
+++ ./build/config/clang/BUILD.gn
|
||||
@@ -128,14 +128,15 @@
|
||||
} else if (is_apple) {
|
||||
_dir = "darwin"
|
||||
@@ -207,22 +207,23 @@
|
||||
assert(false) # Unhandled cpu type
|
||||
}
|
||||
} else if (is_linux || is_chromeos) {
|
||||
+ _dir = "linux"
|
||||
if (current_cpu == "x64") {
|
||||
|
|
@ -146,16 +195,18 @@
|
|||
} else if (current_cpu == "arm64") {
|
||||
- _dir = "aarch64-unknown-linux-gnu"
|
||||
+ _suffix = "-aarch64"
|
||||
} else if (current_cpu == "loong64") {
|
||||
- _dir = "loongarch64-unknown-linux-gnu"
|
||||
+ _suffix = "-loongarch64"
|
||||
} else if (current_cpu == "riscv64") {
|
||||
- _dir = "riscv64-unknown-linux-gnu"
|
||||
+ _suffix = "-riscv64"
|
||||
} else if (current_cpu == "ppc64") {
|
||||
- _dir = "ppc64le-unknown-linux-gnu"
|
||||
+ _suffix = "-powerpc64le"
|
||||
} else if (current_cpu == "s390x") {
|
||||
- _dir = "s390x-unknown-linux-gnu"
|
||||
+ _suffix = "-s390x"
|
||||
} else {
|
||||
assert(false) # Unhandled cpu type
|
||||
}
|
||||
--- ./build/config/gcc/BUILD.gn.orig
|
||||
+++ ./build/config/gcc/BUILD.gn
|
||||
@@ -32,7 +32,6 @@
|
||||
# See http://gcc.gnu.org/wiki/Visibility
|
||||
config("symbol_visibility_hidden") {
|
||||
cflags = [ "-fvisibility=hidden" ]
|
||||
- rustflags = [ "-Zdefault-visibility=hidden" ]
|
||||
|
||||
# Visibility attribute is not supported on AIX.
|
||||
if (current_os != "aix") {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn
|
|||
index f36bf68..805d9a6 100644
|
||||
--- a/net/dns/BUILD.gn
|
||||
+++ b/net/dns/BUILD.gn
|
||||
@@ -130,8 +130,8 @@ source_set("dns") {
|
||||
@@ -142,8 +142,8 @@
|
||||
]
|
||||
} else if (is_linux) {
|
||||
sources += [
|
||||
|
|
@ -13,3 +13,11 @@ index f36bf68..805d9a6 100644
|
|||
]
|
||||
} else if (is_posix) {
|
||||
sources += [
|
||||
@@ -455,7 +455,6 @@
|
||||
if (is_android) {
|
||||
sources += [ "dns_config_service_android_unittest.cc" ]
|
||||
} else if (is_linux) {
|
||||
- sources += [ "dns_config_service_linux_unittest.cc" ]
|
||||
} else if (is_posix) {
|
||||
sources += [ "dns_config_service_posix_unittest.cc" ]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,86 +2,6 @@ safesprintf emitnull:
|
|||
error: conversion from 'std::nullptr_t' to 'const internal::Arg' is ambiguous
|
||||
const internal::Arg arg_array[] = { args... };
|
||||
|
||||
flatmap incompletetype:
|
||||
error: static assertion failed due to requirement 'std::__is_complete_or_unbounded(std::__type_identity<std::pair<A, A>>{})': template argument must be a complete class or an unbounded array
|
||||
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
|
||||
|
||||
i18n, time:
|
||||
various icu failures (new icu time formatting? internal api difference?)
|
||||
a ton of these fail:
|
||||
|
||||
Expected equality of these values:
|
||||
u"Monday 16 May – Saturday 28 May"
|
||||
Which is: u"Monday 16 May \x2013 Saturday 28 May"
|
||||
DateIntervalFormat(begin_time, end_time, DATE_FORMAT_MONTH_WEEKDAY_DAY)
|
||||
Which is: u"Monday 16\x2009\x2013\x2009Saturday 28 May"
|
||||
|
||||
../../base/i18n/time_formatting_unittest.cc:84: Failure
|
||||
Expected equality of these values:
|
||||
clock12h_pm
|
||||
Which is: u"3:42 PM"
|
||||
TimeFormatTimeOfDay(time)
|
||||
Which is: u"3:42\x202FPM"
|
||||
|
||||
.. and so on
|
||||
|
||||
fileutiltest filetofile:
|
||||
../../base/files/file_util_unittest.cc:2692: Failure
|
||||
Value of: stream
|
||||
Actual: true
|
||||
Expected: false
|
||||
|
||||
stacktracetest: crashes (this doesn't seem to use execinfo so probably relies on glibc internal layout for tracing here)
|
||||
|
||||
platformthreadtest canchangethreadtype:
|
||||
../../base/threading/platform_thread_unittest.cc:445: Failure
|
||||
Expected equality of these values:
|
||||
PlatformThread::CanChangeThreadType(ThreadType::kBackground, ThreadType::kResourceEfficient)
|
||||
Which is: true
|
||||
kCanIncreasePriority
|
||||
Which is: false
|
||||
|
||||
scopedfdownershiptrackingtest crashonunownedclose: fails due to scoped-file-no-close.patch
|
||||
|
||||
stackcontainer customallocator:
|
||||
../../base/containers/stack_container_unittest.cc:211: Failure
|
||||
Expected equality of these values:
|
||||
1
|
||||
Allocator::deallocated
|
||||
Which is: 0
|
||||
|
||||
nativelibrarytest loadlibrarypreferownsymbols: crashes (probably musl dlopen does not play nice here)
|
||||
|
||||
spantest empty: crashes (this looks fishy)
|
||||
|
||||
readelfbuildid: crashes (this looks like glibc dynamic linker semantics)
|
||||
|
||||
nss db unittest: various nss failures: e.g.:
|
||||
../../net/cert/nss_cert_database_unittest.cc:209: Failure
|
||||
Expected equality of these values:
|
||||
OK
|
||||
Which is: 0
|
||||
cert_db_->ImportFromPKCS12(GetPublicSlot(), pkcs12_data, u"12345", true, nullptr)
|
||||
Which is: -702
|
||||
|
||||
processutiltest cloneflags: fails in CI (ulimit? too many threads?)
|
||||
../../base/process/process_util_unittest.cc:1434: Failure
|
||||
Value of: process.IsValid()
|
||||
Actual: false
|
||||
Expected: true
|
||||
|
||||
addresstrackerlinuxnetlinktest:
|
||||
../../net/base/address_tracker_linux_unittest.cc:886: Failure
|
||||
Value of: child.process.IsValid()
|
||||
Actual: false
|
||||
Expected: true
|
||||
|
||||
ToAddressDoesNotDereference: ; Expected `get_for_extraction_cnt` to be 1 but got 0;
|
||||
|
||||
DataCapturedManyThreads: flaky
|
||||
|
||||
ProcessAlternativeServicesTest.Process*: crashed ?
|
||||
|
||||
--- a/base/strings/safe_sprintf_unittest.cc
|
||||
+++ b/base/strings/safe_sprintf_unittest.cc
|
||||
@@ -740,6 +740,7 @@
|
||||
|
|
@ -100,244 +20,3 @@ ProcessAlternativeServicesTest.Process*: crashed ?
|
|||
|
||||
TEST(SafeSPrintfTest, PointerSize) {
|
||||
// The internal data representation is a 64bit value, independent of the
|
||||
--- a/base/containers/flat_map_unittest.cc
|
||||
+++ b/base/containers/flat_map_unittest.cc
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
} // namespace
|
||||
|
||||
+#if 0
|
||||
TEST(FlatMap, IncompleteType) {
|
||||
struct A {
|
||||
using Map = flat_map<A, A>;
|
||||
@@ -65,6 +66,7 @@
|
||||
|
||||
A a;
|
||||
}
|
||||
+#endif
|
||||
|
||||
TEST(FlatMap, RangeConstructor) {
|
||||
flat_map<int, int>::value_type input_vals[] = {
|
||||
--- a/base/BUILD.gn
|
||||
+++ b/base/BUILD.gn
|
||||
@@ -3194,21 +3194,6 @@
|
||||
"hash/md5_constexpr_unittest.cc",
|
||||
"hash/md5_unittest.cc",
|
||||
"hash/sha1_unittest.cc",
|
||||
- "i18n/break_iterator_unittest.cc",
|
||||
- "i18n/case_conversion_unittest.cc",
|
||||
- "i18n/char_iterator_unittest.cc",
|
||||
- "i18n/character_encoding_unittest.cc",
|
||||
- "i18n/file_util_icu_unittest.cc",
|
||||
- "i18n/icu_string_conversions_unittest.cc",
|
||||
- "i18n/icu_util_unittest.cc",
|
||||
- "i18n/message_formatter_unittest.cc",
|
||||
- "i18n/number_formatting_unittest.cc",
|
||||
- "i18n/rtl_unittest.cc",
|
||||
- "i18n/streaming_utf8_validator_unittest.cc",
|
||||
- "i18n/string_search_unittest.cc",
|
||||
- "i18n/time_formatting_unittest.cc",
|
||||
- "i18n/timezone_unittest.cc",
|
||||
- "i18n/transliterator_unittest.cc",
|
||||
"immediate_crash_unittest.cc",
|
||||
"json/json_parser_unittest.cc",
|
||||
"json/json_reader_unittest.cc",
|
||||
--- a/base/files/file_util_unittest.cc
|
||||
+++ b/base/files/file_util_unittest.cc
|
||||
@@ -2686,6 +2686,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
TEST_F(FileUtilTest, FileToFILE) {
|
||||
File file;
|
||||
FILE* stream = FileToFILE(std::move(file), "w");
|
||||
@@ -2700,6 +2701,7 @@
|
||||
EXPECT_FALSE(file.IsValid());
|
||||
EXPECT_TRUE(CloseFile(stream));
|
||||
}
|
||||
+#endif
|
||||
|
||||
TEST_F(FileUtilTest, FILEToFile) {
|
||||
ScopedFILE stream;
|
||||
--- a/base/threading/platform_thread_unittest.cc
|
||||
+++ b/base/threading/platform_thread_unittest.cc
|
||||
@@ -416,6 +416,7 @@
|
||||
// platforms for all priorities. This not being the case. This test documents
|
||||
// and hardcodes what we know. Please inform scheduler-dev@chromium.org if this
|
||||
// proprerty changes for a given platform.
|
||||
+#if 0
|
||||
TEST(PlatformThreadTest, CanChangeThreadType) {
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
// On Ubuntu, RLIMIT_NICE and RLIMIT_RTPRIO are 0 by default, so we won't be
|
||||
@@ -472,6 +473,7 @@
|
||||
ThreadType::kBackground));
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
|
||||
TEST(PlatformThreadTest, SetCurrentThreadTypeTest) {
|
||||
TestPriorityResultingFromThreadType(ThreadType::kBackground,
|
||||
--- a/base/files/scoped_file_linux_unittest.cc
|
||||
+++ b/base/files/scoped_file_linux_unittest.cc
|
||||
@@ -42,11 +42,13 @@
|
||||
EXPECT_DEATH(ScopedFD(fd.get()), "");
|
||||
}
|
||||
|
||||
+#if 0
|
||||
TEST_F(ScopedFDOwnershipTrackingTest, CrashOnUnownedClose) {
|
||||
ScopedFD fd = OpenFD();
|
||||
subtle::EnableFDOwnershipEnforcement(true);
|
||||
EXPECT_DEATH(close(fd.get()), "");
|
||||
}
|
||||
+#endif
|
||||
|
||||
#endif // defined(GTEST_HAS_DEATH_TEST)
|
||||
|
||||
--- a/base/native_library_unittest.cc
|
||||
+++ b/base/native_library_unittest.cc
|
||||
@@ -139,6 +139,7 @@
|
||||
// Verifies that the |prefer_own_symbols| option satisfies its guarantee that
|
||||
// a loaded library will always prefer local symbol resolution before
|
||||
// considering global symbols.
|
||||
+#if 0
|
||||
TEST(NativeLibraryTest, LoadLibraryPreferOwnSymbols) {
|
||||
NativeLibraryOptions options;
|
||||
options.prefer_own_symbols = true;
|
||||
@@ -171,6 +172,7 @@
|
||||
EXPECT_EQ(2, NativeLibraryTestIncrement());
|
||||
EXPECT_EQ(3, NativeLibraryTestIncrement());
|
||||
}
|
||||
+#endif
|
||||
|
||||
#endif // !BUILDFLAG(IS_ANDROID) && !defined(THREAD_SANITIZER) && \
|
||||
// !defined(MEMORY_SANITIZER)
|
||||
--- a/base/containers/span_unittest.cc
|
||||
+++ b/base/containers/span_unittest.cc
|
||||
@@ -995,6 +995,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
TEST(SpanTest, Empty) {
|
||||
{
|
||||
span<int> span;
|
||||
@@ -1014,6 +1015,7 @@
|
||||
EXPECT_TRUE(span_of_checked_iterators.empty());
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
TEST(SpanTest, OperatorAt) {
|
||||
static constexpr int kArray[] = {1, 6, 1, 8, 0};
|
||||
--- a/base/debug/elf_reader_unittest.cc
|
||||
+++ b/base/debug/elf_reader_unittest.cc
|
||||
@@ -194,6 +194,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
TEST(ElfReaderTestWithCurrentImage, ReadElfBuildId) {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// On Android the library loader memory maps the full so file.
|
||||
@@ -229,6 +230,7 @@
|
||||
UnloadNativeLibrary(library);
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace debug
|
||||
} // namespace base
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -4826,7 +4826,6 @@
|
||||
sources += [
|
||||
"cert/internal/system_trust_store_nss_unittest.cc",
|
||||
"cert/internal/trust_store_nss_unittest.cc",
|
||||
- "cert/nss_cert_database_unittest.cc",
|
||||
"cert/x509_util_nss_unittest.cc",
|
||||
]
|
||||
if (!is_castos) {
|
||||
--- a/base/process/process_util_unittest.cc
|
||||
+++ b/base/process/process_util_unittest.cc
|
||||
@@ -1419,7 +1419,7 @@
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
-#if defined(CLONE_NEWUSER) && defined(CLONE_NEWPID)
|
||||
+#if 0 && defined(CLONE_NEWUSER) && defined(CLONE_NEWPID)
|
||||
TEST_F(ProcessUtilTest, CloneFlags) {
|
||||
if (!PathExists(FilePath("/proc/self/ns/user")) ||
|
||||
!PathExists(FilePath("/proc/self/ns/pid"))) {
|
||||
--- a/net/base/address_tracker_linux_unittest.cc
|
||||
+++ b/net/base/address_tracker_linux_unittest.cc
|
||||
@@ -831,6 +831,7 @@
|
||||
//
|
||||
// This test creates multiple concurrent `AddressTrackerLinux` instances in
|
||||
// separate processes, each in their own PID namespaces.
|
||||
+#if 0
|
||||
TEST(AddressTrackerLinuxNetlinkTest, TestInitializeTwoTrackersInPidNamespaces) {
|
||||
// This test initializes `kNumChildren` instances of `AddressTrackerLinux` in
|
||||
// tracking mode, each in their own child process running in a PID namespace.
|
||||
@@ -901,6 +902,7 @@
|
||||
ASSERT_EQ(exit_code, 0);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
MULTIPROCESS_TEST_MAIN(ChildProcessInitializeTrackerForTesting) {
|
||||
base::test::TaskEnvironment task_env(
|
||||
--- a/base/trace_event/trace_event_unittest.cc
|
||||
+++ b/base/trace_event/trace_event_unittest.cc
|
||||
@@ -1368,6 +1368,7 @@
|
||||
}
|
||||
|
||||
// Test that data sent from multiple threads is gathered
|
||||
+#if 0
|
||||
TEST_F(TraceEventTestFixture, DataCapturedManyThreads) {
|
||||
BeginTrace();
|
||||
|
||||
@@ -1408,6 +1409,7 @@
|
||||
delete task_complete_events[i];
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Test that thread and process names show up in the trace.
|
||||
// In SDK build, thread names are not tracked inside //base. Instead, there's
|
||||
--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc
|
||||
+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_unittest.cc
|
||||
@@ -1481,6 +1481,7 @@
|
||||
// `base::to_address()` will use the dereference operator. This is not
|
||||
// what we want; this test enforces extraction semantics for
|
||||
// `to_address()`.
|
||||
+#if 0
|
||||
TEST_F(RawPtrTest, ToAddressDoesNotDereference) {
|
||||
CountingRawPtr<int> ptr = nullptr;
|
||||
int* raw = base::to_address(ptr);
|
||||
@@ -1492,6 +1493,7 @@
|
||||
.get_for_duplication_cnt = 0}),
|
||||
CountersMatch());
|
||||
}
|
||||
+#endif
|
||||
|
||||
TEST_F(RawPtrTest, ToAddressGivesBackRawAddress) {
|
||||
int* raw = nullptr;
|
||||
--- a/net/http/http_stream_factory_unittest.cc
|
||||
+++ b/net/http/http_stream_factory_unittest.cc
|
||||
@@ -3477,6 +3477,7 @@
|
||||
DefaultCTPolicyEnforcer ct_policy_enforcer_;
|
||||
};
|
||||
|
||||
+#if 0
|
||||
TEST_F(ProcessAlternativeServicesTest, ProcessEmptyAltSvc) {
|
||||
session_ =
|
||||
std::make_unique<HttpNetworkSession>(session_params_, session_context_);
|
||||
@@ -3585,6 +3586,7 @@
|
||||
alternatives[0].host_port_pair());
|
||||
EXPECT_EQ(0u, alternatives[0].advertised_versions().size());
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
|
|
|
|||
127
backports/electron/electron_do-not-strip-binaries.patch
Normal file
127
backports/electron/electron_do-not-strip-binaries.patch
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
diff --git a/electron/BUILD.gn.orig b/electron/BUILD.gn
|
||||
index b08f434..4062428 100644
|
||||
--- a/electron/BUILD.gn.orig
|
||||
+++ b/electron/BUILD.gn
|
||||
@@ -44,7 +44,6 @@ if (is_mac) {
|
||||
|
||||
if (is_linux) {
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
- import("//electron/build/linux/strip_binary.gni")
|
||||
import("//tools/generate_stubs/rules.gni")
|
||||
|
||||
pkg_config("gio_unix") {
|
||||
@@ -1424,18 +1423,6 @@ dist_zip("electron_dist_zip") {
|
||||
":licenses",
|
||||
]
|
||||
if (is_linux) {
|
||||
- if (is_official_build) {
|
||||
- data_deps += [
|
||||
- ":strip_chrome_crashpad_handler",
|
||||
- ":strip_chrome_sandbox",
|
||||
- ":strip_electron_binary",
|
||||
- ":strip_libEGL_shlib",
|
||||
- ":strip_libGLESv2_shlib",
|
||||
- ":strip_libffmpeg_shlib",
|
||||
- ":strip_libvk_swiftshader_shlib",
|
||||
- ]
|
||||
- }
|
||||
-
|
||||
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
|
||||
}
|
||||
deps = data_deps
|
||||
@@ -1481,16 +1468,6 @@ group("electron_mksnapshot") {
|
||||
|
||||
dist_zip("electron_mksnapshot_zip") {
|
||||
data_deps = mksnapshot_deps
|
||||
- if (is_linux && is_official_build) {
|
||||
- data_deps += [
|
||||
- ":strip_libEGL_shlib",
|
||||
- ":strip_libGLESv2_shlib",
|
||||
- ":strip_libffmpeg_shlib",
|
||||
- ":strip_libvk_swiftshader_shlib",
|
||||
- ":strip_mksnapshot_binary",
|
||||
- ":strip_v8_context_snapshot_generator_binary",
|
||||
- ]
|
||||
- }
|
||||
deps = data_deps
|
||||
outputs = [ "$root_build_dir/mksnapshot.zip" ]
|
||||
}
|
||||
@@ -1637,78 +1614,3 @@ group("release_build") {
|
||||
]
|
||||
}
|
||||
}
|
||||
-
|
||||
-if (is_linux && is_official_build) {
|
||||
- strip_binary("strip_electron_binary") {
|
||||
- binary_input = "$root_out_dir/$electron_project_name"
|
||||
- symbol_output = "$root_out_dir/debug/$electron_project_name.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ ":electron_app" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_chrome_crashpad_handler") {
|
||||
- binary_input = "$root_out_dir/chrome_crashpad_handler"
|
||||
- symbol_output = "$root_out_dir/debug/chrome_crashpad_handler.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_chrome_sandbox") {
|
||||
- binary_input = "$root_out_dir/chrome_sandbox"
|
||||
- symbol_output = "$root_out_dir/debug/chrome-sandbox.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//sandbox/linux:chrome_sandbox" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_libEGL_shlib") {
|
||||
- binary_input = "$root_out_dir/libEGL.so"
|
||||
- symbol_output = "$root_out_dir/debug/libEGL.so.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//third_party/angle:libEGL" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_libGLESv2_shlib") {
|
||||
- binary_input = "$root_out_dir/libGLESv2.so"
|
||||
- symbol_output = "$root_out_dir/debug/libGLESv2.so.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//third_party/angle:libGLESv2" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_libffmpeg_shlib") {
|
||||
- binary_input = "$root_out_dir/libffmpeg.so"
|
||||
- symbol_output = "$root_out_dir/debug/libffmpeg.so.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//third_party/ffmpeg" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_libvk_swiftshader_shlib") {
|
||||
- binary_input = "$root_out_dir/libvk_swiftshader.so"
|
||||
- symbol_output = "$root_out_dir/debug/libvk_swiftshader.so.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ]
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_mksnapshot_binary") {
|
||||
- _binary_path = rebase_path(
|
||||
- get_label_info(
|
||||
- ":v8_context_snapshot_generator($v8_snapshot_toolchain)",
|
||||
- "root_out_dir") + "/mksnapshot",
|
||||
- root_build_dir)
|
||||
- binary_input = "$root_out_dir/$_binary_path"
|
||||
- symbol_output = "$root_out_dir/debug/${_binary_path}.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = mksnapshot_deps
|
||||
- }
|
||||
-
|
||||
- strip_binary("strip_v8_context_snapshot_generator_binary") {
|
||||
- _binary_path = rebase_path(
|
||||
- get_label_info(
|
||||
- ":v8_context_snapshot_generator($v8_snapshot_toolchain)",
|
||||
- "root_out_dir") + "/v8_context_snapshot_generator",
|
||||
- root_build_dir)
|
||||
- binary_input = "$root_out_dir/$_binary_path"
|
||||
- symbol_output = "$root_out_dir/debug/${_binary_path}.debug"
|
||||
- compress_debug_sections = true
|
||||
- deps = mksnapshot_deps
|
||||
- }
|
||||
-}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
instead of hardcoding the version, use the defined macro.
|
||||
--
|
||||
--- a/third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
|
||||
+++ b/third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
|
||||
--- ./third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc.orig
|
||||
+++ ./third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
|
||||
@@ -56,7 +56,7 @@
|
||||
FcFini();
|
||||
|
||||
// Check existence of intended fontconfig cache file.
|
||||
- auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-9";
|
||||
- auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-reindex1-10";
|
||||
+ auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-" + FC_CACHE_VERSION;
|
||||
bool cache_exists = access(cache.c_str(), F_OK) == 0;
|
||||
return !cache_exists;
|
||||
|
|
|
|||
13
backports/electron/fix-ffmpeg-codec-list.patch
Normal file
13
backports/electron/fix-ffmpeg-codec-list.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- a/media/ffmpeg/ffmpeg_common.cc
|
||||
+++ b/media/ffmpeg/ffmpeg_common.cc
|
||||
@@ -1046,8 +1046,8 @@
|
||||
|
||||
// This should match the configured lists in //third_party/ffmpeg.
|
||||
static constexpr std::string_view kAllowedAudioCodecs =
|
||||
- "vorbis,libopus,flac,pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,"
|
||||
- "mp3,pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw" EXTRA_CODECS;
|
||||
+ "vorbis,opus,libopus,flac,pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,"
|
||||
+ "mp3float,mp3,pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw" EXTRA_CODECS;
|
||||
#undef EXTRA_CODECS
|
||||
|
||||
return kAllowedAudioCodecs.data();
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/media/ffmpeg/ffmpeg_common.cc
|
||||
+++ b/media/ffmpeg/ffmpeg_common.cc
|
||||
@@ -1025,7 +1025,7 @@
|
||||
static const base::NoDestructor<std::string> kAllowedAudioCodecs([]() {
|
||||
// This should match the configured lists in //third_party/ffmpeg.
|
||||
std::string allowed_decoders(
|
||||
- "vorbis,libopus,flac,pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,"
|
||||
+ "vorbis,opus,libopus,flac,pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,"
|
||||
"mp3,pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw");
|
||||
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||
allowed_decoders += ",aac";
|
||||
27
backports/electron/headless-shell-no-license.patch
Normal file
27
backports/electron/headless-shell-no-license.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From 6f4685cff1ab8c68de98c0731bb8afaf8a05a723 Mon Sep 17 00:00:00 2001
|
||||
From: knuxify <knuxify@gmail.com>
|
||||
Date: Sat, 5 Apr 2025 14:10:37 +0200
|
||||
Subject: [PATCH] Do not generate license file for headless-shell build
|
||||
|
||||
---
|
||||
headless/BUILD.gn | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/headless/BUILD.gn b/headless/BUILD.gn
|
||||
index 798bb22..9d83f49 100644
|
||||
--- a/headless/BUILD.gn
|
||||
+++ b/headless/BUILD.gn
|
||||
@@ -934,10 +934,6 @@ executable("headless_shell") {
|
||||
|
||||
deps = [ ":headless_shell_lib" ]
|
||||
|
||||
- if (proprietary_codecs) {
|
||||
- deps += [ ":generate_headless_shell_license_file" ]
|
||||
- }
|
||||
-
|
||||
if (!headless_use_embedded_resources) {
|
||||
data = [
|
||||
"$root_out_dir/headless_lib_data.pak",
|
||||
--
|
||||
2.49.0
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- ./v8/src/base/cpu.cc.orig
|
||||
+++ ./v8/src/base/cpu.cc
|
||||
@@ -14,7 +14,7 @@
|
||||
#if V8_OS_LINUX
|
||||
#include <linux/auxvec.h> // AT_HWCAP
|
||||
#endif
|
||||
-#if V8_GLIBC_PREREQ(2, 16) || V8_OS_ANDROID
|
||||
+#if 1
|
||||
#include <sys/auxv.h> // getauxval()
|
||||
#endif
|
||||
#if V8_OS_QNX
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
use monotonic clock for pthread_cond_timedwait with musl too, since it supports
|
||||
it
|
||||
--
|
||||
--- a/v8/src/base/platform/condition-variable.cc
|
||||
+++ b/v8/src/base/platform/condition-variable.cc
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
ConditionVariable::ConditionVariable() {
|
||||
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
|
||||
- (V8_OS_LINUX && V8_LIBC_GLIBC))
|
||||
+ V8_OS_LINUX)
|
||||
// On Free/Net/OpenBSD and Linux with glibc we can change the time
|
||||
// source for pthread_cond_timedwait() to use the monotonic clock.
|
||||
pthread_condattr_t attr;
|
||||
@@ -92,7 +92,7 @@
|
||||
&native_handle_, &mutex->native_handle(), &ts);
|
||||
#else
|
||||
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
|
||||
- (V8_OS_LINUX && V8_LIBC_GLIBC))
|
||||
+ V8_OS_LINUX)
|
||||
// On Free/Net/OpenBSD and Linux with glibc we can change the time
|
||||
// source for pthread_cond_timedwait() to use the monotonic clock.
|
||||
result = clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
22
backports/electron/net-test-no-vpython.patch
Normal file
22
backports/electron/net-test-no-vpython.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
From 4b41417068045f11db9e7edead1447e93adb9073 Mon Sep 17 00:00:00 2001
|
||||
From: LN Liberda <lauren@selfisekai.rocks>
|
||||
Date: Sat, 28 Jun 2025 18:13:59 +0200
|
||||
Subject: [PATCH] Test net without vendored python
|
||||
|
||||
---
|
||||
net/test/python_utils.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc
|
||||
index 2cdc07dad9948..0b2d42a5bf126 100644
|
||||
--- a/net/test/python_utils.cc
|
||||
+++ b/net/test/python_utils.cc
|
||||
@@ -47,7 +47,7 @@ bool GetPython3Command(base::CommandLine* python_cmd) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("vpython3.bat")));
|
||||
#else
|
||||
- python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("vpython3")));
|
||||
+ python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("python3")));
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
39
backports/electron/net-test-pyws3-py3.12.patch
Normal file
39
backports/electron/net-test-pyws3-py3.12.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
ssl.wrap_socket() was removed in Python 3.12, needed for net_unittests.
|
||||
Patch-Source: https://github.com/GoogleChromeLabs/pywebsocket3/pull/39
|
||||
Modified (changed path) -lnl
|
||||
|
||||
From bc50ae9d451ca705edd6101d987b839e1a09d45e Mon Sep 17 00:00:00 2001
|
||||
From: Sven Diederichs <22592421+zaurask@users.noreply.github.com>
|
||||
Date: Thu, 28 Mar 2024 18:55:28 +0100
|
||||
Subject: [PATCH] use ssl.SSLContext.wrap_socket rather than the deprecated
|
||||
ssl.wrap_socket
|
||||
|
||||
---
|
||||
pywebsocket3/websocket_server.py | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/pywebsocket3/src/mod_pywebsocket/websocket_server.py b/third_party/pywebsocket3/src/mod_pywebsocket/websocket_server.py
|
||||
index e7485ec..93ad6f1 100644
|
||||
--- a/third_party/pywebsocket3/src/mod_pywebsocket/websocket_server.py
|
||||
+++ b/third_party/pywebsocket3/src/mod_pywebsocket/websocket_server.py
|
||||
@@ -157,12 +157,14 @@ class WebSocketServer(socketserver.ThreadingMixIn, BaseHTTPServer.HTTPServer):
|
||||
client_cert_ = ssl.CERT_REQUIRED
|
||||
else:
|
||||
client_cert_ = ssl.CERT_NONE
|
||||
- socket_ = ssl.wrap_socket(
|
||||
- socket_,
|
||||
- keyfile=server_options.private_key,
|
||||
- certfile=server_options.certificate,
|
||||
- ca_certs=server_options.tls_client_ca,
|
||||
- cert_reqs=client_cert_)
|
||||
+
|
||||
+ ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
||||
+ if server_options.certificate:
|
||||
+ ssl_context.load_cert_chain(certfile=server_options.certificate, keyfile=server_options.private_key)
|
||||
+ if server_options.tls_client_ca:
|
||||
+ ssl_context.load_verify_locations(server_options.tls_client_ca)
|
||||
+ ssl_context.verify_mode =client_cert_
|
||||
+ socket_ = ssl_context.wrap_socket(socket_)
|
||||
self._sockets.append((socket_, addrinfo))
|
||||
|
||||
def server_bind(self):
|
||||
|
|
@ -3,15 +3,16 @@ missing some required interface headers for it, and it's not clear how
|
|||
to make the partalloc support code for it work.
|
||||
--- ./base/allocator/partition_allocator/partition_alloc.gni.orig
|
||||
+++ ./base/allocator/partition_allocator/partition_alloc.gni
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
@@ -89,8 +89,7 @@
|
||||
# TODO(crbug.com/329199197): Clean this up when experiments are complete.
|
||||
use_large_empty_slot_span_ring = true
|
||||
|
||||
has_memory_tagging =
|
||||
- current_cpu == "arm64" && is_clang && !is_asan && (is_linux || is_android)
|
||||
+ false
|
||||
-has_memory_tagging = current_cpu == "arm64" && is_clang && !is_asan &&
|
||||
- !is_hwasan && (is_linux || is_android)
|
||||
+has_memory_tagging = false
|
||||
|
||||
declare_args() {
|
||||
# Causes all the allocations to be routed via allocator_shim.cc. Usually,
|
||||
# Debug configuration.
|
||||
--- ./base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h.orig
|
||||
+++ ./base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h
|
||||
@@ -10,7 +10,7 @@
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
Patch-Source: https://webrtc-review.googlesource.com/c/src/+/380500
|
||||
---
|
||||
--- a/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc
|
||||
+++ b/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc
|
||||
@@ -87,7 +87,7 @@
|
||||
.param = OnNodeParam,
|
||||
};
|
||||
|
||||
- pw_node_add_listener(proxy_, &node_listener_, &node_events, this);
|
||||
+ pw_node_add_listener(reinterpret_cast<pw_node*>(proxy_), &node_listener_, &node_events, this);
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -119,7 +119,7 @@
|
||||
uint32_t id = info->params[i].id;
|
||||
if (id == SPA_PARAM_EnumFormat &&
|
||||
info->params[i].flags & SPA_PARAM_INFO_READ) {
|
||||
- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr);
|
||||
+ pw_node_enum_params(reinterpret_cast<pw_node*>(that->proxy_), 0, id, 0, UINT32_MAX, nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
17
backports/electron/rust_no_alloc_shim_is_unstable_v2.patch
Normal file
17
backports/electron/rust_no_alloc_shim_is_unstable_v2.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/build/rust/allocator/lib.rs b/build/rust/allocator/lib.rs
|
||||
index c49d424..142c6e60 100644
|
||||
--- a/build/rust/allocator/lib.rs
|
||||
+++ b/build/rust/allocator/lib.rs
|
||||
@@ -86,6 +86,12 @@
|
||||
/// As part of rustc's contract for using `#[global_allocator]` without
|
||||
/// rustc-generated shims we must define this symbol, since we are opting in
|
||||
/// to unstable functionality. See https://github.com/rust-lang/rust/issues/123015
|
||||
+ #[rustc_std_internal_symbol]
|
||||
+ #[linkage = "weak"]
|
||||
+ fn __rust_no_alloc_shim_is_unstable_v2() {}
|
||||
+
|
||||
+ // TODO(crbug.com/422538133) Remove after rolling past
|
||||
+ // https://github.com/rust-lang/rust/pull/141061
|
||||
#[no_mangle]
|
||||
#[linkage = "weak"]
|
||||
static __rust_no_alloc_shim_is_unstable: u8 = 0;
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- ./buildtools/third_party/libc++/__config_site.orig
|
||||
+++ ./buildtools/third_party/libc++/__config_site
|
||||
@@ -18,7 +18,7 @@
|
||||
/* #undef _LIBCPP_ABI_FORCE_MICROSOFT */
|
||||
/* #undef _LIBCPP_HAS_NO_THREADS */
|
||||
/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */
|
||||
-/* #undef _LIBCPP_HAS_MUSL_LIBC */
|
||||
+#define _LIBCPP_HAS_MUSL_LIBC 1
|
||||
/* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */
|
||||
/* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */
|
||||
/* #undef _LIBCPP_HAS_THREAD_API_WIN32 */
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
maintainer="lauren n. liberda <lauren@selfisekai.rocks>"
|
||||
pkgname=element-desktop
|
||||
pkgver=1.11.100
|
||||
pkgrel=1
|
||||
pkgrel=4
|
||||
pkgdesc="Secure and independent communication, connected via Matrix"
|
||||
url="https://element.io/"
|
||||
arch="aarch64 x86_64" # same as electron
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
# Contributor: Bryce Vandegrift <bryce@brycevandegrift.xyz>
|
||||
# Maintainer: Bryce Vandegrift <bryce@brycevandegrift.xyz>
|
||||
pkgname=freecad
|
||||
pkgver=1.0.1
|
||||
_ondsel_ver="09d6175a2ba69e7016fcecc4f384946a2f84f92d"
|
||||
_gsl_ver="2828399820ef4928cc89b65605dca5dc68efca6e"
|
||||
pkgrel=0
|
||||
pkgdesc="Open-source parametric 3D modeler"
|
||||
url="https://www.freecad.org/"
|
||||
# armv7, armhf, and aarch64: GL_MULTISAMPLE not declared
|
||||
# s390x: blocked by opencascade-dev, vtk-dev, and freeimage-dev
|
||||
# riscv64: blocked by py3-pivy, py3-pyside6, pyside6-dev, and py3-shiboken6
|
||||
arch="all !aarch64 !armhf !armv7 !s390x !riscv64"
|
||||
license="LGPL-2.0-or-later"
|
||||
depends="py3-pivy py3-matplotlib py3-pyside6"
|
||||
makedepends="
|
||||
cmake
|
||||
ninja
|
||||
boost-dev
|
||||
doxygen
|
||||
python3-dev
|
||||
xerces-c-dev
|
||||
opencascade-dev
|
||||
glew-dev
|
||||
gtest-dev
|
||||
vtk-dev
|
||||
libmedc-dev
|
||||
eigen-dev
|
||||
coin-dev
|
||||
libspnav-dev
|
||||
pyside6-dev
|
||||
py3-shiboken6
|
||||
py3-pivy
|
||||
py3-matplotlib
|
||||
swig
|
||||
jsoncpp-dev
|
||||
freeimage-dev
|
||||
qt6-qtbase-dev
|
||||
qt6-qtsvg-dev
|
||||
qt6-qttools-dev
|
||||
yaml-cpp-dev"
|
||||
subpackages="$pkgname-doc $pkgname-dev"
|
||||
options="!check"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/FreeCAD/FreeCAD/archive/$pkgver.tar.gz
|
||||
OndselSolver-$_ondsel_ver.tar.gz::https://github.com/Ondsel-Development/OndselSolver/archive/$_ondsel_ver.tar.gz
|
||||
GSL-$_gsl_ver.tar.gz::https://github.com/microsoft/GSL/archive/$_gsl_ver.tar.gz
|
||||
no-execinfo.patch"
|
||||
builddir="$srcdir/FreeCAD-$pkgver"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
cp -r $srcdir/OndselSolver-$_ondsel_ver/* $builddir/src/3rdParty/OndselSolver
|
||||
cp -r $srcdir/GSL-$_gsl_ver/* $builddir/src/3rdParty/GSL
|
||||
}
|
||||
|
||||
build() {
|
||||
cmake -B build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DFREECAD_QT_VERSION=6 \
|
||||
-DFREECAD_USE_EXTERNAL_PIVY=ON \
|
||||
-DBUILD_FLAT_MESH=ON \
|
||||
-DENABLE_DEVELOPER_TESTS=OFF \
|
||||
-DBUILD_TEST=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
|
||||
-DCMAKE_INSTALL_DATADIR=/usr/share/$pkgname
|
||||
ninja -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" ninja -C build install
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
69a82c0af45137079b1ce184a4a3df475c005da66b4a4cab17371a1f62432b13f721e3da8b350b3ad50125c939cdfa5fed477e0605d52bd8fcee3c528931a185 freecad-1.0.1.tar.gz
|
||||
7ad78da60320a686f0734da5196ce4cba49a2ff9ecf0bcd6016a56d65c8a8f7570f2898f84c2602a454bc9ccd8ac12fd137d2a952ffb7cbd15e38350fbbd3d79 OndselSolver-09d6175a2ba69e7016fcecc4f384946a2f84f92d.tar.gz
|
||||
a6d731c450da91cba34c13293cc0881a842bd90268dd5ef721ae1f48752c41dc355ebea7716a6de5b49d41568e55751c46a9dd78da4cd68656bffd33e5ee448e GSL-2828399820ef4928cc89b65605dca5dc68efca6e.tar.gz
|
||||
2f190118bddbf2e070519d0244eafd15ae7919f9759f925f593ce43988a7f9ab023c50bec3768404926e8cc661e829f6a55bec5e9e58c58735c050338fbcec16 no-execinfo.patch
|
||||
"
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
From 9cd1f5e5b90ef2e17c61719ffdb2f6c43cbae185 Mon Sep 17 00:00:00 2001
|
||||
From: Bryce Vandegrift <bryce@brycevandegrift.xyz>
|
||||
Date: Sun, 24 Nov 2024 18:19:39 -0500
|
||||
Subject: [PATCH] Remove dependency on execinfo.h
|
||||
|
||||
---
|
||||
.../salomesmesh/src/DriverSTL/Basics_Utils.cpp | 11 -----------
|
||||
src/App/Application.cpp | 1 -
|
||||
2 files changed, 12 deletions(-)
|
||||
|
||||
diff --git a/src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp b/src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp
|
||||
index 23c5083fdf..5ea06ad3f4 100644
|
||||
--- a/src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp
|
||||
+++ b/src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp
|
||||
@@ -29,7 +29,6 @@
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
-#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -113,16 +112,6 @@ namespace Kernel_Utils
|
||||
size_t size;
|
||||
char **strings;
|
||||
size_t i;
|
||||
-
|
||||
- size = backtrace (array, 40);
|
||||
- strings = backtrace_symbols (array, size);
|
||||
-
|
||||
- for (i = 0; i < size; i++)
|
||||
- {
|
||||
- std::cerr << strings[i] << std::endl;
|
||||
- }
|
||||
-
|
||||
- free (strings);
|
||||
}
|
||||
#else
|
||||
#if (_MSC_VER >= 1400) // Visual Studio 2005
|
||||
diff --git a/src/App/Application.cpp b/src/App/Application.cpp
|
||||
index 9384790627..9155c00d25 100644
|
||||
--- a/src/App/Application.cpp
|
||||
+++ b/src/App/Application.cpp
|
||||
@@ -1798,7 +1798,6 @@ static void freecadNewHandler ()
|
||||
#endif
|
||||
|
||||
#if defined(FC_OS_LINUX)
|
||||
-#include <execinfo.h>
|
||||
#include <dlfcn.h>
|
||||
#include <cxxabi.h>
|
||||
|
||||
--
|
||||
2.47.0
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=freetube
|
||||
pkgver=0.23.5
|
||||
pkgrel=1
|
||||
pkgver=0.23.12
|
||||
pkgrel=0
|
||||
pkgdesc="An open source desktop YouTube player built with privacy in mind."
|
||||
arch="x86_64 aarch64" # blocked by electron
|
||||
license="AGPL-3.0-only"
|
||||
|
|
@ -50,7 +50,7 @@ package() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
5811ac53788a12f94cbd4cec6f7075350c223865cb4cf4436f131b9d1197b89aa5da128d6c531d1e56a0302aa3d2523c7ba8d48edbf5f328be6fed3fbba02752 freetube-0.23.5.tar.gz
|
||||
e19c7e8de0c6c5bbddcd3da73cd1907cae7157e8f44f550c4a34965b3b4f3c1a180c111a8c497d74a556d6d8e74e9fdd1ed6e064d4fc899f80712a1f187395ae freetube-0.23.12.tar.gz
|
||||
2ce2effc794bb663789cefe968b5899122127983dbfa1b240aa33a2be383720b18204e6d01b4a550df72956f02b6636b79c93a58f470a970b09b770f5b8f2fc4 freetube.sh
|
||||
d27cb896b65a7e8d52ffe86e5f74eed72b6cf976b28e1a13012d34c7eceba5ff6f20298017738dfa93c0336ffa52b8ee4da7e06b02747062898db7e678819526 tasje-dotdash.patch
|
||||
"
|
||||
|
|
|
|||
33
backports/git-extras/APKBUILD
Normal file
33
backports/git-extras/APKBUILD
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
||||
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
||||
pkgname=git-extras
|
||||
pkgver=7.3.0
|
||||
pkgrel=0
|
||||
pkgdesc="Little git extras"
|
||||
url="https://github.com/tj/git-extras"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="bash cmd:column git"
|
||||
subpackages="$pkgname-bash-completion $pkgname-doc"
|
||||
source="https://github.com/tj/git-extras/archive/$pkgver/git-extras-$pkgver.tar.gz"
|
||||
|
||||
package() {
|
||||
# Avoid annoying interactive prompts if an alias is in your gitconfig.
|
||||
GIT_CONFIG=/dev/null \
|
||||
make install DESTDIR="$pkgdir" PREFIX=/usr SYSCONFDIR=/etc install
|
||||
|
||||
rm -Rf "$pkgdir"/etc/bash-completion
|
||||
|
||||
install -D -m644 etc/bash_completion.sh \
|
||||
"$pkgdir"/usr/share/bash-completion/completions/$pkgname
|
||||
|
||||
# ZSH and Fish completions don't work when autoloaded.
|
||||
install -D -m644 etc/git-extras-completion.zsh \
|
||||
"$pkgdir"/usr/share/$pkgname/completions.zsh
|
||||
install -D -m644 etc/git-extras.fish \
|
||||
"$pkgdir"/usr/share/$pkgname/completions.fish
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
14cb5cef986a4aeb12c8c1db332aafed14bc68cf830b17a00eef617dff9f120c3c68244d56300715d8d3ce61420399d5411f23a40ffec44d60332118fe36eb22 git-extras-7.3.0.tar.gz
|
||||
"
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
|
||||
# Maintainer:
|
||||
pkgname=libmedc
|
||||
pkgver=5.0.0
|
||||
pkgrel=0
|
||||
pkgdesc="Open source library for numerical simulation"
|
||||
url="https://www.salome-platform.org/"
|
||||
arch="all"
|
||||
license="GPL-3.0-or-later"
|
||||
makedepends="cmake hdf5-dev swig python3-dev samurai"
|
||||
options="!check" #test suite is nonfunctional with python bindings
|
||||
subpackages="$pkgname-dev $pkgname-doc $pkgname-python-pyc $pkgname-python:_py"
|
||||
# Upstream disappeared:
|
||||
# https://www.salome-platform.org/downloads
|
||||
# https://files.salome-platform.org/Salome/other/med-4.1.1.tar.gz
|
||||
#
|
||||
# Using a fork on GitHub by one of the FreeCAD developers instead.
|
||||
#
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://github.com/chennes/med/archive/refs/tags/v$pkgver.tar.gz
|
||||
cmake-config-dir.patch
|
||||
hdf5-1.14.patch
|
||||
med-swig-4.3.0.patch
|
||||
med-py3.13.patch
|
||||
"
|
||||
builddir="$srcdir/med-$pkgver"
|
||||
|
||||
build() {
|
||||
cmake -B build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_SKIP_RPATH=ON \
|
||||
-DMEDFILE_BUILD_PYTHON=ON \
|
||||
-DMEDFILE_BUILD_TESTS=OFF
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
check() {
|
||||
cd build
|
||||
HDF5_DISABLE_VERSION_CHECK=1 LD_LIBRARY_PATH="$srcdir"/build/src ctest -E '._Python' --output-on-failure
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
}
|
||||
|
||||
_py() {
|
||||
pkgdesc="Python bindings for libmedc"
|
||||
depends="python3"
|
||||
amove usr/lib/python3*
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
6ebb06bf403dbe32512a42179a42de3da6f264034fcc143fcb2b780c5d564527656d3ef28ebf25d7bde93a9d2a44df0d10a09d60e6f4720ba9d25719a4e30d37 libmedc-5.0.0.tar.gz
|
||||
8d0f58cd67d205fbacaff0e6da76e2ee5473457b478ede13a551ebe5853c0716c7406b74c3792e1ace33a34d352fccca8dd2940f063a7c060a12529d060a991a cmake-config-dir.patch
|
||||
78bfbd17a052c039244ce314d53b0d5e5e6ba6773fe7a836999bf7ddf4b6d732dfda95c58681dd9d7e9586e4d36d3dfe7cca15d45fa7d3d453aef72423fcd5c0 hdf5-1.14.patch
|
||||
833187253fcbebb13f239f1f559333db6a7d3ef87c4f7b896f64970a3e553735ed01a82d6d4a368a2261e33e364b05ea3abbff3fd58c8221515aa72aa52684a7 med-swig-4.3.0.patch
|
||||
6c993d924257a01b8bce1952ecc34346ab654a103f4374d514c3616cd6cdf94373b2a4d04b91a68933cd5acbc4fc54becab6bd58f32762973bbee8255c5d7a3d med-py3.13.patch
|
||||
"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -101,7 +101,7 @@
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
SET(INSTALL_CMAKE_CONFIG_DIR cmake)
|
||||
ELSE()
|
||||
- SET(INSTALL_CMAKE_CONFIG_DIR share/cmake/medfile-${MED_STR_VERSION})
|
||||
+ SET(INSTALL_CMAKE_CONFIG_DIR lib${LIB_SUFFIX}/cmake/medfile-${MED_STR_VERSION})
|
||||
ENDIF()
|
||||
SET(INSTALL_INCLUDE_DIR include)
|
||||
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
Patch-Source: https://src.fedoraproject.org/rpms/med/raw/rawhide/f/hdf5-1.14.patch
|
||||
|
||||
diff -rupN --no-dereference med-5.0.0/config/cmake_files/medMacros.cmake med-5.0.0-new/config/cmake_files/medMacros.cmake
|
||||
--- med-5.0.0/config/cmake_files/medMacros.cmake 2025-01-24 00:28:04.460898497 +0100
|
||||
+++ med-5.0.0-new/config/cmake_files/medMacros.cmake 2025-01-24 00:28:04.857640862 +0100
|
||||
@@ -447,7 +447,7 @@ MACRO(MED_FIND_HDF5)
|
||||
##
|
||||
## Requires 1.12.x version
|
||||
##
|
||||
- IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 12 OR NOT HDF_VERSION_RELEASE_REF GREATER 0)
|
||||
+ IF (HDF5_VERSION VERSION_LESS 1.12.1)
|
||||
MESSAGE(FATAL_ERROR "HDF5 version is ${HDF_VERSION_REF}. Only versions >= 1.12.1 are supported.")
|
||||
ENDIF()
|
||||
##
|
||||
diff -rupN --no-dereference med-5.0.0/src/ci/MEDfileCompatibility.c med-5.0.0-new/src/ci/MEDfileCompatibility.c
|
||||
--- med-5.0.0/src/ci/MEDfileCompatibility.c 2023-06-05 14:14:44.000000000 +0200
|
||||
+++ med-5.0.0-new/src/ci/MEDfileCompatibility.c 2025-01-24 00:28:04.858068408 +0100
|
||||
@@ -116,7 +116,7 @@ MEDfileCompatibility(const char* const f
|
||||
#if MED_NUM_MAJEUR != 5
|
||||
#error "Don't forget to update the test version here when you change the major version of the library !"
|
||||
#endif
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !"
|
||||
#error "Cf. _MEDfileCreate ..."
|
||||
#endif
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDfileCreate.c med-5.0.0-new/src/hdfi/_MEDfileCreate.c
|
||||
--- med-5.0.0/src/hdfi/_MEDfileCreate.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDfileCreate.c 2025-01-24 00:28:04.858334666 +0100
|
||||
@@ -189,7 +189,7 @@ med_idt _MEDfileCreate(const char * cons
|
||||
* Cette ligne est censée obliger HDF à ne pas utiliser un modèle interne différent de 1.10.z
|
||||
* Un test autoconf permet de fixer un intervalle de version HDF à MED.
|
||||
*/
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDfileOpen.c med-5.0.0-new/src/hdfi/_MEDfileOpen.c
|
||||
--- med-5.0.0/src/hdfi/_MEDfileOpen.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDfileOpen.c 2025-01-24 00:28:04.858574380 +0100
|
||||
@@ -113,7 +113,7 @@ med_idt _MEDfileOpen(const char * const
|
||||
has been set in the group creation property list (see H5Pset_link_creation_order).
|
||||
*/
|
||||
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
/* L'avantage de bloquer le modèle interne HDF5
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDfileOpenForImport.c med-5.0.0-new/src/hdfi/_MEDfileOpenForImport.c
|
||||
--- med-5.0.0/src/hdfi/_MEDfileOpenForImport.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDfileOpenForImport.c 2025-01-24 00:28:04.858834390 +0100
|
||||
@@ -53,7 +53,7 @@ med_idt _MEDfileOpenForImport(const cha
|
||||
}
|
||||
|
||||
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
/* L'avantage de bloquer le modèle interne HDF5
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDmemFileOpen.c med-5.0.0-new/src/hdfi/_MEDmemFileOpen.c
|
||||
--- med-5.0.0/src/hdfi/_MEDmemFileOpen.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDmemFileOpen.c 2025-01-24 00:28:04.859128966 +0100
|
||||
@@ -439,7 +439,7 @@ med_idt _MEDmemFileOpen(const char * con
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_V112, H5F_LIBVER_V112 ) ) {
|
||||
@@ -506,7 +506,7 @@ med_idt _MEDmemFileOpen(const char * con
|
||||
goto ERROR;
|
||||
}
|
||||
_fversionMM = 100*_fmajor+10*_fminor;
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
if ( _fversionMM < 500 ) { /*100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR*/
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDparFileCreate.c med-5.0.0-new/src/hdfi/_MEDparFileCreate.c
|
||||
--- med-5.0.0/src/hdfi/_MEDparFileCreate.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDparFileCreate.c 2025-01-24 00:28:04.859422685 +0100
|
||||
@@ -64,7 +64,7 @@ med_idt _MEDparFileCreate(const char * c
|
||||
* En HDF5-1.10.0p1 cela n'a aucun effet !
|
||||
* Un test autoconf permet de fixer un intervalle de version HDF à MED.
|
||||
*/
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
|
||||
diff -rupN --no-dereference med-5.0.0/src/hdfi/_MEDparFileOpen.c med-5.0.0-new/src/hdfi/_MEDparFileOpen.c
|
||||
--- med-5.0.0/src/hdfi/_MEDparFileOpen.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/hdfi/_MEDparFileOpen.c 2025-01-24 00:28:04.859632596 +0100
|
||||
@@ -86,7 +86,7 @@ med_idt _MEDparFileOpen(const char * con
|
||||
}
|
||||
_fversionMM = 100*_fmajor+10*_fminor;
|
||||
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
if ( _fversionMM < 500 ) { /*100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR*/
|
||||
diff -rupN --no-dereference med-5.0.0/src/misc/MEDversionedApi3C.c med-5.0.0-new/src/misc/MEDversionedApi3C.c
|
||||
--- med-5.0.0/src/misc/MEDversionedApi3C.c 2023-06-05 14:14:45.000000000 +0200
|
||||
+++ med-5.0.0-new/src/misc/MEDversionedApi3C.c 2025-01-24 00:28:04.859890990 +0100
|
||||
@@ -114,7 +114,7 @@ MedFuncType _MEDversionedApi3( const cha
|
||||
/* (_fversionMM <= (100*MED_NUM_MAJEUR+10*MED_NUM_MINEUR) ) */
|
||||
/* ) { */
|
||||
|
||||
-#if H5_VERS_MINOR > 12
|
||||
+#if H5_VERS_MINOR > 14
|
||||
#error "Don't forget to change the compatibility version of the library !"
|
||||
#endif
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
Patch-Source: https://src.fedoraproject.org/rpms/med/raw/rawhide/f/med-swig-4.3.0.patch
|
||||
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_enumtest_typemap.i med-5.0.0-new/python/med_enumtest_typemap.i
|
||||
--- med-5.0.0/python/med_enumtest_typemap.i 2023-03-07 15:20:57.000000000 +0100
|
||||
+++ med-5.0.0-new/python/med_enumtest_typemap.i 2025-01-24 00:28:04.465816239 +0100
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
if (pclass == NULL) printf("%s\n","Can't get class $1_basetype");
|
||||
Py_DECREF(pmod);
|
||||
pargs = Py_BuildValue("(i)",*$1);
|
||||
- pinst = PyEval_CallObject(pclass, pargs);
|
||||
+ pinst = PyObject_CallObject(pclass, pargs);
|
||||
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
|
||||
$result=SWIG_Python_AppendOutput($result, pinst);
|
||||
}
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_enum_typemap.i med-5.0.0-new/python/med_enum_typemap.i
|
||||
--- med-5.0.0/python/med_enum_typemap.i 2023-03-07 15:20:57.000000000 +0100
|
||||
+++ med-5.0.0-new/python/med_enum_typemap.i 2025-01-24 00:28:04.466146326 +0100
|
||||
@@ -109,7 +109,7 @@ Type.__repr__= lambda self: #Type +"("+s
|
||||
if (pclass == NULL) printf("%s\n","Can't get class $1_basetype");
|
||||
Py_DECREF(pmod);
|
||||
pargs = Py_BuildValue("(i)",*$1);
|
||||
- pinst = PyEval_CallObject(pclass, pargs);
|
||||
+ pinst = PyObject_CallObject(pclass, pargs);
|
||||
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
|
||||
$result=SWIG_Python_AppendOutput($result, pinst);
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
Patch-Source: https://src.fedoraproject.org/rpms/med/raw/rawhide/f/med-py3.13.patch
|
||||
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_array_typemap.i med-5.0.0-new/python/med_array_typemap.i
|
||||
--- med-5.0.0/python/med_array_typemap.i 2023-03-07 15:20:57.000000000 +0100
|
||||
+++ med-5.0.0-new/python/med_array_typemap.i 2025-01-24 00:28:05.257751237 +0100
|
||||
@@ -181,7 +181,7 @@ Type.__repr__= lambda self: #Type +"("+s
|
||||
// TypeMed * const ParamName : OUT 2/4 (l'allocation Type est faite ds Python)
|
||||
%typemap(freearg) TypeMed * const ParamName {
|
||||
Py_INCREF(o$argnum);
|
||||
- $result=SWIG_Python_AppendOutput($result, o$argnum);
|
||||
+ $result=SWIG_AppendOutput($result, o$argnum);
|
||||
}
|
||||
// TypeMed * const (OUT) 3/4
|
||||
// pour ne pas activer un out du TypeMed * const (par sécurité)
|
||||
@@ -290,7 +290,7 @@ Type.__repr__= lambda self: #Type +"("+s
|
||||
// unsigned char * const : OUT 2/4 (l'allocation Type est faite ds Python)
|
||||
%typemap(freearg) unsigned char * const {
|
||||
Py_INCREF(o$argnum);
|
||||
- $result=SWIG_Python_AppendOutput($result, o$argnum);
|
||||
+ $result=SWIG_AppendOutput($result, o$argnum);
|
||||
}
|
||||
// unsigned char * const (OUT) 3/4
|
||||
// pour ne pas activer un out du unsigned char * const (par sécurité)
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_bool_typemap.i med-5.0.0-new/python/med_bool_typemap.i
|
||||
--- med-5.0.0/python/med_bool_typemap.i 2023-03-07 15:20:57.000000000 +0100
|
||||
+++ med-5.0.0-new/python/med_bool_typemap.i 2025-01-24 00:28:05.257993234 +0100
|
||||
@@ -22,7 +22,7 @@
|
||||
/* Py_DECREF(o2); */
|
||||
/* Py_DECREF(o3); */
|
||||
/* } */
|
||||
- $result=SWIG_Python_AppendOutput($result, o);
|
||||
+ $result=SWIG_AppendOutput($result, o);
|
||||
}
|
||||
|
||||
%typemap(in,numinputs=0) med_bool *(med_bool temp) {
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_enumtest_typemap.i med-5.0.0-new/python/med_enumtest_typemap.i
|
||||
--- med-5.0.0/python/med_enumtest_typemap.i 2025-01-24 00:28:04.853403794 +0100
|
||||
+++ med-5.0.0-new/python/med_enumtest_typemap.i 2025-01-24 00:28:05.258210585 +0100
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
pargs = Py_BuildValue("(i)",*$1);
|
||||
pinst = PyObject_CallObject(pclass, pargs);
|
||||
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
|
||||
- $result=SWIG_Python_AppendOutput($result, pinst);
|
||||
+ $result=SWIG_AppendOutput($result, pinst);
|
||||
}
|
||||
|
||||
%typemap(in,numinputs=0) TypeEnum * (TypeEnum temp) {
|
||||
diff -rupN --no-dereference med-5.0.0/python/med_enum_typemap.i med-5.0.0-new/python/med_enum_typemap.i
|
||||
--- med-5.0.0/python/med_enum_typemap.i 2025-01-24 00:28:04.853741870 +0100
|
||||
+++ med-5.0.0-new/python/med_enum_typemap.i 2025-01-24 00:28:05.258385775 +0100
|
||||
@@ -111,7 +111,7 @@ Type.__repr__= lambda self: #Type +"("+s
|
||||
pargs = Py_BuildValue("(i)",*$1);
|
||||
pinst = PyObject_CallObject(pclass, pargs);
|
||||
if (pinst == NULL) printf("%s\n","Can't instanciate class $1_basetype");
|
||||
- $result=SWIG_Python_AppendOutput($result, pinst);
|
||||
+ $result=SWIG_AppendOutput($result, pinst);
|
||||
}
|
||||
|
||||
%typemap(in,numinputs=0) TypeEnum * (TypeEnum temp) {
|
||||
45
backports/llhttp/APKBUILD
Normal file
45
backports/llhttp/APKBUILD
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
maintainer="Michał Polański <michal@polanski.me>"
|
||||
pkgname=llhttp
|
||||
pkgver=9.3.0
|
||||
pkgrel=0
|
||||
pkgdesc="Port of http_parser to llparse"
|
||||
url="https://llhttp.org/"
|
||||
license="MIT"
|
||||
arch="all"
|
||||
makedepends="cmake clang samurai npm"
|
||||
subpackages="$pkgname-dev $pkgname-doc"
|
||||
source="https://github.com/nodejs/llhttp/archive/v$pkgver/llhttp-$pkgver.tar.gz"
|
||||
|
||||
# secfixes:
|
||||
# 9.2.1-r0:
|
||||
# - CVE-2024-27982
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
npm ci
|
||||
}
|
||||
|
||||
build() {
|
||||
make release RELEASE="$pkgver"
|
||||
|
||||
cmake -S release -B releasebuild -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
cmake --build releasebuild
|
||||
}
|
||||
|
||||
check() {
|
||||
npm test
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install releasebuild
|
||||
|
||||
install -Dm644 LICENSE -t "$pkgdir"/usr/share/doc/$pkgname
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
ff4166f842f933cbb419221ab401e684c1314072abef2cda455812cc20c28ce4b467ed5f44079b6844eaa627c975247f640a8449b5f512e1a76d6df81790dec5 llhttp-9.3.0.tar.gz
|
||||
"
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
||||
pkgname=py3-dateparser
|
||||
_pyname=${pkgname#py3-}
|
||||
pkgver=1.2.0
|
||||
pkgrel=0
|
||||
pkgdesc="Python parser for human readable dates"
|
||||
url="https://github.com/scrapinghub/dateparser"
|
||||
arch="noarch"
|
||||
license="BSD-3-Clause"
|
||||
depends="
|
||||
python3
|
||||
py3-dateutil
|
||||
py3-regex
|
||||
py3-tz
|
||||
py3-tzlocal
|
||||
"
|
||||
makedepends="
|
||||
py3-gpep517
|
||||
py3-setuptools
|
||||
py3-wheel
|
||||
"
|
||||
checkdepends="
|
||||
py3-fasttext
|
||||
py3-gitpython
|
||||
py3-langdetect
|
||||
py3-parameterized
|
||||
py3-parsel
|
||||
py3-pytest
|
||||
py3-requests
|
||||
py3-ruamel.yaml
|
||||
"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/scrapinghub/dateparser/archive/refs/tags/v$pkgver.tar.gz"
|
||||
builddir="$srcdir/$_pyname-$pkgver"
|
||||
|
||||
build() {
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
# test_relative_base_setting_2_en fails due to tzinfo mismatch
|
||||
# test_custom_language_detect_fast_text fails due to wrong file format
|
||||
_test_filter="not test_parsing_date_should_fail_using_datetime_strptime_if_locale_is_non_english \
|
||||
and not test_relative_base_setting_2_en and not test_custom_language_detect_fast_text"
|
||||
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
.testenv/bin/python3 -m installer .dist/*.whl
|
||||
|
||||
# test_hijri.py: needs hijri_converter, test_jalali.py: convertdate
|
||||
.testenv/bin/python3 -m pytest tests \
|
||||
-k "$_test_filter" \
|
||||
--ignore tests/test_hijri.py \
|
||||
--ignore tests/test_jalali.py
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 -m installer -d "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
2d37115f25c2076c4521b77b89ef1cff3cd0a5233c45beb00d78a5c9b1a384dcd993ff7cdd1f77db95a53ce566cf7d709d46ffa2e63eb468ac954fda178a5b6e py3-dateparser-1.2.0.tar.gz
|
||||
"
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
maintainer="lauren n. liberda <lauren@selfisekai.rocks>"
|
||||
pkgname=py3-flask-limiter
|
||||
pkgver=3.10.1
|
||||
pkgrel=0
|
||||
pkgdesc="Rate Limiting extension for Flask"
|
||||
url="https://github.com/alisaifee/flask-limiter"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="
|
||||
py3-flask
|
||||
py3-limits
|
||||
py3-ordered-set
|
||||
py3-rich
|
||||
python3
|
||||
"
|
||||
makedepends="py3-setuptools py3-gpep517"
|
||||
checkdepends="
|
||||
py3-flask-restful
|
||||
py3-flask-restx
|
||||
py3-limits-mongodb
|
||||
py3-limits-redis
|
||||
py3-pytest
|
||||
py3-pytest-cov
|
||||
"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="
|
||||
https://github.com/alisaifee/flask-limiter/archive/refs/tags/$pkgver/flask-limiter-$pkgver.tar.gz
|
||||
|
||||
our-std-is-good-enough.patch
|
||||
"
|
||||
builddir="$srcdir/flask-limiter-$pkgver"
|
||||
options="!check" # tests depend on unpackaged modules
|
||||
|
||||
build() {
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
|
||||
.testenv/bin/python3 -m pytest
|
||||
}
|
||||
|
||||
package() {
|
||||
gpep517 install-wheel --destdir "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a0d3af6f93d4283309d6df46ddb7fed4c358bbc712c2bd9e6897362c6d086c395cb9587c3d9da283ad757b574fd8c09d909f3c4b76d02ae8aade3e61dbea6aa0 flask-limiter-3.10.1.tar.gz
|
||||
1b90e9134076cda249695d5ea741db9d205a2ae452c7d6edfe01eb37a221ce6f64b0e8ddcdbbee9b0e0fb16a28e5eabf14f1c1e41e965c7e3b93ea4f42caf553 our-std-is-good-enough.patch
|
||||
"
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- ./flask_limiter/typing.py.orig
|
||||
+++ ./flask_limiter/typing.py
|
||||
@@ -11,7 +11,7 @@
|
||||
cast,
|
||||
)
|
||||
|
||||
-from typing_extensions import ParamSpec
|
||||
+from typing import ParamSpec
|
||||
|
||||
R = TypeVar("R")
|
||||
P = ParamSpec("P")
|
||||
--- ./flask_limiter/commands.py.orig
|
||||
+++ ./flask_limiter/commands.py
|
||||
@@ -14,7 +14,7 @@
|
||||
from rich.table import Table
|
||||
from rich.theme import Theme
|
||||
from rich.tree import Tree
|
||||
-from typing_extensions import TypedDict
|
||||
+from typing import TypedDict
|
||||
from werkzeug.exceptions import MethodNotAllowed, NotFound
|
||||
from werkzeug.routing import Rule
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
pkgname=py3-limits
|
||||
pkgver=3.14.1
|
||||
pkgrel=0
|
||||
pkgdesc="Rate limiting using various strategies and storage backends such as redis & memcached"
|
||||
url="https://github.com/alisaifee/limits"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="
|
||||
py3-deprecated
|
||||
python3
|
||||
"
|
||||
makedepends="py3-setuptools py3-gpep517"
|
||||
checkdepends="
|
||||
py3-flaky
|
||||
py3-mongo
|
||||
py3-pytest
|
||||
py3-pytest-asyncio
|
||||
py3-pytest-benchmark
|
||||
py3-pytest-cov
|
||||
py3-pytest-lazy-fixtures
|
||||
py3-pymemcache
|
||||
py3-redis
|
||||
"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="
|
||||
https://github.com/alisaifee/limits/archive/refs/tags/$pkgver/limits-$pkgver.tar.gz
|
||||
|
||||
our-std-is-good-enough.patch
|
||||
tests-drop-etcd3-and-k-argument.patch
|
||||
"
|
||||
builddir="$srcdir/limits-$pkgver"
|
||||
|
||||
build() {
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
|
||||
.testenv/bin/python3 -m pytest -W ignore::DeprecationWarning \
|
||||
-m 'not benchmark and not etcd and not integration and not memcached' \
|
||||
-k 'not aio and not Storage and not strategy' -v
|
||||
}
|
||||
|
||||
package() {
|
||||
gpep517 install-wheel --destdir "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
f30c7ec19c2d1edad9ed77dc590ae35717efa3956a4d97e465793e1923a4af08dc9921d90ee95d3c54ce3364b867ca67a9de62c61d627e07a3f50da20bdabd0f limits-3.14.1.tar.gz
|
||||
271e3b0501f9f144eda8d2e96c93b285714e339b9217385e38cdbce1f4dec88f9c949e9419f8be94885092e7977f7dca29b86b5499e9fead678b42a686c337db our-std-is-good-enough.patch
|
||||
e84f4db49349a6feba0f701b9d4357c5f66d64c4a23f8ce512528b0f44b5bbef55041c02d92aae3a4cc8d5340846f9e909217beb869a5aeb49df166dd29ae9e3 tests-drop-etcd3-and-k-argument.patch
|
||||
"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- ./limits/typing.py.orig
|
||||
+++ ./limits/typing.py
|
||||
@@ -13,7 +13,7 @@
|
||||
Union,
|
||||
)
|
||||
|
||||
-from typing_extensions import ClassVar, Counter, ParamSpec, Protocol, TypeAlias
|
||||
+from typing import ClassVar, Counter, ParamSpec, Protocol, TypeAlias
|
||||
|
||||
Serializable = Union[int, str, float]
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
diff --git a/tests/conftest.py.orig b/tests/conftest.py
|
||||
index 2aeb758dda6..a9b2b8b2bd1 100644
|
||||
--- a/tests/conftest.py.orig
|
||||
+++ b/tests/conftest.py
|
||||
@@ -3,7 +3,6 @@ import platform
|
||||
import socket
|
||||
import time
|
||||
|
||||
-import etcd3
|
||||
import pymemcache
|
||||
import pymemcache.client
|
||||
import pymongo
|
||||
diff --git a/pytest.ini.orig b/pytest.ini
|
||||
index 38c40a713d0..8c6659e21c2 100644
|
||||
--- a/pytest.ini.orig
|
||||
+++ b/pytest.ini
|
||||
@@ -17,7 +17,6 @@ addopts =
|
||||
-rfEsxX
|
||||
--cov=limits
|
||||
-m "not benchmark"
|
||||
- -K
|
||||
filterwarnings =
|
||||
error
|
||||
module::ResourceWarning
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
pkgname=py3-pathvalidate
|
||||
pkgver=3.2.3
|
||||
pkgrel=0
|
||||
pkgdesc="Python library to sanitize/validate a string such as filenames/file-paths/etc"
|
||||
url="https://github.com/thombashi/pathvalidate"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="python3"
|
||||
makedepends="
|
||||
py3-gpep517
|
||||
py3-setuptools
|
||||
py3-setuptools_scm
|
||||
py3-wheel
|
||||
"
|
||||
checkdepends="py3-pytest py3-click py3-faker"
|
||||
options="!check" # tests require unpackaged unmaintained dependencies
|
||||
subpackages="$pkgname-pyc"
|
||||
source="https://github.com/thombashi/pathvalidate/archive/refs/tags/v$pkgver/pathvalidate-$pkgver.tar.gz"
|
||||
builddir="$srcdir/pathvalidate-$pkgver"
|
||||
|
||||
build() {
|
||||
export SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver"
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 -m installer -d "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
674cddcf94d4f03aff5fe968c4c678f6fa510c8ff4dfd9232b2b075ccfaa17de86a08d497c10664399694c5e72b354d452d75f11f6b40d2f9778a2466af0b265 pathvalidate-3.2.3.tar.gz
|
||||
"
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
|
||||
# Maintainer:
|
||||
pkgname=py3-pivy
|
||||
pkgver=0.6.9
|
||||
pkgrel=2
|
||||
pkgdesc="Python3 bindings for coin"
|
||||
url="https://github.com/coin3d/pivy"
|
||||
# riscv64 blocked by py3-pyside6
|
||||
# armhf blocked by qt6-qtdeclarative -> py3-pyside6
|
||||
arch="all !riscv64 !armhf"
|
||||
license="ISC"
|
||||
depends="py3-pyside6"
|
||||
makedepends="swig soqt-dev qt6-qtbase-dev python3-dev glu-dev cmake samurai"
|
||||
checkdepends="py3-pytest"
|
||||
options="!check" # test suite is interactive and requires full installation
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/coin3d/pivy/archive/refs/tags/${pkgver//_alpha/.a}.tar.gz"
|
||||
builddir="$srcdir/pivy-${pkgver//_alpha/.a}"
|
||||
|
||||
build() {
|
||||
if [ "$CBUILD" != "$CHOST" ]; then
|
||||
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
|
||||
fi
|
||||
cmake -B build -G Ninja \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DBUILD_SHARED_LIBS=True \
|
||||
-DCMAKE_BUILD_TYPE=None \
|
||||
$CMAKE_CROSSOPTS
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
fd9587c69ad7468b771fbae59e68620f67a3c20850edadd65bf7994c1789d3444feb419e65dce34c6ee897c98eaca9f2f29f0bbfb4d1f0bbde26e4db56f74f78 py3-pivy-0.6.9.tar.gz
|
||||
"
|
||||
25
backports/rkdeveloptool/APKBUILD
Normal file
25
backports/rkdeveloptool/APKBUILD
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Maintainer: Martijn Braam <martijn@brixit.nl>
|
||||
pkgname=rkdeveloptool
|
||||
pkgver=1.1.0
|
||||
pkgdesc="opensource client for rockusb devices"
|
||||
pkgrel=1
|
||||
url="https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool"
|
||||
arch="all"
|
||||
license="GPL-2.0-only"
|
||||
source="https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/archive/$pkgver/rkdeveloptool-$pkgver.tar.gz"
|
||||
makedepends="meson libusb-dev eudev-dev scdoc"
|
||||
subpackages="$pkgname-doc"
|
||||
options="!check" # There is no testsuite
|
||||
|
||||
build() {
|
||||
abuild-meson . output
|
||||
meson compile -C output
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" meson install --no-rebuild -C output
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
ff32906924c6bd7027e864d1e417c6e94119a379db2dd6ffdf0c04af666fbb1be787e0a4fad298f87b6ab51696c74ccc51ed9d5a22a59079bbadcc00c0ea4ff1 rkdeveloptool-1.1.0.tar.gz
|
||||
"
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=signal-desktop
|
||||
pkgver=7.55.0
|
||||
pkgrel=0
|
||||
pkgver=7.71.0
|
||||
pkgrel=1
|
||||
pkgdesc="A messaging app for simple private communication with friends"
|
||||
url="https://github.com/signalapp/Signal-Desktop/"
|
||||
# same as electron
|
||||
|
|
@ -37,7 +37,6 @@ makedepends="
|
|||
glib-dev
|
||||
gn
|
||||
jsoncpp-dev
|
||||
libavif-dev
|
||||
libjpeg-turbo-dev
|
||||
libepoxy-dev
|
||||
libsecret-dev
|
||||
|
|
@ -67,10 +66,10 @@ makedepends="
|
|||
options="net !check"
|
||||
|
||||
# use _check_depends to validate this
|
||||
_libsignalver=0.71.1
|
||||
_ringrtcver=2.51.0
|
||||
_webrtcver=6998b
|
||||
_sqlcipherver=2.0.1
|
||||
_libsignalver=0.78.3
|
||||
_ringrtcver=2.57.0
|
||||
_webrtcver=7204c
|
||||
_sqlcipherver=2.4.4
|
||||
|
||||
source="
|
||||
https://github.com/signalapp/Signal-Desktop/archive/refs/tags/v$pkgver/Signal-Desktop-$pkgver.tar.gz
|
||||
|
|
@ -87,12 +86,14 @@ source="
|
|||
signal-rollback-locale-changes.patch
|
||||
signal-do-not-package-sqlcipher-deps.patch
|
||||
ringrtc-webrtc-renamed.patch
|
||||
ringrtc-use-sh.patch
|
||||
webrtc-shared-libs.patch
|
||||
webrtc-compiler.patch
|
||||
webrtc-gcc13.patch
|
||||
webrtc-rollback-red.patch
|
||||
webrtc-rollback-3rdparty-build-gn.patch
|
||||
webrtc-pipewire-1.4.patch
|
||||
webrtc-add-cstdint-include-patch-event.patch
|
||||
webrtc-use-only-payloadtypesuggester-for-pt-assignement.patch
|
||||
webrtc-fix-declaration-that-change-meaning-inside-class.patch
|
||||
|
||||
signal-desktop.sh
|
||||
"
|
||||
|
|
@ -112,6 +113,10 @@ export CFLAGS="${CFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknow
|
|||
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
||||
export CPPFLAGS="$CPPFLAGS -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
|
||||
|
||||
# stdatomic from compiler-rt uses implicit function declaration
|
||||
export CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
|
||||
export CXXFLAGS="$CXXFLAGS -Wno-implicit-function-declaration"
|
||||
|
||||
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
||||
export CARGO_PROFILE_RELEASE_STRIP="symbols"
|
||||
#export RUSTFLAGS="$RUSTFLAGS -C linker=clang"
|
||||
|
|
@ -136,7 +141,7 @@ _update_depends() {
|
|||
-e "s|^_ringrtcver=.*|_ringrtcver=$_ringrtcver|" \
|
||||
-e "s|^_webrtcver=.*|_webrtcver=$_webrtcver|" \
|
||||
-e "s|^_sqlcipherver=.*|_sqlcipherver=$_sqlcipherver|" \
|
||||
APKBUILD
|
||||
$APKBUILD
|
||||
}
|
||||
|
||||
# webrtc only, the other dependencies are fine with tarballs
|
||||
|
|
@ -223,7 +228,6 @@ prepare() {
|
|||
icu
|
||||
jsoncpp
|
||||
libaom
|
||||
libavif
|
||||
libdrm
|
||||
libjpeg
|
||||
libpng
|
||||
|
|
@ -329,6 +333,9 @@ build() {
|
|||
rtc_include_ilbc=false
|
||||
rtc_libvpx_build_vp9=true
|
||||
rtc_use_x11=false
|
||||
rustc_version=\"yes\"
|
||||
rust_bindgen_root=\"/usr\"
|
||||
rust_sysroot_absolute=\"/usr\"
|
||||
|
||||
build_with_mozilla=false
|
||||
chrome_pgo_phase=0
|
||||
|
|
@ -478,24 +485,26 @@ package() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
59e1aae568735976e79ee38d55c87b137f7075063985e72deb42b53af6facd7ed2a8c0912fd86cb88df3182d17c1b58af11bf1501135e6855cfd5ee70270905e Signal-Desktop-7.55.0.tar.gz
|
||||
3d1b5b84d42b4f6da46a2f626ec72931d3d7432c10c0d43e562851933f6cf0a434630eb5f8bb9a586d27d6ad5a5d8a6c96873dc468e53bbf6297c35a8da090d8 libsignal-0.71.1.tar.gz
|
||||
8e32d75f9f8216106b6858d9ab58ad53f209408fc155fe27dec184c8c65c9ab5a3a93e9567953f209424ed435ccc6d4903a49a4edae36eb744a897cc02098312 ringrtc-2.51.0.tar.gz
|
||||
592987c1661de464a4e6dee3081cb5fd32e5afdacdba43d901557a217e62301b4655009ad5bdc0c1dcff5e8b67d7acd68ac953cd638f31196162aa3ccdd9c63b node-sqlcipher-2.0.1.tar.gz
|
||||
ba02cb0c293210f9a683b0e08c6acbe84f5b78089329ec017b0db3493b38ccf39e92c49c2475dc66b5ce3bfe060686718cb5053787e2d61ed320dadb22891989 webrtc-6998b.tar.zst
|
||||
da16a4759fc8ab55d8c480c4fe79bdee9f8a165ae2c4a9f8df250e8e0ef6aba234c07adeca8b202490a422e41c45b39c1dda0cb22a458583d0dfd488d5ea8c91 Signal-Desktop-7.71.0.tar.gz
|
||||
fc2170bb029628efed5dbae795471026387e501bc2ca7075a5e210df6d81103608361c8163759c7d73f9e82b61e2a5e46d8bf32f40a0c5a19e5fc556a2ff1413 libsignal-0.78.3.tar.gz
|
||||
205da87c64a000cc439b2c7bfddb923eac5ab70a0611dab9858eb2e0c0a71227722e6d13eaba2a458807cf27ff93641b8f549580f5e1fc3781ab3c7fb29d9edb ringrtc-2.57.0.tar.gz
|
||||
79dd21548329b4ee409fa73b013c18ed4e85038aeef7a4cfe196fd6b5113279da8ad287a259fa6a6b546b52a5a6dd6ae2cb1050007043d25f76d7917dbbbc02d node-sqlcipher-2.4.4.tar.gz
|
||||
5dd61ebe525c592020a7246337dd837a8cd5de45b201afdc5b75cf3b25c5afcf6bbbae2bb677677807157697fdfb0be51681c0a8e68839e4f1eee30d3dbcad48 webrtc-7204c.tar.zst
|
||||
8d2d2d82c8546c2dd1fef161b61df79918f8c22235a56a46adb375a0beb4acef12c5fe53e67242a4be97f77adc522ff79b47949c352956c742a70d50f4179f7f libsignal-auditable.patch
|
||||
7ee747c8aaa9d6e9149fe0a031e3d4cc9e9c08f22c42076bd05e2acb86952f8170032613d13a53716010edfa3f26ad97b530e82460318eb46a42e28cf5faeb9d signal-use-system-sqlcipher.patch
|
||||
fc2af28645364cd85c106304a26811b036f6be048c52137fbbcc112870a84132a181f532563e0569b560fde3cf8c02480666a9b01d804b0008f97c728005b1c7 signal-disable-updates.patch
|
||||
ef3622da416a5bd2d4bea4f2a4fbb21a985f660d4acc17bbe66ce51ac1180ab92c0c843a5414ff56ea1deda87c2b0f611a299ca8ebe4d6a24df53626b36ceea8 signal-disable-updates.patch
|
||||
853de84d636f730694f17bcec63463fa7bfbdd0a7f7a64618a8fc6bc523ce1a9854b4c651753735af735c18101295d3efbe54f83ae0bccbed83c8c1fee3e7049 signal-update-links.patch
|
||||
882d6889b23a3ebc6449c8b6acec8c3853674a7e94f066d65b57bab674ba8c11d582ba2c760825cb67b9202716e6d8b7123001d1e9f9229e49a0b77e9d978265 signal-show-window-please.patch
|
||||
aca92e4de6cd005d660d7e8b99607de96ca2d7dc220e3465247d517e915e4d41a4b0eb519e85c5eca1c81cd8bac9821acd03ff57f1603918987829c6ea7757b4 signal-rollback-locale-changes.patch
|
||||
961568777b86f8fbcc73360252123686c9d1e16b2650f23d8afbc6d7580d53024f81b62e9e9cbdcd0031b5cf99854bd47c6dd4580197f2b27b8b4cbb51c6c9c9 signal-do-not-package-sqlcipher-deps.patch
|
||||
02a648bb8541a39c75fec2db39f024a27976afca41908eefa2fe1f2e30b05b5d59f980ccc930021c0b0c09ba8b0cbcae071e9f0dd530543c667adbc4272af552 ringrtc-webrtc-renamed.patch
|
||||
19d2e07bdc0b160ec542fcb0a3d94ae1e37dcb1b3455e57b278cf074f8aac625341b47f4f06a1f7eb5a197cb0f11754de8785ffd10876852972cbfafdc2615db ringrtc-use-sh.patch
|
||||
98a7e4df27c3ed56c5968ebc3ae8e08bfb54362d0c910f9af1d414079a6d5fe0f18aa570ae3c38042f4691af6a130cb3ff689625e26a3987720dd319a5f587b1 webrtc-shared-libs.patch
|
||||
897174fa3b1eaa74a3b2d7d861863a9f60550ddb0d7be700cd590600efdc3bd962f52c21e371276eaf8d5657c98fe8ade9853b0197b61a68d5dce6fa03b5899b webrtc-compiler.patch
|
||||
3f1095861a79862ab5a55c86d7e353d272974617afba39e4d4441024bede8d7b9b8e122da90d56a9c3c0965171803d6b9e29e91d78167a08c6bcc86b3eedab18 webrtc-gcc13.patch
|
||||
8f53dcf3264c5cec338f037e57a7770ec939ee06dfb0c5dfeab23967a3a64d3f861a6b5419766ac892676036b4522bce2f47279ca3658b5c0b6a31c82ac05053 webrtc-rollback-red.patch
|
||||
f8bd574a0de077a643ced26e8a0e3f162e014bbf91c957bbefd113883a70e2b63e483bf400b7e2da8d09edfe76d4f6a257f194a14124f344f1625c5632d12acb webrtc-rollback-3rdparty-build-gn.patch
|
||||
7fa0344a144d5b8f05d0962799b8ce1dbe8f2d403a311d4fbf802a2d032e6586a1268387052b529e809c4740a79d6737a63d7e37ea8902ce926b74309dd44fc3 webrtc-pipewire-1.4.patch
|
||||
2a83171eae579a756edbf95c3ded80cbe0cd0fdb4f19b4c73612837f7ea6f573125dde013a17c8e7ce08f101568bb73bfb86a945dc2d10dd91ad45632c69a132 webrtc-add-cstdint-include-patch-event.patch
|
||||
1520ca0993cd9df44401de001d1f49da924b8c9bd818c8f7fb47863af710cc2796306e786ad8522c9729dec6a1191d1f2d9e0e2ba2b678b9b8ea534b7bddc762 webrtc-use-only-payloadtypesuggester-for-pt-assignement.patch
|
||||
ace87a2be03c6965012a87a10918c5923b10d5e74a7169c1e1384c15b34a367d0c47e806764c368cc30dad01a3dce54b50587abea9831130178db3806619abc8 webrtc-fix-declaration-that-change-meaning-inside-class.patch
|
||||
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop.sh
|
||||
"
|
||||
|
|
|
|||
14
backports/signal-desktop/ringrtc-use-sh.patch
Normal file
14
backports/signal-desktop/ringrtc-use-sh.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/ringrtc/src/node/package.json.orig b/ringrtc/src/node/package.json
|
||||
index 366caf2927f..eedeca3895e 100644
|
||||
--- a/ringrtc/src/node/package.json.orig
|
||||
+++ b/ringrtc/src/node/package.json
|
||||
@@ -16,7 +16,7 @@
|
||||
"virtual_audio": "dist/bin/virtual_audio.sh"
|
||||
},
|
||||
"scripts": {
|
||||
- "build": "tsc && bash scripts/build-help.sh",
|
||||
+ "build": "tsc && sh scripts/build-help.sh",
|
||||
"clean": "rimraf dist",
|
||||
"test": "electron-mocha --renderer --recursive dist/test --timeout 10000 --require source-map-support/register",
|
||||
"eslint": "eslint .",
|
||||
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
--- a/Signal-Desktop/config/production.json
|
||||
diff --git a/Signal-Desktop/config/production.json.orig b/Signal-Desktop/config/production.json
|
||||
index ee1fc6523d8..6fcb97f3a36 100644
|
||||
--- a/Signal-Desktop/config/production.json.orig
|
||||
+++ b/Signal-Desktop/config/production.json
|
||||
@@ -16,5 +16,5 @@
|
||||
"serverTrustRoot": "BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF",
|
||||
"genericServerPublicParams": "AByD873dTilmOSG0TjKrvpeaKEsUmIO8Vx9BeMmftwUs9v7ikPwM8P3OHyT0+X3EUMZrSe9VUp26Wai51Q9I8mdk0hX/yo7CeFGJyzoOqn8e/i4Ygbn5HoAyXJx5eXfIbqpc0bIxzju4H/HOQeOpt6h742qii5u/cbwOhFZCsMIbElZTaeU+BWMBQiZHIGHT5IE0qCordQKZ5iPZom0HeFa8Yq0ShuEyAl0WINBiY6xE3H/9WnvzXBbMuuk//eRxXgzO8ieCeK8FwQNxbfXqZm6Ro1cMhCOF3u7xoX83QhpN",
|
||||
"backupServerPublicParams": "AJwNSU55fsFCbgaxGRD11wO1juAs8Yr5GF8FPlGzzvdJJIKH5/4CC7ZJSOe3yL2vturVaRU2Cx0n751Vt8wkj1bozK3CBV1UokxV09GWf+hdVImLGjXGYLLhnI1J2TWEe7iWHyb553EEnRb5oxr9n3lUbNAJuRmFM7hrr0Al0F0wrDD4S8lo2mGaXe0MJCOM166F8oYRQqpFeEHfiLnxA1O8ZLh7vMdv4g9jI5phpRBTsJ5IjiJrWeP0zdIGHEssUeprDZ9OUJ14m0v61eYJMKsf59Bn+mAT2a7YfB+Don9O",
|
||||
"stripePublishableKey": "pk_live_6cmGZopuTsV8novGgJJW9JpC00vLIgtQ1D",
|
||||
- "updatesEnabled": true
|
||||
+ "updatesEnabled": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
diff --git a/webrtc/rtc_base/trace_event.h b/webrtc/rtc_base/trace_event.h
|
||||
index 3329abd..9ec7088 100644
|
||||
--- a/webrtc/rtc_base/trace_event.h
|
||||
+++ b/webrtc/rtc_base/trace_event.h
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifndef RTC_BASE_TRACE_EVENT_H_
|
||||
#define RTC_BASE_TRACE_EVENT_H_
|
||||
|
||||
+#include <cstdint>
|
||||
#if defined(RTC_DISABLE_TRACE_EVENTS)
|
||||
#define RTC_TRACE_EVENTS_ENABLED 0
|
||||
#else
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
diff --git a/webrtc/p2p/base/port_interface.h b/webrtc/p2p/base/port_interface.h
|
||||
index 2335fc2..1484a14 100644
|
||||
--- a/webrtc/p2p/base/port_interface.h
|
||||
+++ b/webrtc/p2p/base/port_interface.h
|
||||
@@ -55,7 +55,7 @@
|
||||
virtual ~PortInterface();
|
||||
|
||||
virtual IceCandidateType Type() const = 0;
|
||||
- virtual const Network* Network() const = 0;
|
||||
+ virtual const ::webrtc::Network* Network() const = 0;
|
||||
|
||||
// Methods to set/get ICE role and tiebreaker values.
|
||||
virtual void SetIceRole(IceRole role) = 0;
|
||||
diff --git a/webrtc/pc/codec_vendor.h b/webrtc/pc/codec_vendor.h
|
||||
index aaddc4f..719a082 100644
|
||||
--- a/webrtc/pc/codec_vendor.h
|
||||
+++ b/webrtc/pc/codec_vendor.h
|
||||
@@ -119,7 +119,7 @@
|
||||
class CodecLookupHelper {
|
||||
public:
|
||||
virtual ~CodecLookupHelper() = default;
|
||||
- virtual PayloadTypeSuggester* PayloadTypeSuggester() = 0;
|
||||
+ virtual ::webrtc::PayloadTypeSuggester* PayloadTypeSuggester() = 0;
|
||||
// Look up the codec vendor to use, depending on context.
|
||||
// This call may get additional arguments in the future, to aid
|
||||
// in selection of the correct context.
|
||||
diff --git a/webrtc/pc/jsep_transport.h b/webrtc/pc/jsep_transport.h
|
||||
index 017aad7..50dc991 100644
|
||||
--- a/webrtc/pc/jsep_transport.h
|
||||
+++ b/webrtc/pc/jsep_transport.h
|
||||
@@ -115,14 +115,12 @@
|
||||
}
|
||||
|
||||
RTCError SetLocalJsepTransportDescription(
|
||||
- const JsepTransportDescription& jsep_description,
|
||||
- SdpType type);
|
||||
+ const JsepTransportDescription& jsep_description, SdpType type);
|
||||
|
||||
// Set the remote TransportDescription to be used by DTLS and ICE channels
|
||||
// that are part of this Transport.
|
||||
RTCError SetRemoteJsepTransportDescription(
|
||||
- const JsepTransportDescription& jsep_description,
|
||||
- SdpType type);
|
||||
+ const JsepTransportDescription& jsep_description, SdpType type);
|
||||
RTCError AddRemoteCandidates(const Candidates& candidates);
|
||||
|
||||
// Set the "needs-ice-restart" flag as described in JSEP. After the flag is
|
||||
@@ -204,7 +202,9 @@
|
||||
return rtp_dtls_transport_;
|
||||
}
|
||||
|
||||
- scoped_refptr<SctpTransport> SctpTransport() const { return sctp_transport_; }
|
||||
+ scoped_refptr<::webrtc::SctpTransport> SctpTransport() const {
|
||||
+ return sctp_transport_;
|
||||
+ }
|
||||
|
||||
// TODO(bugs.webrtc.org/9719): Delete method, update callers to use
|
||||
// SctpTransport() instead.
|
||||
|
|
@ -0,0 +1,469 @@
|
|||
diff --git a/webrtc/pc/codec_vendor.cc b/webrtc/pc/codec_vendor.cc
|
||||
index 42d52f6..e45516c 100644
|
||||
--- a/webrtc/pc/codec_vendor.cc
|
||||
+++ b/webrtc/pc/codec_vendor.cc
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "pc/rtp_media_utils.h"
|
||||
#include "pc/session_description.h"
|
||||
#include "pc/typed_codec_vendor.h"
|
||||
-#include "pc/used_ids.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/string_encode.h"
|
||||
@@ -54,11 +53,6 @@
|
||||
|
||||
namespace {
|
||||
|
||||
-using webrtc::PayloadTypeSuggester;
|
||||
-using webrtc::RTCError;
|
||||
-using webrtc::RTCErrorOr;
|
||||
-using webrtc::RtpTransceiverDirection;
|
||||
-
|
||||
bool IsRtxCodec(const RtpCodecCapability& capability) {
|
||||
return absl::EqualsIgnoreCase(capability.name, kRtxCodecName);
|
||||
}
|
||||
@@ -75,8 +69,7 @@
|
||||
std::optional<Codec> FindMatchingCodec(const CodecList& codecs1,
|
||||
const CodecList& codecs2,
|
||||
const Codec& codec_to_match) {
|
||||
- return webrtc::FindMatchingCodec(codecs1.codecs(), codecs2.codecs(),
|
||||
- codec_to_match);
|
||||
+ return FindMatchingCodec(codecs1.codecs(), codecs2.codecs(), codec_to_match);
|
||||
}
|
||||
|
||||
void StripCNCodecs(CodecList& audio_codecs) {
|
||||
@@ -105,7 +98,7 @@
|
||||
}
|
||||
|
||||
int associated_pt;
|
||||
- if (!webrtc::FromString(associated_pt_str, &associated_pt)) {
|
||||
+ if (!FromString(associated_pt_str, &associated_pt)) {
|
||||
RTC_LOG(LS_WARNING) << "Couldn't convert payload type " << associated_pt_str
|
||||
<< " of RTX codec " << rtx_codec.id
|
||||
<< " to an integer.";
|
||||
@@ -136,14 +129,14 @@
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
- std::vector<absl::string_view> redundant_payloads = webrtc::split(fmtp, '/');
|
||||
+ std::vector<absl::string_view> redundant_payloads = split(fmtp, '/');
|
||||
if (redundant_payloads.size() < 2) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
absl::string_view associated_pt_str = redundant_payloads[0];
|
||||
int associated_pt;
|
||||
- if (!webrtc::FromString(associated_pt_str, &associated_pt)) {
|
||||
+ if (!FromString(associated_pt_str, &associated_pt)) {
|
||||
RTC_LOG(LS_WARNING) << "Couldn't convert first payload type "
|
||||
<< associated_pt_str << " of RED codec " << red_codec.id
|
||||
<< " to an integer.";
|
||||
@@ -182,7 +175,21 @@
|
||||
return suggestion.MoveError();
|
||||
}
|
||||
codec.id = suggestion.value();
|
||||
- offered_codecs.push_back(codec);
|
||||
+ // The rewrite of the parameter may have turned the codec into
|
||||
+ // one that is already present.
|
||||
+ bool skip = false;
|
||||
+ for (const Codec& present_codec : offered_codecs) {
|
||||
+ if (present_codec.id == codec.id) {
|
||||
+ RTC_DCHECK(MatchesWithReferenceAttributes(present_codec, codec))
|
||||
+ << "Codec mismatch: present " << present_codec << ", new "
|
||||
+ << codec;
|
||||
+ skip = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!skip) {
|
||||
+ offered_codecs.push_back(codec);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +239,7 @@
|
||||
}
|
||||
std::string red_param = absl::StrCat(matching_codec->id);
|
||||
red_codec.params[kCodecParamNotInNameValueFormat] =
|
||||
- webrtc::StrJoin(std::vector{red_param, red_param}, "/");
|
||||
+ StrJoin(std::vector{red_param, red_param}, "/");
|
||||
}
|
||||
RTCErrorOr<PayloadType> suggestion =
|
||||
pt_suggester.SuggestPayloadType(mid, red_codec);
|
||||
@@ -240,84 +247,25 @@
|
||||
return suggestion.MoveError();
|
||||
}
|
||||
red_codec.id = suggestion.value();
|
||||
- offered_codecs.push_back(red_codec);
|
||||
+ // The rewrite of the parameter may have turned the RED codec into
|
||||
+ // one that is already present.
|
||||
+ bool skip = false;
|
||||
+ for (const Codec& present_codec : offered_codecs) {
|
||||
+ if (present_codec.id == red_codec.id) {
|
||||
+ RTC_DCHECK(MatchesWithReferenceAttributes(present_codec, red_codec));
|
||||
+ skip = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!skip) {
|
||||
+ offered_codecs.push_back(red_codec);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
offered_codecs.CheckConsistency();
|
||||
return RTCError::OK();
|
||||
}
|
||||
|
||||
-// Adds all codecs from `reference_codecs` to `offered_codecs` that don't
|
||||
-// already exist in `offered_codecs` and ensure the payload types don't
|
||||
-// collide.
|
||||
-// OLD VERSION - uses UsedPayloadTypes
|
||||
-void MergeCodecs(const CodecList& reference_codecs,
|
||||
- CodecList& offered_codecs,
|
||||
- UsedPayloadTypes* used_pltypes) {
|
||||
- // Add all new codecs that are not RTX/RED codecs.
|
||||
- // The two-pass splitting of the loops means preferring payload types
|
||||
- // of actual codecs with respect to collisions.
|
||||
- for (const Codec& reference_codec : reference_codecs) {
|
||||
- if (reference_codec.GetResiliencyType() != Codec::ResiliencyType::kRtx &&
|
||||
- reference_codec.GetResiliencyType() != Codec::ResiliencyType::kRed &&
|
||||
- !FindMatchingCodec(reference_codecs, offered_codecs, reference_codec)) {
|
||||
- Codec codec = reference_codec;
|
||||
- used_pltypes->FindAndSetIdUsed(&codec);
|
||||
- offered_codecs.push_back(codec);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- // Add all new RTX or RED codecs.
|
||||
- for (const Codec& reference_codec : reference_codecs) {
|
||||
- if (reference_codec.GetResiliencyType() == Codec::ResiliencyType::kRtx &&
|
||||
- !FindMatchingCodec(reference_codecs, offered_codecs, reference_codec)) {
|
||||
- Codec rtx_codec = reference_codec;
|
||||
- const Codec* associated_codec =
|
||||
- GetAssociatedCodecForRtx(reference_codecs, rtx_codec);
|
||||
- if (!associated_codec) {
|
||||
- continue;
|
||||
- }
|
||||
- // Find a codec in the offered list that matches the reference codec.
|
||||
- // Its payload type may be different than the reference codec.
|
||||
- std::optional<Codec> matching_codec = FindMatchingCodec(
|
||||
- reference_codecs, offered_codecs, *associated_codec);
|
||||
- if (!matching_codec) {
|
||||
- RTC_LOG(LS_WARNING)
|
||||
- << "Couldn't find matching " << associated_codec->name << " codec.";
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- rtx_codec.params[kCodecParamAssociatedPayloadType] =
|
||||
- absl::StrCat(matching_codec->id);
|
||||
- used_pltypes->FindAndSetIdUsed(&rtx_codec);
|
||||
- offered_codecs.push_back(rtx_codec);
|
||||
- } else if (reference_codec.GetResiliencyType() ==
|
||||
- Codec::ResiliencyType::kRed &&
|
||||
- !FindMatchingCodec(reference_codecs, offered_codecs,
|
||||
- reference_codec)) {
|
||||
- Codec red_codec = reference_codec;
|
||||
- const Codec* associated_codec =
|
||||
- GetAssociatedCodecForRed(reference_codecs, red_codec);
|
||||
- if (associated_codec) {
|
||||
- std::optional<Codec> matching_codec = FindMatchingCodec(
|
||||
- reference_codecs, offered_codecs, *associated_codec);
|
||||
- if (!matching_codec) {
|
||||
- RTC_LOG(LS_WARNING) << "Couldn't find matching "
|
||||
- << associated_codec->name << " codec.";
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- red_codec.params[kCodecParamNotInNameValueFormat] =
|
||||
- absl::StrCat(matching_codec->id) + "/" +
|
||||
- absl::StrCat(matching_codec->id);
|
||||
- }
|
||||
- used_pltypes->FindAndSetIdUsed(&red_codec);
|
||||
- offered_codecs.push_back(red_codec);
|
||||
- }
|
||||
- }
|
||||
- offered_codecs.CheckConsistency();
|
||||
-}
|
||||
-
|
||||
// `codecs` is a full list of codecs with correct payload type mappings, which
|
||||
// don't conflict with mappings of the other media type; `supported_codecs` is
|
||||
// a list filtered for the media section`s direction but with default payload
|
||||
@@ -382,7 +330,7 @@
|
||||
codec.params.find(kCodecParamNotInNameValueFormat);
|
||||
if (fmtp != codec.params.end()) {
|
||||
std::vector<absl::string_view> redundant_payloads =
|
||||
- webrtc::split(fmtp->second, '/');
|
||||
+ split(fmtp->second, '/');
|
||||
if (!redundant_payloads.empty() &&
|
||||
redundant_payloads[0] == id) {
|
||||
if (!red_was_added) {
|
||||
@@ -443,7 +391,7 @@
|
||||
for (const Codec& supported_codec : supported_codecs) {
|
||||
if (absl::EqualsIgnoreCase(supported_codec.name, kH265CodecName)) {
|
||||
std::optional<H265ProfileTierLevel> supported_ptl =
|
||||
- webrtc::ParseSdpForH265ProfileTierLevel(supported_codec.params);
|
||||
+ ParseSdpForH265ProfileTierLevel(supported_codec.params);
|
||||
if (supported_ptl.has_value()) {
|
||||
supported_h265_profiles[supported_ptl->profile] =
|
||||
supported_ptl->level;
|
||||
@@ -458,14 +406,14 @@
|
||||
for (auto& filtered_codec : filtered_codecs) {
|
||||
if (absl::EqualsIgnoreCase(filtered_codec.name, kH265CodecName)) {
|
||||
std::optional<H265ProfileTierLevel> filtered_ptl =
|
||||
- webrtc::ParseSdpForH265ProfileTierLevel(filtered_codec.params);
|
||||
+ ParseSdpForH265ProfileTierLevel(filtered_codec.params);
|
||||
if (filtered_ptl.has_value()) {
|
||||
auto it = supported_h265_profiles.find(filtered_ptl->profile);
|
||||
|
||||
if (it != supported_h265_profiles.end() &&
|
||||
filtered_ptl->level != it->second) {
|
||||
filtered_codec.params[kH265FmtpLevelId] =
|
||||
- webrtc::H265LevelToString(it->second);
|
||||
+ H265LevelToString(it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,13 +454,13 @@
|
||||
}
|
||||
}
|
||||
if (absl::EqualsIgnoreCase(ours.name, kH264CodecName)) {
|
||||
- webrtc::H264GenerateProfileLevelIdForAnswer(ours.params, theirs->params,
|
||||
- &negotiated.params);
|
||||
+ H264GenerateProfileLevelIdForAnswer(ours.params, theirs->params,
|
||||
+ &negotiated.params);
|
||||
}
|
||||
#ifdef RTC_ENABLE_H265
|
||||
if (absl::EqualsIgnoreCase(ours.name, kH265CodecName)) {
|
||||
- webrtc::H265GenerateProfileTierLevelForAnswer(
|
||||
- ours.params, theirs->params, &negotiated.params);
|
||||
+ H265GenerateProfileTierLevelForAnswer(ours.params, theirs->params,
|
||||
+ &negotiated.params);
|
||||
NegotiateTxMode(ours, *theirs, &negotiated);
|
||||
}
|
||||
#endif
|
||||
@@ -534,7 +482,7 @@
|
||||
continue;
|
||||
}
|
||||
int apt_value;
|
||||
- if (!webrtc::FromString(apt_str, &apt_value)) {
|
||||
+ if (!FromString(apt_str, &apt_value)) {
|
||||
RTC_LOG(LS_WARNING) << "Unconvertable apt value";
|
||||
continue;
|
||||
}
|
||||
@@ -634,9 +582,11 @@
|
||||
}
|
||||
// Add our codecs that are not in the current description.
|
||||
if (media_description_options.type == MediaType::AUDIO) {
|
||||
- MergeCodecs(all_audio_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(audio_recv_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(audio_send_codecs(), mid, codecs, pt_suggester);
|
||||
} else {
|
||||
- MergeCodecs(all_video_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(video_recv_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(video_send_codecs(), mid, codecs, pt_suggester);
|
||||
}
|
||||
CodecList filtered_codecs;
|
||||
CodecList supported_codecs =
|
||||
@@ -667,20 +617,11 @@
|
||||
const MediaContentDescription* mcd =
|
||||
current_content->media_description();
|
||||
for (const Codec& codec : mcd->codecs()) {
|
||||
- if (webrtc::FindMatchingCodec(mcd->codecs(), codecs.codecs(),
|
||||
- codec)) {
|
||||
+ if (FindMatchingCodec(mcd->codecs(), codecs.codecs(), codec)) {
|
||||
filtered_codecs.push_back(codec);
|
||||
}
|
||||
}
|
||||
}
|
||||
- // Note what PTs are already in use.
|
||||
- UsedPayloadTypes
|
||||
- used_pltypes; // Used to avoid pt collisions in filtered_codecs
|
||||
- for (auto& codec : filtered_codecs) {
|
||||
- // Note: This may change PTs. Doing so woud indicate an error, but
|
||||
- // UsedPayloadTypes doesn't offer a means to make the distinction.
|
||||
- used_pltypes.FindAndSetIdUsed(&codec);
|
||||
- }
|
||||
// Add other supported codecs.
|
||||
for (const Codec& codec : supported_codecs) {
|
||||
std::optional<Codec> found_codec =
|
||||
@@ -707,8 +648,11 @@
|
||||
changed_referenced_codec->id);
|
||||
}
|
||||
}
|
||||
- // Quick fix for b/395077842: Remap the codec if it collides.
|
||||
- used_pltypes.FindAndSetIdUsed(&(*found_codec));
|
||||
+ auto pt_or_error = pt_suggester.SuggestPayloadType(mid, *found_codec);
|
||||
+ if (!pt_or_error.ok()) {
|
||||
+ return pt_or_error.MoveError();
|
||||
+ }
|
||||
+ found_codec->id = pt_or_error.value();
|
||||
filtered_codecs.push_back(*found_codec);
|
||||
}
|
||||
}
|
||||
@@ -763,9 +707,11 @@
|
||||
}
|
||||
// Add all our supported codecs
|
||||
if (media_description_options.type == MediaType::AUDIO) {
|
||||
- MergeCodecs(all_audio_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(audio_recv_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(audio_send_codecs(), mid, codecs, pt_suggester);
|
||||
} else {
|
||||
- MergeCodecs(all_video_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(video_recv_codecs(), mid, codecs, pt_suggester);
|
||||
+ MergeCodecs(video_send_codecs(), mid, codecs, pt_suggester);
|
||||
}
|
||||
CodecList filtered_codecs;
|
||||
CodecList negotiated_codecs;
|
||||
@@ -794,8 +740,8 @@
|
||||
const MediaContentDescription* mcd =
|
||||
current_content->media_description();
|
||||
for (const Codec& codec : mcd->codecs()) {
|
||||
- if (std::optional<Codec> found_codec = webrtc::FindMatchingCodec(
|
||||
- mcd->codecs(), codecs.codecs(), codec)) {
|
||||
+ if (std::optional<Codec> found_codec =
|
||||
+ FindMatchingCodec(mcd->codecs(), codecs.codecs(), codec)) {
|
||||
filtered_codecs.push_back(*found_codec);
|
||||
}
|
||||
}
|
||||
@@ -913,8 +859,7 @@
|
||||
case RtpTransceiverDirection::kSendRecv:
|
||||
case RtpTransceiverDirection::kStopped:
|
||||
case RtpTransceiverDirection::kInactive:
|
||||
- return GetVideoCodecsForOffer(
|
||||
- webrtc::RtpTransceiverDirectionReversed(offer));
|
||||
+ return GetVideoCodecsForOffer(RtpTransceiverDirectionReversed(offer));
|
||||
case RtpTransceiverDirection::kSendOnly:
|
||||
return video_send_codecs_.codecs();
|
||||
case RtpTransceiverDirection::kRecvOnly:
|
||||
@@ -948,8 +893,7 @@
|
||||
case RtpTransceiverDirection::kSendRecv:
|
||||
case RtpTransceiverDirection::kStopped:
|
||||
case RtpTransceiverDirection::kInactive:
|
||||
- return GetAudioCodecsForOffer(
|
||||
- webrtc::RtpTransceiverDirectionReversed(offer));
|
||||
+ return GetAudioCodecsForOffer(RtpTransceiverDirectionReversed(offer));
|
||||
case RtpTransceiverDirection::kSendOnly:
|
||||
return audio_send_codecs_.codecs();
|
||||
case RtpTransceiverDirection::kRecvOnly:
|
||||
@@ -958,43 +902,6 @@
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
-CodecList CodecVendor::all_video_codecs() const {
|
||||
- CodecList all_codecs;
|
||||
- UsedPayloadTypes used_payload_types;
|
||||
- for (const Codec& codec : video_recv_codecs_.codecs()) {
|
||||
- Codec codec_mutable = codec;
|
||||
- used_payload_types.FindAndSetIdUsed(&codec_mutable);
|
||||
- all_codecs.push_back(codec_mutable);
|
||||
- }
|
||||
-
|
||||
- // Use MergeCodecs to merge the second half of our list as it already checks
|
||||
- // and fixes problems with duplicate payload types.
|
||||
- MergeCodecs(video_send_codecs_.codecs(), all_codecs, &used_payload_types);
|
||||
-
|
||||
- return all_codecs;
|
||||
-}
|
||||
-
|
||||
-CodecList CodecVendor::all_audio_codecs() const {
|
||||
- // Compute the audio codecs union.
|
||||
- CodecList codecs;
|
||||
- for (const Codec& send : audio_send_codecs_.codecs()) {
|
||||
- codecs.push_back(send);
|
||||
- if (!FindMatchingCodec(audio_send_codecs_.codecs(),
|
||||
- audio_recv_codecs_.codecs(), send)) {
|
||||
- // It doesn't make sense to have an RTX codec we support sending but not
|
||||
- // receiving.
|
||||
- RTC_DCHECK(send.GetResiliencyType() != Codec::ResiliencyType::kRtx);
|
||||
- }
|
||||
- }
|
||||
- for (const Codec& recv : audio_recv_codecs_.codecs()) {
|
||||
- if (!FindMatchingCodec(audio_recv_codecs_.codecs(),
|
||||
- audio_send_codecs_.codecs(), recv)) {
|
||||
- codecs.push_back(recv);
|
||||
- }
|
||||
- }
|
||||
- return codecs;
|
||||
-}
|
||||
-
|
||||
CodecList CodecVendor::audio_sendrecv_codecs() const {
|
||||
// Use NegotiateCodecs to merge our codec lists, since the operation is
|
||||
// essentially the same. Put send_codecs as the offered_codecs, which is the
|
||||
diff --git a/webrtc/pc/wcodec_vendor.h b/webrtc/pc/codec_vendor.h
|
||||
index 1472225..4a3a8d9 100644
|
||||
--- a/webrtc/pc/codec_vendor.h
|
||||
+++ b/webrtc/pc/codec_vendor.h
|
||||
@@ -102,9 +102,6 @@
|
||||
const RtpTransceiverDirection& offer,
|
||||
const RtpTransceiverDirection& answer) const;
|
||||
|
||||
- CodecList all_video_codecs() const;
|
||||
- CodecList all_audio_codecs() const;
|
||||
-
|
||||
TypedCodecVendor audio_send_codecs_;
|
||||
TypedCodecVendor audio_recv_codecs_;
|
||||
|
||||
diff --git a/webrtc/pc/used_ids.h b/webrtc/pc/used_ids.h
|
||||
index fe80531..f9d825c 100644
|
||||
--- a/webrtc/pc/used_ids.h
|
||||
+++ b/webrtc/pc/used_ids.h
|
||||
@@ -14,9 +14,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/rtp_parameters.h"
|
||||
-#include "media/base/codec.h"
|
||||
#include "rtc_base/checks.h"
|
||||
-#include "rtc_base/logging.h"
|
||||
|
||||
namespace webrtc {
|
||||
template <typename IdStruct>
|
||||
@@ -88,41 +86,6 @@
|
||||
std::set<int> id_set_;
|
||||
};
|
||||
|
||||
-// Helper class used for finding duplicate RTP payload types among audio, video
|
||||
-// and data codecs. When bundle is used the payload types may not collide.
|
||||
-class UsedPayloadTypes : public UsedIds<Codec> {
|
||||
- public:
|
||||
- UsedPayloadTypes()
|
||||
- : UsedIds<Codec>(kFirstDynamicPayloadTypeLowerRange,
|
||||
- kLastDynamicPayloadTypeUpperRange) {}
|
||||
-
|
||||
- // Check if a payload type is valid. The range [64-95] is forbidden
|
||||
- // when rtcp-mux is used.
|
||||
- static bool IsIdValid(Codec codec, bool rtcp_mux) {
|
||||
- if (rtcp_mux && (codec.id > kLastDynamicPayloadTypeLowerRange &&
|
||||
- codec.id < kFirstDynamicPayloadTypeUpperRange)) {
|
||||
- return false;
|
||||
- }
|
||||
- return codec.id >= 0 && codec.id <= kLastDynamicPayloadTypeUpperRange;
|
||||
- }
|
||||
-
|
||||
- protected:
|
||||
- bool IsIdUsed(int new_id) override {
|
||||
- // Range marked for RTCP avoidance is "used".
|
||||
- if (new_id > kLastDynamicPayloadTypeLowerRange &&
|
||||
- new_id < kFirstDynamicPayloadTypeUpperRange)
|
||||
- return true;
|
||||
- return UsedIds<Codec>::IsIdUsed(new_id);
|
||||
- }
|
||||
-
|
||||
- private:
|
||||
- static const int kFirstDynamicPayloadTypeLowerRange = 35;
|
||||
- static const int kLastDynamicPayloadTypeLowerRange = 63;
|
||||
-
|
||||
- static const int kFirstDynamicPayloadTypeUpperRange = 96;
|
||||
- static const int kLastDynamicPayloadTypeUpperRange = 127;
|
||||
-};
|
||||
-
|
||||
// Helper class used for finding duplicate RTP Header extension ids among
|
||||
// audio and video extensions.
|
||||
class UsedRtpHeaderExtensionIds : public UsedIds<RtpExtension> {
|
||||
@@ -190,7 +153,6 @@
|
||||
#ifdef WEBRTC_ALLOW_DEPRECATED_NAMESPACES
|
||||
namespace cricket {
|
||||
using ::webrtc::UsedIds;
|
||||
-using ::webrtc::UsedPayloadTypes;
|
||||
using ::webrtc::UsedRtpHeaderExtensionIds;
|
||||
} // namespace cricket
|
||||
#endif // WEBRTC_ALLOW_DEPRECATED_NAMESPACES
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=soqt
|
||||
pkgver=1.6.3
|
||||
pkgrel=0
|
||||
pkgdesc="GUI binding library for coin"
|
||||
url="https://github.com/coin3d/soqt"
|
||||
arch="all"
|
||||
license="BSD-3-Clause"
|
||||
makedepends="coin-dev cmake mesa-dev samurai qt5-qtbase-dev doxygen"
|
||||
options="!check" # test suite consists only of interactive programs
|
||||
subpackages="$pkgname-dev $pkgname-doc"
|
||||
source="https://github.com/coin3d/soqt/releases/download/v$pkgver/soqt-$pkgver-src.tar.gz"
|
||||
builddir="$srcdir/$pkgname"
|
||||
|
||||
build() {
|
||||
cmake -B build -G Ninja . \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=None \
|
||||
-DSOQT_BUILD_DOCUMENTATION=ON \
|
||||
-DSOQT_BUILD_DOC_MAN=ON
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8cef22cf4214dd03bb4639c1fff77c127bf80f99e3b7fb7c1c21c25a281aa484252414f4a48fa59b8b2485afe7920ce9e86366fd1343badc77b75b78d3ac4c53 soqt-1.6.3-src.tar.gz
|
||||
"
|
||||
Loading…
Add table
Add a link
Reference in a new issue