Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
https://github.com/chromium/chromium/commit/4c736420952f355f18bdc4f4ea2d16e4514fa034

--- a/content/browser/tpcd_heuristics/opener_heuristic_utils.h
+++ b/content/browser/tpcd_heuristics/opener_heuristic_utils.h
@@ -6,6 +6,9 @@
#define CONTENT_BROWSER_TPCD_HEURISTICS_OPENER_HEURISTIC_UTILS_H_

#include <map>
+#include <set>
+#include <string>
+#include <utility>

#include "base/types/optional_ref.h"
#include "content/common/content_export.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
https://github.com/chromium/chromium/commit/48b64da89b3ecb7ccb576a334b19b3066dd2b793

--- a/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.h
+++ b/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_SAFETY_HUB_DISRUPTIVE_NOTIFICATION_PERMISSIONS_MANAGER_H_

#include <memory>
+#include <set>

#include "base/scoped_observation.h"
#include "base/time/clock.h"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
`atomic_ref` is not landed in NDK r27c
`atomic_ref` is not landed in NDK r27c, and it is used in:

--- a/base/__termux_header_only_atomic_ref_polyfill.h
+++ b/base/__termux_header_only_atomic_ref_polyfill.h
- //base/atomicops.cc
- //third_party/simdutf/simdutf.cpp
- //v8/src/objects/simd.cc

--- a/third_party/termux-polyfill/__termux_header_only_atomic_ref_polyfill.h
+++ b/third_party/termux-polyfill/__termux_header_only_atomic_ref_polyfill.h
@@ -0,0 +1,607 @@
+// Origin: https://github.com/ORNL/cpp-proposals-pub
+// Origin Description: Collaborating on papers for the ISO C++ committee - public repo
Expand Down Expand Up @@ -617,7 +621,7 @@
#include "base/memory/aligned_memory.h"

+#ifdef __TERMUX__
+#include "base/__termux_header_only_atomic_ref_polyfill.h"
+#include "third_party/termux-polyfill/__termux_header_only_atomic_ref_polyfill.h"
+template <typename T>
+using __my_atomic_ref = Foo::atomic_ref<T>;
+#else
Expand Down Expand Up @@ -666,3 +670,98 @@
.store(*src_byte_ptr, std::memory_order_relaxed);
// SAFETY: We check above that `dst_byte_ptr` and `src_byte_ptr` point
// to spans of sufficient size.

--- a/third_party/simdutf/simdutf.h
+++ b/third_party/simdutf/simdutf.h
@@ -82,7 +82,7 @@
!defined(SIMDUTF_SPAN_DISABLED)
#define SIMDUTF_SPAN 1
#endif // __cpp_concepts >= 201907L && __cpp_lib_span >= 202002L
- #if __cpp_lib_atomic_ref >= 201806L
+ #if __cpp_lib_atomic_ref >= 201806L || defined(__TERMUX__)
#define SIMDUTF_ATOMIC_REF 1
#endif // __cpp_lib_atomic_ref
#endif
--- a/third_party/simdutf/simdutf.cpp
+++ b/third_party/simdutf/simdutf.cpp
@@ -2,6 +2,17 @@
/* begin file src/simdutf.cpp */
#include "simdutf.h"

+#ifdef SIMDUTF_ATOMIC_REF
+#ifdef __TERMUX__
+#include "third_party/termux-polyfill/__termux_header_only_atomic_ref_polyfill.h"
+template <typename T>
+using __my_atomic_ref = Foo::atomic_ref<T>;
+#else
+template <typename T>
+using __my_atomic_ref = std::atomic_ref<T>;
+#endif
+#endif
+
#if SIMDUTF_FEATURE_BASE64
// We include base64_tables once.
/* begin file src/tables/base64_tables.h */
@@ -18410,7 +18421,7 @@
#if SIMDUTF_ATOMIC_REF
size_t atomic_binary_to_base64(const char *input, size_t length, char *output,
base64_options options) noexcept {
- static_assert(std::atomic_ref<char>::required_alignment == 1);
+ static_assert(__my_atomic_ref<char>::required_alignment == 1);
size_t retval = 0;
// Arbitrary block sizes: 3KB for input, 4KB for output. Total is 7KB.
constexpr size_t input_block_size = 1024 * 3;
@@ -18430,7 +18441,7 @@
// Under x64, we could use 16-byte aligned loads.
// Note that we warn users that the performance might be poor.
for (size_t j = 0; j < current_block_size; ++j) {
- inbuf[j] = std::atomic_ref<char>(mutable_input[i + j])
+ inbuf[j] = __my_atomic_ref<char>(mutable_input[i + j])
.load(std::memory_order_relaxed);
}
const size_t written = binary_to_base64(inbuf.data(), current_block_size,
@@ -18438,7 +18449,7 @@
// This copy is inefficient.
// Under x64, we could use 16-byte aligned stores.
for (size_t j = 0; j < written; ++j) {
- std::atomic_ref<char>(output[retval + j])
+ __my_atomic_ref<char>(output[retval + j])
.store(outbuf[j], std::memory_order_relaxed);
}
retval += written;
--- a/v8/src/objects/simd.cc
+++ b/v8/src/objects/simd.cc
@@ -32,6 +32,15 @@
#include <arm_neon.h>
#endif

+#ifdef __TERMUX__
+#include "third_party/termux-polyfill/__termux_header_only_atomic_ref_polyfill.h"
+template <typename T>
+using __my_atomic_ref = Foo::atomic_ref<T>;
+#else
+template <typename T>
+using __my_atomic_ref = std::atomic_ref<T>;
+#endif
+
namespace v8 {
namespace internal {

@@ -487,7 +496,7 @@
char* mutable_bytes = const_cast<char*>(bytes);
for (size_t i = 0; i < length; i++) {
uint8_t byte =
- std::atomic_ref<char>(mutable_bytes[i]).load(std::memory_order_relaxed);
+ __my_atomic_ref<char>(mutable_bytes[i]).load(std::memory_order_relaxed);
PerformNibbleToHexAndWriteIntoStringOutPut(byte, index, string_output);
index += 2;
}
@@ -1082,7 +1091,7 @@
result = HandleRemainingHexValues(input_vector, i);
if (result.has_value()) {
if (is_shared) {
- std::atomic_ref<uint8_t>(buffer[index++])
+ __my_atomic_ref<uint8_t>(buffer[index++])
.store(result.value(), std::memory_order_relaxed);
} else {
buffer[index++] = result.value();
154 changes: 154 additions & 0 deletions tur-chromium/chromium-stable/7008-use-SFINAE-in-base-containers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
This reverts commit https://github.com/chromium/chromium/commit/4f6cc657b0953fb353111d581c130858e90aec08

diff --git a/base/containers/buffer_iterator.h b/base/containers/buffer_iterator.h
index 61abd79721..e2d9528a24 100644
--- a/base/containers/buffer_iterator.h
+++ b/base/containers/buffer_iterator.h
@@ -80,8 +80,8 @@ class BufferIterator {

// Copies out an object. As compared to using `Object`, this avoids potential
// unaligned access which may be undefined behavior.
- template <typename T>
- requires(std::is_trivially_copyable_v<T>)
+ template <typename T,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
std::optional<T> CopyObject() {
std::optional<T> t;
if (remaining_.size() >= sizeof(T)) {
@@ -101,8 +101,8 @@ class BufferIterator {
// `CopyObject` as it avoids this problem entirely.
// TODO(danakj): We should probably CHECK this instead of allowing UB into
// production.
- template <typename T>
- requires(std::is_trivially_copyable_v<T>)
+ template <typename T,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
const T* Object() {
return MutableObject<const T>();
}
@@ -117,8 +117,8 @@ class BufferIterator {
// `CopyObject` as it avoids this problem entirely.
// TODO(danakj): We should probably CHECK this instead of allowing UB into
// production.
- template <typename T>
- requires(std::is_trivially_copyable_v<T>)
+ template <typename T,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
T* MutableObject() {
T* t = nullptr;
if (remaining_.size() >= sizeof(T)) {
@@ -142,8 +142,8 @@ class BufferIterator {
// using the span will cause Undefined Behaviour.
// TODO(danakj): We should probably CHECK this instead of allowing UB into
// production.
- template <typename T>
- requires(std::is_trivially_copyable_v<T>)
+ template <typename T,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
span<T> MutableSpan(size_t count) {
size_t byte_size;
if (!CheckMul(sizeof(T), count).AssignIfValid(&byte_size)) {
@@ -165,9 +165,10 @@ class BufferIterator {

// An overload for when the size is known at compile time. The result will be
// a fixed-size span.
- template <typename T, size_t N>
- requires(N <= std::numeric_limits<size_t>::max() / sizeof(T) &&
- std::is_trivially_copyable_v<T>)
+ template <typename T,
+ size_t N,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
+ requires(N <= std::numeric_limits<size_t>::max() / sizeof(T))
std::optional<span<T, N>> MutableSpan() {
constexpr size_t byte_size =
N * sizeof(T); // Overflow is checked by `requires`.
@@ -193,17 +194,18 @@ class BufferIterator {
// using the span will cause Undefined Behaviour.
// TODO(danakj): We should probably CHECK this instead of allowing UB into
// production.
- template <typename T>
- requires(std::is_trivially_copyable_v<T>)
+ template <typename T,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
span<const T> Span(size_t count) {
return MutableSpan<const T>(count);
}

// An overload for when the size is known at compile time. The result will be
// a fixed-size span.
- template <typename T, size_t N>
- requires(N <= std::numeric_limits<size_t>::max() / sizeof(T) &&
- std::is_trivially_copyable_v<T>)
+ template <typename T,
+ size_t N,
+ typename = std::enable_if_t<std::is_trivially_copyable_v<T>>>
+ requires(N <= std::numeric_limits<size_t>::max() / sizeof(T))
std::optional<span<const T, N>> Span() {
return MutableSpan<const T, N>();
}
diff --git a/base/containers/flat_map.h b/base/containers/flat_map.h
index 612e15f7ff..25158d4eb9 100644
--- a/base/containers/flat_map.h
+++ b/base/containers/flat_map.h
@@ -234,12 +234,13 @@ class flat_map : public ::base::internal::
iterator insert_or_assign(const_iterator hint, K&& key, M&& obj);

template <class K, class... Args>
- requires(std::is_constructible_v<key_type, K &&>)
- std::pair<iterator, bool> try_emplace(K&& key, Args&&... args);
+ std::enable_if_t<std::is_constructible_v<key_type, K&&>,
+ std::pair<iterator, bool>>
+ try_emplace(K&& key, Args&&... args);

template <class K, class... Args>
- requires(std::is_constructible_v<key_type, K &&>)
- iterator try_emplace(const_iterator hint, K&& key, Args&&... args);
+ std::enable_if_t<std::is_constructible_v<key_type, K&&>, iterator>
+ try_emplace(const_iterator hint, K&& key, Args&&... args);

// --------------------------------------------------------------------------
// General operations.
@@ -324,12 +325,10 @@ auto flat_map<Key, Mapped, Compare, Container>::insert_or_assign(

template <class Key, class Mapped, class Compare, class Container>
template <class K, class... Args>
- requires(std::is_constructible_v<
- typename flat_map<Key, Mapped, Compare, Container>::key_type,
- K &&>)
auto flat_map<Key, Mapped, Compare, Container>::try_emplace(K&& key,
Args&&... args)
- -> std::pair<iterator, bool> {
+ -> std::enable_if_t<std::is_constructible_v<key_type, K&&>,
+ std::pair<iterator, bool>> {
return tree::emplace_key_args(
key, std::piecewise_construct,
std::forward_as_tuple(std::forward<K>(key)),
@@ -338,13 +337,10 @@ auto flat_map<Key, Mapped, Compare, Container>::try_emplace(K&& key,

template <class Key, class Mapped, class Compare, class Container>
template <class K, class... Args>
- requires(std::is_constructible_v<
- typename flat_map<Key, Mapped, Compare, Container>::key_type,
- K &&>)
auto flat_map<Key, Mapped, Compare, Container>::try_emplace(const_iterator hint,
K&& key,
Args&&... args)
- -> iterator {
+ -> std::enable_if_t<std::is_constructible_v<key_type, K&&>, iterator> {
return tree::emplace_hint_key_args(
hint, key, std::piecewise_construct,
std::forward_as_tuple(std::forward<K>(key)),
diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h
index d0a60ed748..70ecf19d91 100644
--- a/base/containers/intrusive_heap.h
+++ b/base/containers/intrusive_heap.h
@@ -572,8 +572,7 @@ class IntrusiveHeap {
private:
// Templated version of ToIndex that lets insert/erase/Replace work with all
// integral types.
- template <typename I>
- requires(std::is_integral_v<I>)
+ template <typename I, typename = std::enable_if_t<std::is_integral_v<I>>>
size_type ToIndex(I pos) {
return static_cast<size_type>(pos);
}
27 changes: 0 additions & 27 deletions tur-chromium/chromium-stable/7008-xnnpack-clang-18.patch

This file was deleted.

9 changes: 6 additions & 3 deletions tur-chromium/chromium-stable/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.chromium.org/Home
TERMUX_PKG_DESCRIPTION="Chromium web browser"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="Chongyun Lee <[email protected]>"
TERMUX_PKG_VERSION=136.0.7103.113
TERMUX_PKG_VERSION=137.0.7151.55
TERMUX_PKG_SRCURL=https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=7c765bd13df842a28bb52279b8d711411ac6082151473e07bd70b9a482c0a0ac
TERMUX_PKG_SHA256=b11e76fd82745db5602ce151ae931cc5e56c3ee2b6e08c2fbf788bf4b3ea84cb
TERMUX_PKG_DEPENDS="atk, cups, dbus, fontconfig, gtk3, krb5, libc++, libdrm, libevdev, libxkbcommon, libminizip, libnss, libwayland, libx11, mesa, openssl, pango, pulseaudio, zlib"
TERMUX_PKG_BUILD_DEPENDS="libffi-static"
# Chromium doesn't support i686 on Linux.
Expand Down Expand Up @@ -158,7 +158,7 @@ treat_warnings_as_errors = false
# Use system libraries as little as possible
use_system_freetype = false
# use_system_libdrm = true
use_system_libffi = false
# use_system_libffi = false
use_custom_libcxx = false
use_custom_libcxx_for_host = true
use_allocator_shim = false
Expand Down Expand Up @@ -197,6 +197,9 @@ enable_nacl = false
is_cfi = false
use_cfi_icall = false
use_thin_lto = false
# OpenCL doesn't work out of box in Termux, use NNAPI instead
build_tflite_with_opencl = false
build_tflite_with_nnapi = true
# Enable rust
custom_target_rust_abi_target = \"$CARGO_TARGET_NAME\"
llvm_android_mainline = true
Expand Down
Loading