From d0e5893874a5394bcf62cbb090dd7245a080c245 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Sat, 14 Sep 2019 17:06:52 +0200 Subject: [PATCH] Backport another GCC build fix --- ...mium-77.0.3865.75-gcc-abstract-class.patch | 61 +++++++++++++++++++ chromium.spec | 3 + 2 files changed, 64 insertions(+) create mode 100644 chromium-77.0.3865.75-gcc-abstract-class.patch diff --git a/chromium-77.0.3865.75-gcc-abstract-class.patch b/chromium-77.0.3865.75-gcc-abstract-class.patch new file mode 100644 index 00000000..6d77299e --- /dev/null +++ b/chromium-77.0.3865.75-gcc-abstract-class.patch @@ -0,0 +1,61 @@ +From f08cb0022527081c078e8b96062e6c9b4fbda151 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Fri, 26 Jul 2019 16:48:06 +0000 +Subject: [PATCH] BinaryUploadService: change parameter passing that cannot afford abstract class + +The method UploadForDeepScanning gets a Request as parameter. But Request is an +abstract class, so GCC will not allow that declaration (polimorphycs should be +passed by reference). Use std::unique_ptr so BinaryUploadService can assume +ownership. + +Bug: 819294 +Change-Id: I9e8c75cc92b01abd704d9049b0421555377da5ba +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713550 +Reviewed-by: Daniel Rubery +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/master@{#681333} +--- + +diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc +index 6430c89..4e90487 100644 +--- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc ++++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc +@@ -10,7 +10,7 @@ + namespace safe_browsing { + + void BinaryUploadService::UploadForDeepScanning( +- BinaryUploadService::Request request) { ++ std::unique_ptr request) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + NOTREACHED(); + } +diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h +index d2dfd83..9b6f395 100644 +--- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h ++++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h +@@ -5,6 +5,8 @@ + #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_ + #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_ + ++#include ++ + #include "base/callback.h" + #include "components/safe_browsing/proto/webprotect.pb.h" + +@@ -40,6 +42,7 @@ + public: + // |callback| will run on the UI thread. + explicit Request(Callback callback); ++ virtual ~Request() = default; + Request(const Request&) = delete; + Request& operator=(const Request&) = delete; + +@@ -67,7 +70,7 @@ + // Upload the given file contents for deep scanning. The results will be + // returned asynchronously by calling |request|'s |callback|. This must be + // called on the UI thread. +- void UploadForDeepScanning(Request request); ++ void UploadForDeepScanning(std::unique_ptr request); + }; + + } // namespace safe_browsing diff --git a/chromium.spec b/chromium.spec index 4a743466..625d74d4 100644 --- a/chromium.spec +++ b/chromium.spec @@ -279,6 +279,8 @@ Patch66: chromium-77.0.3865.75-gcc-include-memory.patch Patch67: chromium-77.0.3865.75-base-gcc-no-alignas.patch # https://chromium.googlesource.com/chromium/src/+/27e25336b8316ff3ec4e464058682ed85801fd06 Patch68: chromium-77.0.3865.75-harfbuzz-subset.patch +# https://chromium.googlesource.com/chromium/src.git/+/f08cb0022527081c078e8b96062e6c9b4fbda151 +Patch69: chromium-77.0.3865.75-gcc-abstract-class.patch # Apply these changes to work around EPEL7 compiler issues Patch100: chromium-62.0.3202.62-kmaxskip-constexpr.patch @@ -843,6 +845,7 @@ udev. %patch66 -p1 -b .gcc-include-memory %patch67 -p1 -b .base-gcc-no-alignas %patch68 -p1 -b .harfbuzz-subset +%patch69 -p1 -b .gcc-abstract-class # EPEL specific patches %if 0%{?rhel} == 7