From d2ac2146bc865439241a8766d599d91406cb4b36 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 14 Sep 2023 17:09:57 +0200 Subject: [PATCH 1/3] rebase emplace_back_on_vector-c++20.patch to fix the link error --- ...chromium-117-emplace_back_on_vector-c++20.patch | 14 ++++++++++++++ chromium.spec | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) rename chromium-116-emplace_back_on_vector-c++20.patch => chromium-117-emplace_back_on_vector-c++20.patch (74%) diff --git a/chromium-116-emplace_back_on_vector-c++20.patch b/chromium-117-emplace_back_on_vector-c++20.patch similarity index 74% rename from chromium-116-emplace_back_on_vector-c++20.patch rename to chromium-117-emplace_back_on_vector-c++20.patch index 363dc877..3a3c1320 100644 --- a/chromium-116-emplace_back_on_vector-c++20.patch +++ b/chromium-117-emplace_back_on_vector-c++20.patch @@ -44,3 +44,17 @@ diff -up chromium-116.0.5845.96/chrome/browser/content_settings/one_time_permiss permissions::PermissionUmaUtil::RecordOneTimePermissionEvent( content_setting_type, trigger_event); } +diff -up chromium-117.0.5938.62/base/trace_event/trace_log.cc.me chromium-117.0.5938.62/base/trace_event/trace_log.cc +--- chromium-117.0.5938.62/base/trace_event/trace_log.cc.me 2023-09-13 20:14:42.441248781 +0200 ++++ chromium-117.0.5938.62/base/trace_event/trace_log.cc 2023-09-13 20:16:12.186638601 +0200 +@@ -2187,8 +2187,8 @@ void TraceLog::SetTraceBufferForTesting( + #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + void TraceLog::OnSetup(const perfetto::DataSourceBase::SetupArgs& args) { + AutoLock lock(track_event_lock_); +- track_event_sessions_.emplace_back(args.internal_instance_index, *args.config, +- args.backend_type); ++ track_event_sessions_.emplace_back() = {args.internal_instance_index, *args.config, ++ args.backend_type}; + } + + void TraceLog::OnStart(const perfetto::DataSourceBase::StartArgs&) { diff --git a/chromium.spec b/chromium.spec index 5887783a..21eba31e 100644 --- a/chromium.spec +++ b/chromium.spec @@ -351,7 +351,7 @@ Patch303: chromium-116-typename.patch Patch304: chromium-117-missing-header-files.patch # compiler error with c++20 -Patch306: chromium-116-emplace_back_on_vector-c++20.patch +Patch306: chromium-117-emplace_back_on_vector-c++20.patch # disable memory tagging for epel8 on aarch64 due to new feature IFUNC-Resolver not supported # in old glibc < 2.30 From 0990303e4a0b31aded6f17c0131832a70518c19c Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 15 Sep 2023 10:46:02 +0200 Subject: [PATCH 2/3] - added missing typename to fix compiler error - fix compiler error, invalid operands to binary expression --- chromium-117-string-convert.patch | 21 ++++++++++ ...ename.patch => chromium-117-typename.patch | 39 +++++++++++++++++++ chromium.spec | 6 ++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 chromium-117-string-convert.patch rename chromium-116-typename.patch => chromium-117-typename.patch (68%) diff --git a/chromium-117-string-convert.patch b/chromium-117-string-convert.patch new file mode 100644 index 00000000..cb48e4b2 --- /dev/null +++ b/chromium-117-string-convert.patch @@ -0,0 +1,21 @@ +diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.cc.me chromium-117.0.5938.62/net/dns/host_resolver_cache.cc +diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me chromium-117.0.5938.62/net/dns/host_resolver_cache.h +--- chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me 2023-09-14 15:21:24.632965004 +0200 ++++ chromium-117.0.5938.62/net/dns/host_resolver_cache.h 2023-09-15 09:15:48.511300845 +0200 +@@ -143,12 +143,14 @@ class NET_EXPORT HostResolverCache final + } + + bool operator()(const Key& lhs, const KeyRef& rhs) const { ++ const std::string rhs_domain_name{rhs.domain_name}; + return std::tie(lhs.domain_name, lhs.network_anonymization_key) < +- std::tie(rhs.domain_name, *rhs.network_anonymization_key); ++ std::tie(rhs_domain_name, *rhs.network_anonymization_key); + } + + bool operator()(const KeyRef& lhs, const Key& rhs) const { +- return std::tie(lhs.domain_name, *lhs.network_anonymization_key) < ++ const std::string lhs_domain_name{lhs.domain_name}; ++ return std::tie(lhs_domain_name, *lhs.network_anonymization_key) < + std::tie(rhs.domain_name, rhs.network_anonymization_key); + } + }; diff --git a/chromium-116-typename.patch b/chromium-117-typename.patch similarity index 68% rename from chromium-116-typename.patch rename to chromium-117-typename.patch index c58126c6..af7da9f9 100644 --- a/chromium-116-typename.patch +++ b/chromium-117-typename.patch @@ -77,3 +77,42 @@ diff -up chromium-116.0.5845.50/third_party/blink/renderer/core/paint/object_pai NodeType::AnimationState()) { // First, check if we need to add a new node. if (!nodes.HasField(node_id)) { +diff -up chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h.me chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h +--- chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h.me 2023-09-15 10:22:51.889698402 +0200 ++++ chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h 2023-09-15 10:28:26.702716224 +0200 +@@ -234,7 +234,7 @@ class TFLiteModelExecutor : public Model + // Starts the synchronous execution of the model. Returns model outputs. + // Model needs to be loaded. Synchronous calls do not load or unload model. + std::vector> SendForBatchExecutionSync( +- ModelExecutor::ConstRefInputVector inputs) ++ typename ModelExecutor::ConstRefInputVector inputs) + override { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -389,7 +389,7 @@ class TFLiteModelExecutor : public Model + // executes it on the model execution thread. + void LoadModelFileAndBatchExecute( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs) { ++ typename ModelExecutor::ConstRefInputVector inputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + +@@ -406,7 +406,7 @@ class TFLiteModelExecutor : public Model + + // Batch executes the loaded model for inputs. + void BatchExecuteLoadedModel( +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + std::vector>* outputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -466,7 +466,7 @@ class TFLiteModelExecutor : public Model + // Unloads the model if needed. + void BatchExecuteLoadedModelAndRunCallback( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + ExecutionStatus execution_status) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); diff --git a/chromium.spec b/chromium.spec index 21eba31e..0ae9f25d 100644 --- a/chromium.spec +++ b/chromium.spec @@ -345,7 +345,7 @@ Patch301: chromium-115-compiler-SkColor4f.patch Patch302: chromium-117-workaround_clang_bug-structured_binding.patch # missing typename -Patch303: chromium-116-typename.patch +Patch303: chromium-117-typename.patch # missing include header files Patch304: chromium-117-missing-header-files.patch @@ -358,6 +358,9 @@ Patch306: chromium-117-emplace_back_on_vector-c++20.patch # error: fatal error: 'sys/ifunc.h' file not found Patch307: chromium-116-arm64-memory_tagging.patch +# compiler error, invalid operands to binary expression +Patch308: chromium-117-string-convert.patch + # clang warnings Patch311: chromium-115-clang-warnings.patch @@ -961,6 +964,7 @@ udev. %endif %endif +%patch -P308 -p1 -b .string-convert %patch -P311 -p1 -b .clang-warnings %patch -P312 -p1 -b .python-3.12-deprecated From 2bf7a249945f6c2f4701dbcf729f316b37076735 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 15 Sep 2023 14:45:10 +0200 Subject: [PATCH 3/3] fixed several compiler errors due to old clang version --- ...ium-117-emplace_back_on_vector-c++20.patch | 14 +++++ ...chromium-117-no_matching_constructor.patch | 54 +++++++++++++++++++ ...karound_clang_bug-structured_binding.patch | 27 ++++++++++ chromium.spec | 7 +-- 4 files changed, 99 insertions(+), 3 deletions(-) rename chromium-116-no_matching_constructor.patch => chromium-117-no_matching_constructor.patch (86%) diff --git a/chromium-117-emplace_back_on_vector-c++20.patch b/chromium-117-emplace_back_on_vector-c++20.patch index 3a3c1320..acac8781 100644 --- a/chromium-117-emplace_back_on_vector-c++20.patch +++ b/chromium-117-emplace_back_on_vector-c++20.patch @@ -58,3 +58,17 @@ diff -up chromium-117.0.5938.62/base/trace_event/trace_log.cc.me chromium-117.0. } void TraceLog::OnStart(const perfetto::DataSourceBase::StartArgs&) { +diff -up chromium-117.0.5938.62/content/browser/download/save_package.cc.me chromium-117.0.5938.62/content/browser/download/save_package.cc +--- chromium-117.0.5938.62/content/browser/download/save_package.cc.me 2023-09-15 12:02:43.866622591 +0200 ++++ chromium-117.0.5938.62/content/browser/download/save_package.cc 2023-09-15 12:03:58.715984511 +0200 +@@ -764,8 +764,8 @@ void SavePackage::Finish() { + if (download_) { + std::vector files; + for (auto& item : saved_success_items_) { +- files.emplace_back(item.second->full_path(), item.second->url(), +- item.second->referrer().url); ++ files.emplace_back() = {item.second->full_path(), item.second->url(), ++ item.second->referrer().url}; + } + download::DownloadSaveItemData::AttachItemData(download_, std::move(files)); + } diff --git a/chromium-116-no_matching_constructor.patch b/chromium-117-no_matching_constructor.patch similarity index 86% rename from chromium-116-no_matching_constructor.patch rename to chromium-117-no_matching_constructor.patch index 4c238fb2..76e70a3f 100644 --- a/chromium-116-no_matching_constructor.patch +++ b/chromium-117-no_matching_constructor.patch @@ -362,3 +362,57 @@ diff -up chromium-116.0.5845.50/chrome/browser/ui/omnibox/chrome_omnibox_client. if (browser_) { auto navigation = chrome::OpenCurrentURL(browser_); +diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.cc.me chromium-117.0.5938.62/net/dns/host_resolver_cache.cc +diff -up chromium-117.0.5938.62/third_party/blink/renderer/platform/fonts/font_palette.h.me chromium-117.0.5938.62/third_party/blink/renderer/platform/fonts/font_palette.h +--- chromium-117.0.5938.62/third_party/blink/renderer/platform/fonts/font_palette.h.me 2023-09-15 10:48:41.330294241 +0200 ++++ chromium-117.0.5938.62/third_party/blink/renderer/platform/fonts/font_palette.h 2023-09-15 10:51:24.501324416 +0200 +@@ -96,7 +96,7 @@ class PLATFORM_EXPORT FontPalette : publ + Color::ColorSpace color_interpolation_space, + absl::optional hue_interpolation_method) { + return base::AdoptRef(new FontPalette( +- start, end, NonNormalizedPercentages(start_percentage, end_percentage), ++ start, end, NonNormalizedPercentages{start_percentage, end_percentage}, + normalized_percentage, alpha_multiplier, color_interpolation_space, + hue_interpolation_method)); + } +@@ -170,7 +170,7 @@ class PLATFORM_EXPORT FontPalette : publ + double normalized_percentage) { + double end_percentage = normalized_percentage * 100.0; + double start_percentage = 100.0 - end_percentage; +- return NonNormalizedPercentages(start_percentage, end_percentage); ++ return NonNormalizedPercentages{start_percentage, end_percentage}; + } + + double GetAlphaMultiplier() const { +diff -up chromium-117.0.5938.62/content/browser/renderer_host/render_frame_host_impl.cc.me chromium-117.0.5938.62/content/browser/renderer_host/render_frame_host_impl.cc +--- chromium-117.0.5938.62/content/browser/renderer_host/render_frame_host_impl.cc.me 2023-09-15 12:17:35.664861257 +0200 ++++ chromium-117.0.5938.62/content/browser/renderer_host/render_frame_host_impl.cc 2023-09-15 12:21:06.112694256 +0200 +@@ -8509,7 +8509,7 @@ void RenderFrameHostImpl::SendFencedFram + for (const blink::FencedFrame::ReportingDestination& destination : + destinations) { + SendFencedFrameReportingBeaconInternal( +- DestinationEnumEvent(event_type, event_data), destination, ++ DestinationEnumEvent{event_type, event_data}, destination, + /*from_renderer=*/true, attribution_reporting_runtime_features, + GetFrameTreeNodeId()); + } +@@ -8545,7 +8545,7 @@ void RenderFrameHostImpl::SendFencedFram + } + + SendFencedFrameReportingBeaconInternal( +- DestinationURLEvent(destination_url), ++ DestinationURLEvent{destination_url}, + blink::FencedFrame::ReportingDestination::kBuyer, + /*from_renderer=*/true, attribution_reporting_runtime_features, + GetFrameTreeNodeId()); +@@ -8617,8 +8617,8 @@ void RenderFrameHostImpl::MaybeSendFence + for (blink::FencedFrame::ReportingDestination destination : + info->destinations) { + initiator_rfh->SendFencedFrameReportingBeaconInternal( +- DestinationEnumEvent(blink::kFencedFrameTopNavigationBeaconType, +- info->data), ++ DestinationEnumEvent{blink::kFencedFrameTopNavigationBeaconType, ++ info->data}, + destination, + /*from_renderer=*/false, info->attribution_reporting_runtime_features, + GetFrameTreeNodeId(), navigation_request.GetNavigationId()); diff --git a/chromium-117-workaround_clang_bug-structured_binding.patch b/chromium-117-workaround_clang_bug-structured_binding.patch index ddde8680..3b79f512 100644 --- a/chromium-117-workaround_clang_bug-structured_binding.patch +++ b/chromium-117-workaround_clang_bug-structured_binding.patch @@ -67,3 +67,30 @@ diff -up chromium-115.0.5790.32/content/browser/service_worker/service_worker_co DCHECK(document_url.is_valid()); TRACE_EVENT1("ServiceWorker", +diff -up chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +--- chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me 2023-09-15 13:03:00.787257048 +0200 ++++ chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-09-15 13:15:05.502706522 +0200 +@@ -3437,7 +3437,10 @@ void NGGridLayoutAlgorithm::PlaceGridIte + DCHECK(out_row_break_between); + + const auto& container_space = ConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); ++ const auto& [g_i, l_d, t_s] = sizing_tree.TreeRootData(); ++ const auto& grid_items = g_i; ++ const auto& layout_data = l_d; ++ const auto& tree_size = t_s; + + const auto* cached_layout_subtree = container_space.GridLayoutSubtree(); + const auto container_writing_direction = +@@ -3601,7 +3604,10 @@ void NGGridLayoutAlgorithm::PlaceGridIte + + // TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true. + const auto& constraint_space = ConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); ++ const auto& [g_i, l_d, t_s] = sizing_tree.TreeRootData(); ++ const auto& grid_items = g_i; ++ const auto& layout_data = l_d; ++ const auto& tree_size =t_s; + + const auto* cached_layout_subtree = constraint_space.GridLayoutSubtree(); + const auto container_writing_direction = diff --git a/chromium.spec b/chromium.spec index 0ae9f25d..3197d6cf 100644 --- a/chromium.spec +++ b/chromium.spec @@ -337,8 +337,9 @@ Patch117: chromium-108-ffmpeg-revert-new-channel-layout-api.patch # revert AV1 VAAPI video encode due to old libva on el9 Patch130: chromium-114-revert-av1enc-el9.patch -# compiler build errors -Patch300: chromium-116-no_matching_constructor.patch +# fixes for old clang version in fedora < 38 end epel +# compiler build errors, no matching constructor for initialization +Patch300: chromium-117-no_matching_constructor.patch Patch301: chromium-115-compiler-SkColor4f.patch # workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826 @@ -358,7 +359,7 @@ Patch306: chromium-117-emplace_back_on_vector-c++20.patch # error: fatal error: 'sys/ifunc.h' file not found Patch307: chromium-116-arm64-memory_tagging.patch -# compiler error, invalid operands to binary expression +# error: invalid operands to binary expression Patch308: chromium-117-string-convert.patch # clang warnings