Commit 8ae21170 authored by Jeff Huang's avatar Jeff Huang 🤔

[testing] chromium: fix build

parent 260e5669
Pipeline #3169 passed with stages
in 201 minutes and 11 seconds
......@@ -56,7 +56,8 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgn
chromium-media-fix-build-with-libstdc++.patch
chromium-avoid-log-flooding-in-GLSurfacePresentationHelper.patch
chromium-widevine.patch
chromium-skia-harmony.patch)
chromium-skia-harmony.patch
constexpr-errors-with-old-clang.patch)
sha256sums=('9ebb731576d25901cee5505f3458cf7780b0a39243743d7779f66514716bbfa3'
'04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
'e2d284311f49c529ea45083438a768db390bde52949995534034d2a814beab89'
......@@ -64,7 +65,8 @@ sha256sums=('9ebb731576d25901cee5505f3458cf7780b0a39243743d7779f66514716bbfa3'
'f51fe91427d8638c5551746d2ec7de99e8059dd76889cfeaee8ca3d8fed62265'
'f2b12ccf83a8e0adda4a87ae5c983df5e092ccf1f9a6f2e05799ce4d451dbda1'
'd081f2ef8793544685aad35dea75a7e6264a2cb987ff3541e6377f4a3650a28b'
'5887f78b55c4ecbbcba5930f3f0bb7bc0117c2a41c2f761805fcf7f46f1ca2b3')
'5887f78b55c4ecbbcba5930f3f0bb7bc0117c2a41c2f761805fcf7f46f1ca2b3'
'6c8895b64562449acc5d356586b95a89bd7fa01d776f544d2fcc59b3c0ddac4d')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
......@@ -86,6 +88,10 @@ prepare() {
third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
third_party/libxml/chromium/libxml_utils.cc
# https://reviews.llvm.org/rL314865
# When we upgrade llvm to 7.0.0 or later, please remove this patch
patch -Np1 -i ../constexpr-errors-with-old-clang.patch
# https://crbug.com/819294#c88
patch -Np1 -i ../chromium-color_utils-use-std-sqrt.patch
......
Description: work around build failures with old versions of clang where
it fails to acknowledge function calls returning constant expressions
(see https://reviews.llvm.org/rL314865). This is fixed in clang 7.
Author: Olivier Tilloy <olivier.tilloy@canonical.com>
--- a/gpu/command_buffer/client/transfer_buffer_cmd_copy_helpers.h
+++ b/gpu/command_buffer/client/transfer_buffer_cmd_copy_helpers.h
@@ -13,7 +13,7 @@ namespace gpu {
// Sum the sizes of the types in Ts as CheckedNumeric<T>.
template <typename T, typename... Ts>
-constexpr base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
+base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
static_assert(sizeof...(Ts) > 0, "");
base::CheckedNumeric<T> checked_elements_size = 0;
for (size_t s : {sizeof(Ts)...}) {
@@ -25,7 +25,7 @@ constexpr base::CheckedNumeric<T> Checke
// Compute the number of bytes required for a struct-of-arrays where each array
// of type T has count items. If there is an overflow, this function returns 0.
template <typename... Ts>
-constexpr base::CheckedNumeric<uint32_t> ComputeCheckedCombinedCopySize(
+base::CheckedNumeric<uint32_t> ComputeCheckedCombinedCopySize(
uint32_t count) {
static_assert(sizeof...(Ts) > 0, "");
base::CheckedNumeric<uint32_t> checked_combined_size = 0;
@@ -87,10 +87,9 @@ auto CopyArraysToBuffer(uint32_t count,
// Sum the sizes of the types in Ts. This will fail to compile if the result
// does not fit in T.
template <typename T, typename... Ts>
-constexpr T SizeOfPackedTypes() {
- constexpr base::CheckedNumeric<T> checked_elements_size =
+T SizeOfPackedTypes() {
+ base::CheckedNumeric<T> checked_elements_size =
CheckedSizeOfPackedTypes<T, Ts...>();
- static_assert(checked_elements_size.IsValid(), "");
return checked_elements_size.ValueOrDie();
}
@@ -113,7 +112,7 @@ template <typename... Ts>
constexpr uint32_t ComputeMaxCopyCount(uint32_t buffer_size) {
// Start by tightly packing the elements and decrease copy_count until
// the total aligned copy size fits
- constexpr uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
+ uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
uint32_t copy_count = buffer_size / elements_size;
while (copy_count > 0) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment