diff --git a/chromium-99.0.4844.51-epel7-old-cups.patch b/chromium-99.0.4844.51-epel7-old-cups.patch new file mode 100644 index 00000000..ec0dedc9 --- /dev/null +++ b/chromium-99.0.4844.51-epel7-old-cups.patch @@ -0,0 +1,142 @@ +diff -up chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.cc +--- chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/cups_helper.cc 2022-03-05 15:17:45.516887985 -0500 +@@ -34,18 +34,6 @@ namespace printing { + // This section contains helper code for PPD parsing for semantic capabilities. + namespace { + +-// Function availability can be tested by checking whether its address is not +-// nullptr. Weak symbols remove the need for platform specific build flags and +-// allow for appropriate CUPS usage on platforms with non-uniform version +-// support, namely Linux. +-#define WEAK_CUPS_FN(x) extern "C" __attribute__((weak)) decltype(x) x +- +-WEAK_CUPS_FN(httpConnect2); +- +-// Timeout for establishing a CUPS connection. It is expected that cupsd is +-// able to start and respond on all systems within this duration. +-constexpr base::TimeDelta kCupsTimeout = base::Seconds(5); +- + // CUPS default max copies value (parsed from kCupsMaxCopies PPD attribute). + constexpr int32_t kDefaultMaxCopies = 9999; + constexpr char kCupsMaxCopies[] = "cupsMaxCopies"; +@@ -527,8 +515,7 @@ const int kDefaultIPPServerPort = 631; + // Helper wrapper around http_t structure, with connection and cleanup + // functionality. + HttpConnectionCUPS::HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking) ++ http_encryption_t encryption) + : http_(nullptr) { + // If we have an empty url, use default print server. + if (print_server_url.is_empty()) +@@ -538,17 +525,10 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + if (port == url::PORT_UNSPECIFIED) + port = kDefaultIPPServerPort; + +- if (httpConnect2) { +- http_ = httpConnect2(print_server_url.host().c_str(), port, +- /*addrlist=*/nullptr, AF_UNSPEC, encryption, +- blocking ? 1 : 0, kCupsTimeout.InMilliseconds(), +- /*cancel=*/nullptr); +- } else { +- // Continue to use deprecated CUPS calls because because older Linux +- // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. +- http_ = +- httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); +- } ++ // Continue to use deprecated CUPS calls because because older Linux ++ // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6. ++ http_ = ++ httpConnectEncrypt(print_server_url.host().c_str(), port, encryption); + + if (!http_) { + LOG(ERROR) << "CP_CUPS: Failed connecting to print server: " +@@ -556,8 +536,6 @@ HttpConnectionCUPS::HttpConnectionCUPS(c + return; + } + +- if (!httpConnect2) +- httpBlocking(http_, blocking ? 1 : 0); + } + + HttpConnectionCUPS::~HttpConnectionCUPS() { +@@ -565,6 +543,10 @@ HttpConnectionCUPS::~HttpConnectionCUPS( + httpClose(http_); + } + ++void HttpConnectionCUPS::SetBlocking(bool blocking) { ++ httpBlocking(http_, blocking ? 1 : 0); ++} ++ + http_t* HttpConnectionCUPS::http() { + return http_; + } +diff -up chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.h +--- chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/cups_helper.h 2022-03-05 15:17:45.517887991 -0500 +@@ -34,10 +34,11 @@ constexpr cups_ptype_t kDestinationsFilt + class COMPONENT_EXPORT(PRINT_BACKEND) HttpConnectionCUPS { + public: + HttpConnectionCUPS(const GURL& print_server_url, +- http_encryption_t encryption, +- bool blocking); ++ http_encryption_t encryption); + ~HttpConnectionCUPS(); + ++ void SetBlocking(bool blocking); ++ + http_t* http(); + + private: +diff -up chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups chromium-99.0.4844.51/printing/backend/print_backend_cups.cc +--- chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/printing/backend/print_backend_cups.cc 2022-03-05 15:17:45.517887991 -0500 +@@ -146,7 +146,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // not showing as available. Using cupsEnumDests() allows us to do our own + // filtering should any duplicates occur. + CupsDestsData dests_data = {0, nullptr}; +- ipp_status_t last_error = IPP_STATUS_OK; ++ ipp_status_t last_error = IPP_OK; + if (print_server_url_.is_empty()) { + VLOG(1) << "CUPS: using cupsEnumDests to enumerate printers"; + if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, kCupsTimeoutMs, +@@ -173,7 +173,7 @@ mojom::ResultCode PrintBackendCUPS::Enum + // no printer drivers installed. Rely upon CUPS error code to distinguish + // between these. + DCHECK(!dests_data.dests); +- if (last_error != IPP_STATUS_ERROR_NOT_FOUND) { ++ if (last_error != IPP_NOT_FOUND) { + VLOG(1) << "CUPS: Error getting printers from CUPS server" + << ", server: " << print_server_url_ + << ", error: " << static_cast(last_error) << " - " +@@ -336,7 +336,8 @@ int PrintBackendCUPS::GetDests(cups_dest + if (print_server_url_.is_empty()) + return cupsGetDests2(CUPS_HTTP_DEFAULT, dests); + +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + + // This call must be made in the same scope as `http` because its destructor + // closes the connection. +@@ -362,7 +363,8 @@ base::FilePath PrintBackendCUPS::GetPPD( + // connection will timeout after 10 seconds of no data period. And it will + // return the same way as if data was completely and successfully + // downloaded. +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + ppd_file_path = cupsGetPPD2(http.http(), name); + // Check if the get full PPD, since non-blocking call may simply return + // normally after timeout expired. +@@ -398,7 +400,8 @@ PrintBackendCUPS::ScopedDestination Prin + // Use default (local) print server. + dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr); + } else { +- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_); ++ HttpConnectionCUPS http(print_server_url_, cups_encryption_); ++ http.SetBlocking(blocking_); + dest = cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr); + } + return ScopedDestination(dest); diff --git a/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch b/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch new file mode 100644 index 00000000..1da00cf9 --- /dev/null +++ b/chromium-99.0.4844.51-epel7-old-headers-workarounds.patch @@ -0,0 +1,127 @@ +diff -up chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/mojo/core/channel_linux.cc +--- chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds 2022-02-28 19:05:54.000000000 -0500 ++++ chromium-99.0.4844.51/mojo/core/channel_linux.cc 2022-03-05 14:50:49.876812909 -0500 +@@ -44,6 +44,25 @@ + #include "base/android/build_info.h" + #endif + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #ifndef EFD_ZERO_ON_WAKE + #define EFD_ZERO_ON_WAKE O_NOFOLLOW + #endif +diff -up chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +--- chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds 2022-03-05 14:50:49.877812915 -0500 ++++ chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2022-03-05 15:15:02.536867009 -0500 +@@ -53,6 +53,25 @@ + + #endif // BUILDFLAG(IS_ANDROID) + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++#ifndef F_GET_SEALS ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++#endif ++ + #if defined(__arm__) && !defined(MAP_STACK) + #define MAP_STACK 0x20000 // Daisy build environment has old headers. + #endif +diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -6,7 +6,24 @@ + + #include + #include +-#include ++#ifndef KCMP_FILE ++#define KCMP_FILE 0 ++#endif ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif + #include + + // Some arch's (arm64 for instance) unistd.h don't pull in symbols used here +diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc +--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500 ++++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -22,6 +22,22 @@ + #include "sandbox/policy/linux/sandbox_linux.h" + #include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h" + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++#ifndef F_SEAL_SEAL ++#define F_SEAL_SEAL 0x0001 ++#endif ++#ifndef F_SEAL_SHRINK ++#define F_SEAL_SHRINK 0x0002 ++#endif ++#ifndef F_SEAL_GROW ++#define F_SEAL_GROW 0x0004 ++#endif ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#endif ++ + using sandbox::bpf_dsl::AllOf; + using sandbox::bpf_dsl::Allow; + using sandbox::bpf_dsl::Arg; +diff -up chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc +--- chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds 2022-02-28 19:06:49.000000000 -0500 ++++ chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc 2022-03-05 14:50:49.877812915 -0500 +@@ -23,6 +23,10 @@ + #include "ui/events/ozone/evdev/numberpad_metrics.h" + #endif + ++#ifndef SW_PEN_INSERTED ++#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ ++#endif ++ + namespace ui { + + namespace { diff --git a/chromium.spec b/chromium.spec index 42679153..55592913 100644 --- a/chromium.spec +++ b/chromium.spec @@ -329,10 +329,10 @@ Patch101: chromium-75.0.3770.100-epel7-stdc++.patch # el7 only patch Patch102: chromium-80.0.3987.132-el7-noexcept.patch # Work around old and missing headers on EPEL7 -Patch103: chromium-98.0.4758.80-epel7-old-headers-workarounds.patch +Patch103: chromium-99.0.4844.51-epel7-old-headers-workarounds.patch # Use old cups (chromium's code workaround breaks on gcc) # Revert: https://github.com/chromium/chromium/commit/c3213f8779ddc427e89d982514185ed5e4c94e91 -Patch104: chromium-98.0.4758.80-epel7-old-cups.patch +Patch104: chromium-99.0.4844.51-epel7-old-cups.patch # Still not wrong, but it seems like only EL needs it Patch106: chromium-77-clang.patch # ARM failures on el8 related to int clashes