-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,215 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
common-files/chromium-patches/chromium-numerics-byte_conversions-no-std-bit_cast/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
std::bit_cast doesn't exist in libstdcxx 10 | ||
|
||
--- a/base/numerics/byte_conversions.h | ||
+++ b/base/numerics/byte_conversions.h | ||
@@ -11,6 +11,7 @@ | ||
#include <span> | ||
#include <type_traits> | ||
|
||
+#include "absl/base/casts.h" | ||
#include "base/numerics/basic_ops_impl.h" | ||
|
||
namespace base::numerics { | ||
@@ -80,7 +81,7 @@ | ||
// storage, and explicit big endian for network order. | ||
inline constexpr float FloatFromNativeEndian( | ||
std::span<const uint8_t, 4u> bytes) { | ||
- return std::bit_cast<float>(U32FromNativeEndian(bytes)); | ||
+ return absl::bit_cast<float>(U32FromNativeEndian(bytes)); | ||
} | ||
// Returns a double with the value in `bytes` interpreted as the native endian | ||
// encoding of the number for the machine. | ||
@@ -91,7 +92,7 @@ | ||
// storage, and explicit big endian for network order. | ||
inline constexpr double DoubleFromNativeEndian( | ||
std::span<const uint8_t, 8u> bytes) { | ||
- return std::bit_cast<double>(U64FromNativeEndian(bytes)); | ||
+ return absl::bit_cast<double>(U64FromNativeEndian(bytes)); | ||
} | ||
|
||
// Returns a uint8_t with the value in `bytes` interpreted as a little-endian | ||
@@ -156,7 +157,7 @@ | ||
// buffer. | ||
inline constexpr float FloatFromLittleEndian( | ||
std::span<const uint8_t, 4u> bytes) { | ||
- return std::bit_cast<float>(U32FromLittleEndian(bytes)); | ||
+ return absl::bit_cast<float>(U32FromLittleEndian(bytes)); | ||
} | ||
// Returns a double with the value in `bytes` interpreted as a little-endian | ||
// encoding of the integer. | ||
@@ -168,7 +169,7 @@ | ||
// buffer. | ||
inline constexpr double DoubleFromLittleEndian( | ||
std::span<const uint8_t, 8u> bytes) { | ||
- return std::bit_cast<double>(U64FromLittleEndian(bytes)); | ||
+ return absl::bit_cast<double>(U64FromLittleEndian(bytes)); | ||
} | ||
|
||
// Returns a uint8_t with the value in `bytes` interpreted as a big-endian | ||
@@ -223,7 +224,7 @@ | ||
// that were always in memory, such as when stored in shared-memory (or through | ||
// IPC) as a byte buffer. | ||
inline constexpr float FloatFromBigEndian(std::span<const uint8_t, 4u> bytes) { | ||
- return std::bit_cast<float>(U32FromBigEndian(bytes)); | ||
+ return absl::bit_cast<float>(U32FromBigEndian(bytes)); | ||
} | ||
// Returns a double with the value in `bytes` interpreted as a big-endian | ||
// encoding of the integer. | ||
@@ -234,7 +235,7 @@ | ||
// IPC) as a byte buffer. | ||
inline constexpr double DoubleFromBigEndian( | ||
std::span<const uint8_t, 8u> bytes) { | ||
- return std::bit_cast<double>(U64FromBigEndian(bytes)); | ||
+ return absl::bit_cast<double>(U64FromBigEndian(bytes)); | ||
} | ||
|
||
// Returns a byte array holding the value of a uint8_t encoded as the native | ||
@@ -285,7 +286,7 @@ | ||
// byte buffer. Prefer an explicit little endian when storing data into external | ||
// storage, and explicit big endian for network order. | ||
inline constexpr std::array<uint8_t, 4u> FloatToNativeEndian(float val) { | ||
- return U32ToNativeEndian(std::bit_cast<uint32_t>(val)); | ||
+ return U32ToNativeEndian(absl::bit_cast<uint32_t>(val)); | ||
} | ||
// Returns a byte array holding the value of a double encoded as the native | ||
// endian encoding of the number for the machine. | ||
@@ -295,7 +296,7 @@ | ||
// byte buffer. Prefer an explicit little endian when storing data into external | ||
// storage, and explicit big endian for network order. | ||
inline constexpr std::array<uint8_t, 8u> DoubleToNativeEndian(double val) { | ||
- return U64ToNativeEndian(std::bit_cast<uint64_t>(val)); | ||
+ return U64ToNativeEndian(absl::bit_cast<uint64_t>(val)); | ||
} | ||
|
||
// Returns a byte array holding the value of a uint8_t encoded as the | ||
@@ -351,7 +352,7 @@ | ||
// memory, such as when stored in shared-memory (or passed through IPC) as a | ||
// byte buffer. | ||
inline constexpr std::array<uint8_t, 4u> FloatToLittleEndian(float val) { | ||
- return internal::ToLittleEndian(std::bit_cast<uint32_t>(val)); | ||
+ return internal::ToLittleEndian(absl::bit_cast<uint32_t>(val)); | ||
} | ||
// Returns a byte array holding the value of a double encoded as the | ||
// little-endian encoding of the number. | ||
@@ -362,7 +363,7 @@ | ||
// memory, such as when stored in shared-memory (or passed through IPC) as a | ||
// byte buffer. | ||
inline constexpr std::array<uint8_t, 8u> DoubleToLittleEndian(double val) { | ||
- return internal::ToLittleEndian(std::bit_cast<uint64_t>(val)); | ||
+ return internal::ToLittleEndian(absl::bit_cast<uint64_t>(val)); | ||
} | ||
|
||
// Returns a byte array holding the value of a uint8_t encoded as the big-endian | ||
@@ -418,7 +419,7 @@ | ||
// IPC) as a byte buffer. Use the little-endian encoding for storing and reading | ||
// from storage. | ||
inline constexpr std::array<uint8_t, 4u> FloatToBigEndian(float val) { | ||
- return internal::ToLittleEndian(ByteSwap(std::bit_cast<uint32_t>(val))); | ||
+ return internal::ToLittleEndian(ByteSwap(absl::bit_cast<uint32_t>(val))); | ||
} | ||
// Returns a byte array holding the value of a double encoded as the big-endian | ||
// encoding of the number. | ||
@@ -429,7 +430,7 @@ | ||
// IPC) as a byte buffer. Use the little-endian encoding for storing and reading | ||
// from storage. | ||
inline constexpr std::array<uint8_t, 8u> DoubleToBigEndian(double val) { | ||
- return internal::ToLittleEndian(ByteSwap(std::bit_cast<uint64_t>(val))); | ||
+ return internal::ToLittleEndian(ByteSwap(absl::bit_cast<uint64_t>(val))); | ||
} | ||
|
||
} // namespace base::numerics |
45 changes: 45 additions & 0 deletions
45
common-files/chromium-patches/compiler-clang-lib-dir/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- a/build/config/clang/clang.gni | ||
+++ b/build/config/clang/clang.gni | ||
@@ -35,6 +35,9 @@ | ||
# Set to true to enable output of ThinLTO index and import files used for | ||
# creating a Chromium MLGO corpus in the ThinLTO case. | ||
lld_emit_indexes_and_imports = false | ||
+ | ||
+ custom_toolchain_clang_base_path = "" | ||
+ custom_toolchain_clang_version = "" | ||
} | ||
|
||
# We don't really need to collect a corpus for the host tools, just for the target. | ||
--- a/build/config/clang/BUILD.gn | ||
+++ b/build/config/clang/BUILD.gn | ||
@@ -5,6 +5,8 @@ | ||
import("//build/config/rust.gni") | ||
import("clang.gni") | ||
|
||
+import("//v8/gni/snapshot_toolchain.gni") | ||
+ | ||
if (is_ios) { | ||
import("//build/config/ios/config.gni") # For `target_environment` | ||
} | ||
@@ -186,6 +186,21 @@ | ||
} | ||
|
||
_clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib" | ||
+ | ||
+ if (is_a_target_toolchain && current_toolchain != v8_snapshot_toolchain) { | ||
+ _dir = "linux" | ||
+ _clang_lib_dir = "$custom_toolchain_clang_base_path/lib/clang/$custom_toolchain_clang_version/lib" | ||
+ if (current_cpu == "x64") { | ||
+ _suffix = "-x86_64-android" | ||
+ } else if (current_cpu == "arm") { | ||
+ _suffix = "-arm-android" | ||
+ } else if (current_cpu == "arm64") { | ||
+ _suffix = "-aarch64-android" | ||
+ } else { | ||
+ assert(false) # Unhandled cpu type | ||
+ } | ||
+ } | ||
+ | ||
_lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}" | ||
libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ] | ||
} |
42 changes: 42 additions & 0 deletions
42
common-files/chromium-patches/compiler-custom-rust-abi-target-triple/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- a/build/config/rust.gni | ||
+++ b/build/config/rust.gni | ||
@@ -7,6 +7,8 @@ | ||
import("//build/config/sanitizers/sanitizers.gni") | ||
import("//build/toolchain/toolchain.gni") | ||
|
||
+import("//v8/gni/snapshot_toolchain.gni") | ||
+ | ||
if (is_android) { | ||
import("//build/config/android/config.gni") | ||
} | ||
@@ -98,6 +100,8 @@ | ||
# a platform. Mostly applicable to Windows, where new versions can handle ANSI | ||
# escape sequences but it's not reliable in general. | ||
force_rustc_color_output = false | ||
+ | ||
+ custom_target_rust_abi_target = "" | ||
} | ||
|
||
# Use a separate declare_args so these variables' defaults can depend on the | ||
@@ -165,7 +169,7 @@ | ||
# TODO(crbug.com/1278030): To build unit tests for Android we need to build | ||
# them as a dylib and put them into an APK. We should reuse all the same logic | ||
# for gtests from the `//testing/test:test` template. | ||
-can_build_rust_unit_tests = toolchain_has_rust && !is_android | ||
+can_build_rust_unit_tests = toolchain_has_rust && !is_android && false | ||
|
||
# We want to store rust_sysroot as a source-relative variable for ninja | ||
# portability. In practice if an external toolchain was specified, it might | ||
@@ -280,6 +284,12 @@ | ||
} | ||
} | ||
|
||
+if (!toolchain_for_rust_host_build_tools && current_toolchain != v8_snapshot_toolchain && current_toolchain != host_toolchain) { | ||
+ if (custom_target_rust_abi_target != "") { | ||
+ rust_abi_target = custom_target_rust_abi_target | ||
+ } | ||
+} | ||
+ | ||
assert(!toolchain_has_rust || rust_abi_target != "") | ||
|
||
# This variable is passed to the Rust libstd build. |
20 changes: 20 additions & 0 deletions
20
common-files/chromium-patches/compiler-use-custom-libcxx-for-v8/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- a/build/config/c++/c++.gni | ||
+++ b/build/config/c++/c++.gni | ||
@@ -6,6 +6,8 @@ | ||
import("//build/config/sanitizers/sanitizers.gni") | ||
import("//build_overrides/build.gni") | ||
|
||
+import("//v8/gni/snapshot_toolchain.gni") | ||
+ | ||
declare_args() { | ||
# Use in-tree libc++ (buildtools/third_party/libc++ and | ||
# buildtools/third_party/libc++abi) instead of the system C++ library for C++ | ||
@@ -42,6 +44,8 @@ | ||
|
||
use_custom_libcxx = | ||
use_custom_libcxx || (use_custom_libcxx_for_host && !is_a_target_toolchain) | ||
+use_custom_libcxx = | ||
+ use_custom_libcxx || (use_custom_libcxx_for_host && current_toolchain == v8_snapshot_toolchain) | ||
use_custom_libcxx = use_custom_libcxx && !is_nacl | ||
|
||
declare_args() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ium-patches/performance_manager-context_collection-no-constexpr-operator-equal/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/components/performance_manager/resource_attribution/context_collection.h | ||
+++ b/components/performance_manager/resource_attribution/context_collection.h | ||
@@ -28,7 +28,7 @@ | ||
ContextCollection(const ContextCollection& other); | ||
ContextCollection& operator=(const ContextCollection& other); | ||
|
||
- friend constexpr bool operator==(const ContextCollection&, | ||
+ friend bool operator==(const ContextCollection&, | ||
const ContextCollection&) = default; | ||
|
||
// Adds `context` to the collection. |
13 changes: 13 additions & 0 deletions
13
...chromium-patches/resource_attribution-query_params-no-constexpr-operator-equal/6312.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: defaulted definition of equality comparison operator cannot be declared constexpr because it invokes a non-constexpr comparison function | ||
|
||
--- a/components/performance_manager/resource_attribution/query_params.h | ||
+++ b/components/performance_manager/resource_attribution/query_params.h | ||
@@ -67,7 +67,7 @@ | ||
QueryParams(const QueryParams& other); | ||
QueryParams& operator=(const QueryParams& other); | ||
|
||
- friend constexpr bool operator==(const QueryParams&, | ||
+ friend bool operator==(const QueryParams&, | ||
const QueryParams&) = default; | ||
|
||
// Resource types to measure. |
Oops, something went wrong.