diff --git a/.firefox.metadata b/.firefox.metadata index 96be813..8c8247f 100644 --- a/.firefox.metadata +++ b/.firefox.metadata @@ -1,10 +1,11 @@ 18a8f30a0356c751b8d0ea6f76e764cab13ee046 SOURCES/Python-2.7.13.tar.xz -ee55acedef049268307633cbc9c7ff0610d1244f SOURCES/Python-3.6.8.tar.xz -a4850bfd09fbdf8c64f4dc50a4b64422a2fcc023 SOURCES/cbindgen-vendor.tar.xz -976fae5c3cdee8b7929e4f17eca6cf44513d08b4 SOURCES/firefox-68.12.0esr.source.tar.xz -bac006a6f4785f01c09dfed17c495007110f8269 SOURCES/firefox-langpacks-68.12.0esr-20200820.tar.xz +a9effcc06cf80eaa22f12c1f7d6aa4266a1c4966 SOURCES/cbindgen-vendor-0.14.3.tar.xz +f2e0607bf57105e8741c0f941bcacee8a75d672a SOURCES/firefox-78.3.0esr.source.tar.xz +444ca305428fc4778a7252f3cdc2e65495921dcd SOURCES/firefox-langpacks-78.3.0esr-20200918.tar.xz 0de63f863b158454b9429234b52ed28a397ec45c SOURCES/gtk3-private-3.22.26-1.el6.src.rpm e188ab1a444697bc649e223c28389d82ca94c472 SOURCES/libffi-3.0.13-18.el7_3.src.rpm -4f8d3bf2483d95261ff90742ecec82d6a899eca3 SOURCES/nodejs-8.11.4-1.3.fc27.src.rpm +5715f987bc0024ce5d72993cb101b8268350033b SOURCES/nodejs-10.21.0-5.fc32.src.rpm +07d67c90367c3ec0d6cebc1a5793c21076d34b78 SOURCES/nspr-4.25.0-1.el8_0.src.rpm +223c02166b1cb9863b9f453ef687d7805a93e7af SOURCES/nss-3.53.1-3.fc32.src.rpm a379070abf5000cde61411c97af7e733b267a4d3 SOURCES/openssl-1.0.2k-19.6.bundle.el7_7.src.rpm 77fd30f7ebc12a629a31c1e252cec06af55a71fe SOURCES/yasm-1.2.0-3.el5.src.rpm diff --git a/.gitignore b/.gitignore index d245eff..683a467 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ SOURCES/Python-2.7.13.tar.xz -SOURCES/Python-3.6.8.tar.xz -SOURCES/cbindgen-vendor.tar.xz -SOURCES/firefox-68.12.0esr.source.tar.xz -SOURCES/firefox-langpacks-68.12.0esr-20200820.tar.xz +SOURCES/cbindgen-vendor-0.14.3.tar.xz +SOURCES/firefox-78.3.0esr.source.tar.xz +SOURCES/firefox-langpacks-78.3.0esr-20200918.tar.xz SOURCES/gtk3-private-3.22.26-1.el6.src.rpm SOURCES/libffi-3.0.13-18.el7_3.src.rpm -SOURCES/nodejs-8.11.4-1.3.fc27.src.rpm +SOURCES/nodejs-10.21.0-5.fc32.src.rpm +SOURCES/nspr-4.25.0-1.el8_0.src.rpm +SOURCES/nss-3.53.1-3.fc32.src.rpm SOURCES/openssl-1.0.2k-19.6.bundle.el7_7.src.rpm SOURCES/yasm-1.2.0-3.el5.src.rpm diff --git a/README.debrand b/README.debrand deleted file mode 100644 index 01c46d2..0000000 --- a/README.debrand +++ /dev/null @@ -1,2 +0,0 @@ -Warning: This package was configured for automatic debranding, but the changes -failed to apply. diff --git a/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch b/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch deleted file mode 100644 index 6dfe2ad..0000000 --- a/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 firefox-60.0/mfbt/LinuxSignal.h ---- firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 2018-04-27 08:55:38.848241768 +0200 -+++ firefox-60.0/mfbt/LinuxSignal.h 2018-04-27 09:06:47.946769859 +0200 -@@ -22,7 +22,7 @@ __attribute__((naked)) void SignalTrampo - void* aContext) { - asm volatile("nop; nop; nop; nop" : : : "memory"); - -- asm volatile("b %0" : : "X"(H) : "memory"); -+ asm volatile("bx %0" : : "r"(H), "l"(aSignal), "l"(aInfo), "l"(aContext) : "memory"); - } - - # define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline) diff --git a/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch b/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch deleted file mode 100644 index 3f84f95..0000000 --- a/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch +++ /dev/null @@ -1,35 +0,0 @@ -From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001 -From: Mike Hommey -Date: Sat, 1 Jun 2019 09:06:01 +0900 -Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and - user_vfp_exc. - ---- - js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp -index 636537f8478..383c380f04c 100644 ---- a/js/src/wasm/WasmSignalHandlers.cpp -+++ b/js/src/wasm/WasmSignalHandlers.cpp -@@ -248,7 +248,16 @@ using mozilla::DebugOnly; - #endif - - #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS --# include -+struct user_vfp { -+ unsigned long long fpregs[32]; -+ unsigned long fpscr; -+}; -+ -+struct user_vfp_exc { -+ unsigned long fpexc; -+ unsigned long fpinst; -+ unsigned long fpinst2; -+}; - #endif - - #if defined(ANDROID) --- -2.20.1 - diff --git a/SOURCES/D87019-thin-vec-big-endian.diff b/SOURCES/D87019-thin-vec-big-endian.diff new file mode 100644 index 0000000..bc8589b --- /dev/null +++ b/SOURCES/D87019-thin-vec-big-endian.diff @@ -0,0 +1,767 @@ +diff -up firefox-78.1.0/Cargo.lock.D87019-thin-vec-big-endian.diff firefox-78.1.0/Cargo.lock +--- firefox-78.1.0/Cargo.lock.D87019-thin-vec-big-endian.diff 2020-07-22 19:56:54.000000000 +0200 ++++ firefox-78.1.0/Cargo.lock 2020-08-17 17:04:24.133598583 +0200 +@@ -4792,12 +4792,9 @@ checksum = "8eaa81235c7058867fa8c0e7314f + + [[package]] + name = "thin-vec" +-version = "0.1.0" ++version = "0.2.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "73fdf4b84c65a85168477b7fb6c498e0716bc9487fba24623389ea7f51708044" +-dependencies = [ +- "libc", +-] ++checksum = "dcc760ada4a9f56fc6d0e81bd143984ebc7bb1b875a6891aa2fa613ca7394fc0" + + [[package]] + name = "thiserror" +diff -up firefox-78.1.0/gfx/webrender_bindings/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/gfx/webrender_bindings/Cargo.toml +--- firefox-78.1.0/gfx/webrender_bindings/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-08-17 17:04:24.133598583 +0200 ++++ firefox-78.1.0/gfx/webrender_bindings/Cargo.toml 2020-08-17 17:05:26.984805590 +0200 +@@ -20,7 +20,7 @@ nsstring = { path = "../../xpcom/rust/ns + bincode = "1.0" + uuid = { version = "0.8", features = ["v4"] } + fxhash = "0.2.1" +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + swgl = { path = "../wr/swgl" } + + [dependencies.webrender] +diff -up firefox-78.1.0/intl/l10n/rust/fluent-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/intl/l10n/rust/fluent-ffi/Cargo.toml +--- firefox-78.1.0/intl/l10n/rust/fluent-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:20.000000000 +0200 ++++ firefox-78.1.0/intl/l10n/rust/fluent-ffi/Cargo.toml 2020-08-17 17:04:24.134598587 +0200 +@@ -10,4 +10,4 @@ fluent-pseudo = "0.2" + intl-memoizer = "0.4" + unic-langid = "0.8" + nsstring = { path = "../../../../xpcom/rust/nsstring" } +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } +diff -up firefox-78.1.0/intl/locale/rust/fluent-langneg-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/intl/locale/rust/fluent-langneg-ffi/Cargo.toml +--- firefox-78.1.0/intl/locale/rust/fluent-langneg-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:20.000000000 +0200 ++++ firefox-78.1.0/intl/locale/rust/fluent-langneg-ffi/Cargo.toml 2020-08-17 17:04:24.134598587 +0200 +@@ -9,7 +9,7 @@ edition = "2018" + nserror = { path = "../../../../xpcom/rust/nserror" } + nsstring = { path = "../../../../xpcom/rust/nsstring" } + xpcom = { path = "../../../../xpcom/rust/xpcom" } +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + fluent-langneg = { version = "0.12.1", features = ["cldr"] } + unic-langid = "0.8" + unic-langid-ffi = { path = "../unic-langid-ffi" } +diff -up firefox-78.1.0/intl/locale/rust/unic-langid-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/intl/locale/rust/unic-langid-ffi/Cargo.toml +--- firefox-78.1.0/intl/locale/rust/unic-langid-ffi/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:20.000000000 +0200 ++++ firefox-78.1.0/intl/locale/rust/unic-langid-ffi/Cargo.toml 2020-08-17 17:04:24.134598587 +0200 +@@ -9,5 +9,5 @@ edition = "2018" + nserror = { path = "../../../../xpcom/rust/nserror" } + nsstring = { path = "../../../../xpcom/rust/nsstring" } + xpcom = { path = "../../../../xpcom/rust/xpcom" } +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + unic-langid = { version = "0.8", features = ["likelysubtags"] } +diff -up firefox-78.1.0/netwerk/socket/neqo_glue/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/netwerk/socket/neqo_glue/Cargo.toml +--- firefox-78.1.0/netwerk/socket/neqo_glue/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-08-17 17:04:24.134598587 +0200 ++++ firefox-78.1.0/netwerk/socket/neqo_glue/Cargo.toml 2020-08-17 17:05:10.352750807 +0200 +@@ -14,7 +14,7 @@ neqo-common = { tag = "v0.2.4", git = "h + nserror = { path = "../../../xpcom/rust/nserror" } + nsstring = { path = "../../../xpcom/rust/nsstring" } + xpcom = { path = "../../../xpcom/rust/xpcom" } +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + + [dependencies.neqo-crypto] + tag = "v0.2.4" +diff -up firefox-78.1.0/security/manager/ssl/cert_storage/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/security/manager/ssl/cert_storage/Cargo.toml +--- firefox-78.1.0/security/manager/ssl/cert_storage/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 19:56:55.000000000 +0200 ++++ firefox-78.1.0/security/manager/ssl/cert_storage/Cargo.toml 2020-08-17 17:04:24.134598587 +0200 +@@ -18,6 +18,6 @@ rust_cascade = "0.6.0" + sha2 = "^0.8" + storage_variant = { path = "../../../../storage/variant" } + tempfile = "3" +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + time = "0.1" + xpcom = { path = "../../../../xpcom/rust/xpcom" } +diff -up firefox-78.1.0/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml +--- firefox-78.1.0/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-08-17 17:04:24.134598587 +0200 ++++ firefox-78.1.0/services/fxaccounts/rust-bridge/firefox-accounts-bridge/Cargo.toml 2020-08-17 17:04:52.432691786 +0200 +@@ -20,5 +20,5 @@ nserror = { path = "../../../../xpcom/ru + nsstring = { path = "../../../../xpcom/rust/nsstring" } + xpcom = { path = "../../../../xpcom/rust/xpcom" } + storage_variant = { path = "../../../../storage/variant" } +-thin-vec = { version = "0.1", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + fxa-client = { git = "https://github.com/mozilla/application-services", rev = "61dcc364ac0d6d0816ab88a494bbf20d824b009b", features = ["gecko"] } +diff -up firefox-78.1.0/services/sync/golden_gate/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/services/sync/golden_gate/Cargo.toml +--- firefox-78.1.0/services/sync/golden_gate/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:24.000000000 +0200 ++++ firefox-78.1.0/services/sync/golden_gate/Cargo.toml 2020-08-17 17:04:24.134598587 +0200 +@@ -19,5 +19,5 @@ sync15-traits = { git = "https://github. + xpcom = { path = "../../../xpcom/rust/xpcom" } + + [dependencies.thin-vec] +-version = "0.1.0" ++version = "0.2.1" + features = ["gecko-ffi"] +diff -up firefox-78.1.0/third_party/rust/thin-vec/.cargo-checksum.json.D87019-thin-vec-big-endian.diff firefox-78.1.0/third_party/rust/thin-vec/.cargo-checksum.json +--- firefox-78.1.0/third_party/rust/thin-vec/.cargo-checksum.json.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:29.000000000 +0200 ++++ firefox-78.1.0/third_party/rust/thin-vec/.cargo-checksum.json 2020-08-17 17:04:24.134598587 +0200 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"fb96cad605ae48215811808c1cc1b9a50248f2b14542058094b23983e2f8d8a0","README.md":"c26d7101e3031e7dd8890ce938e50cad7a1e6adf7fc2f2b0d3c36b03afe68c0b","src/heap.rs":"fe84a4ff433568d5713685456d87597ac5dcdb9d5190061a3da8074240ba1bc3","src/lib.rs":"ce36db8e3464dddade7c1ddbe3ee1f5e525af5be492ea51a0d8a0776c1adfc28","src/range.rs":"bac59bcb6230367a39c7e28ac15263e4526f966cd8c72015873017f17c115aaa"},"package":"73fdf4b84c65a85168477b7fb6c498e0716bc9487fba24623389ea7f51708044"} +\ No newline at end of file ++{"files":{"Cargo.toml":"754c05523d17eb7591c3ea2c9294e47c05fbb257fed04b78546fb2ec7cafa8b4","README.md":"c26d7101e3031e7dd8890ce938e50cad7a1e6adf7fc2f2b0d3c36b03afe68c0b","src/lib.rs":"627c6094c3f0286dba25bc73f5672c06c5061c25b01c513d213cbdda100673a2"},"package":"dcc760ada4a9f56fc6d0e81bd143984ebc7bb1b875a6891aa2fa613ca7394fc0"} +\ No newline at end of file +diff -up firefox-78.1.0/third_party/rust/thin-vec/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/third_party/rust/thin-vec/Cargo.toml +--- firefox-78.1.0/third_party/rust/thin-vec/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:29.000000000 +0200 ++++ firefox-78.1.0/third_party/rust/thin-vec/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -3,7 +3,7 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g. crates.io) dependencies ++# to registry (e.g., crates.io) dependencies + # + # If you believe there's an error in this file please file an + # issue against the rust-lang/cargo repository. If you're +@@ -11,16 +11,17 @@ + # will likely look very different (and much more reasonable) + + [package] ++edition = "2018" + name = "thin-vec" +-version = "0.1.0" ++version = "0.2.1" + authors = ["Alexis Beingessner "] + description = "a vec that takes up less space on the stack" + homepage = "https://github.com/gankro/thin-vec" + readme = "README.md" + license = "MIT/Apache-2.0" + repository = "https://github.com/gankro/thin-vec" +-[dependencies.libc] +-version = "0.2" ++ ++[dependencies] + + [features] + default = [] +diff -up firefox-78.1.0/third_party/rust/thin-vec/src/heap.rs.D87019-thin-vec-big-endian.diff firefox-78.1.0/third_party/rust/thin-vec/src/heap.rs +diff -up firefox-78.1.0/third_party/rust/thin-vec/src/lib.rs.D87019-thin-vec-big-endian.diff firefox-78.1.0/third_party/rust/thin-vec/src/lib.rs +--- firefox-78.1.0/third_party/rust/thin-vec/src/lib.rs.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:28.000000000 +0200 ++++ firefox-78.1.0/third_party/rust/thin-vec/src/lib.rs 2020-08-17 17:04:24.135598590 +0200 +@@ -1,50 +1,252 @@ +-mod range; ++//! ThinVec is exactly the same as Vec, except that it stores its `len` and `capacity` in the buffer ++//! it allocates. ++//! ++//! This makes the memory footprint of ThinVecs lower; notably in cases where space is reserved for ++//! a non-existence ThinVec. So `Vec>` and `Option>::None` will waste less ++//! space. Being pointer-sized also means it can be passed/stored in registers. ++//! ++//! Of course, any actually constructed ThinVec will theoretically have a bigger allocation, but ++//! the fuzzy nature of allocators means that might not actually be the case. ++//! ++//! Properties of Vec that are preserved: ++//! * `ThinVec::new()` doesn't allocate (it points to a statically allocated singleton) ++//! * reallocation can be done in place ++//! * `size_of::>()` == `size_of::>>()` ++//! ++//! Properties of Vec that aren't preserved: ++//! * `ThinVec` can't ever be zero-cost roundtripped to a `Box<[T]>`, `String`, or `*mut T` ++//! * `from_raw_parts` doesn't exist ++//! * ThinVec currently doesn't bother to not-allocate for Zero Sized Types (e.g. `ThinVec<()>`), ++//! but it could be done if someone cared enough to implement it. ++//! ++//! ++//! ++//! # Gecko FFI ++//! ++//! If you enable the gecko-ffi feature, ThinVec will verbatim bridge with the nsTArray type in ++//! Gecko (Firefox). That is, ThinVec and nsTArray have identical layouts *but not ABIs*, ++//! so nsTArrays/ThinVecs an be natively manipulated by C++ and Rust, and ownership can be ++//! transferred across the FFI boundary (**IF YOU ARE CAREFUL, SEE BELOW!!**). ++//! ++//! While this feature is handy, it is also inherently dangerous to use because Rust and C++ do not ++//! know about eachother. Specifically, this can be an issue with non-POD types (types which ++//! have destructors, move constructors, or are `!Copy`). ++//! ++//! ## Do Not Pass By Value ++//! ++//! The biggest thing to keep in mind is that **FFI functions cannot pass ThinVec/nsTArray ++//! by-value**. That is, these are busted APIs: ++//! ++//! ```rust,ignore ++//! // BAD WRONG ++//! extern fn process_data(data: ThinVec) { ... } ++//! // BAD WRONG ++//! extern fn get_data() -> ThinVec { ... } ++//! ``` ++//! ++//! You must instead pass by-reference: ++//! ++//! ```rust ++//! # use thin_vec::*; ++//! # use std::mem; ++//! ++//! // Read-only access, ok! ++//! extern fn process_data(data: &ThinVec) { ++//! for val in data { ++//! println!("{}", val); ++//! } ++//! } ++//! ++//! // Replace with empty instance to take ownership, ok! ++//! extern fn consume_data(data: &mut ThinVec) { ++//! let owned = mem::replace(data, ThinVec::new()); ++//! mem::drop(owned); ++//! } ++//! ++//! // Mutate input, ok! ++//! extern fn add_data(dataset: &mut ThinVec) { ++//! dataset.push(37); ++//! dataset.push(12); ++//! } ++//! ++//! // Return via out-param, usually ok! ++//! // ++//! // WARNING: output must be initialized! (Empty nsTArrays are free, so just do it!) ++//! extern fn get_data(output: &mut ThinVec) { ++//! *output = thin_vec![1, 2, 3, 4, 5]; ++//! } ++//! ``` ++//! ++//! Ignorable Explanation For Those Who Really Want To Know Why: ++//! ++//! > The fundamental issue is that Rust and C++ can't currently communicate about destructors, and ++//! > the semantics of C++ require destructors of function arguments to be run when the function ++//! > returns. Whether the callee or caller is responsible for this is also platform-specific, so ++//! > trying to hack around it manually would be messy. ++//! > ++//! > Also a type having a destructor changes its C++ ABI, because that type must actually exist ++//! > in memory (unlike a trivial struct, which is often passed in registers). We don't currently ++//! > have a way to communicate to Rust that this is happening, so even if we worked out the ++//! > destructor issue with say, MaybeUninit, it would still be a non-starter without some RFCs ++//! > to add explicit rustc support. ++//! > ++//! > Realistically, the best answer here is to have a "heavier" bindgen that can secretly ++//! > generate FFI glue so we can pass things "by value" and have it generate by-reference code ++//! > behind our back (like the cxx crate does). This would muddy up debugging/searchfox though. ++//! ++//! ## Types Should Be Trivially Relocatable ++//! ++//! Types in Rust are always trivially relocatable (unless suitably borrowed/[pinned][]/hidden). ++//! This means all Rust types are legal to relocate with a bitwise copy, you cannot provide ++//! copy or move constructors to execute when this happens, and the old location won't have its ++//! destructor run. This will cause problems for types which have a significant location ++//! (types that intrusively point into themselves or have their location registered with a service). ++//! ++//! While relocations are generally predictable if you're very careful, **you should avoid using ++//! types with significant locations with Rust FFI**. ++//! ++//! Specifically, ThinVec will trivially relocate its contents whenever it needs to reallocate its ++//! buffer to change its capacity. This is the default reallocation strategy for nsTArray, and is ++//! suitable for the vast majority of types. Just be aware of this limitation! ++//! ++//! ## Auto Arrays Are Dangerous ++//! ++//! ThinVec has *some* support for handling auto arrays which store their buffer on the stack, ++//! but this isn't well tested. ++//! ++//! Regardless of how much support we provide, Rust won't be aware of the buffer's limited lifetime, ++//! so standard auto array safety caveats apply about returning/storing them! ThinVec won't ever ++//! produce an auto array on its own, so this is only an issue for transferring an nsTArray into ++//! Rust. ++//! ++//! ## Other Issues ++//! ++//! Standard FFI caveats also apply: ++//! ++//! * Rust is more strict about POD types being initialized (use MaybeUninit if you must) ++//! * `ThinVec` has no idea if the C++ version of `T` has move/copy/assign/delete overloads ++//! * `nsTArray` has no idea if the Rust version of `T` has a Drop/Clone impl ++//! * C++ can do all sorts of unsound things that Rust can't catch ++//! * C++ and Rust don't agree on how zero-sized/empty types should be handled ++//! ++//! The gecko-ffi feature will not work if you aren't linking with code that has nsTArray ++//! defined. Specifically, we must share the symbol for nsTArray's empty singleton. You will get ++//! linking errors if that isn't defined. ++//! ++//! The gecko-ffi feature also limits ThinVec to the legacy behaviors of nsTArray. Most notably, ++//! nsTArray has a maximum capacity of i32::MAX (~2.1 billion items). Probably not an issue. ++//! Probably. ++//! ++//! [pinned]: https://doc.rust-lang.org/std/pin/index.html + + use std::{fmt, io, ptr, mem, slice}; + use std::collections::Bound; + use std::iter::FromIterator; + use std::slice::IterMut; +-use std::ops::{Deref, DerefMut}; ++use std::ops::{Deref, DerefMut, RangeBounds}; + use std::marker::PhantomData; ++use std::alloc::*; + use std::cmp::*; + use std::hash::*; + use std::borrow::*; +-use range::RangeArgument; + use std::ptr::NonNull; + +-// Heap shimming because reasons. This doesn't unfortunately match the heap api +-// right now because reasons. +-mod heap; ++use impl_details::*; + +-#[cfg(not(feature = "gecko-ffi"))] +-type SizeType = usize; +-#[cfg(feature = "gecko-ffi")] +-type SizeType = u32; +- +-#[cfg(feature = "gecko-ffi")] +-const AUTO_MASK: u32 = 1 << 31; +-#[cfg(feature = "gecko-ffi")] +-const CAP_MASK: u32 = !AUTO_MASK; ++// modules: a simple way to cfg a whole bunch of impl details at once + + #[cfg(not(feature = "gecko-ffi"))] +-const MAX_CAP: usize = !0; +-#[cfg(feature = "gecko-ffi")] +-const MAX_CAP: usize = i32::max_value() as usize; ++mod impl_details { ++ pub type SizeType = usize; ++ pub const MAX_CAP: usize = !0; + +-#[cfg(not(feature = "gecko-ffi"))] +-#[inline(always)] +-fn assert_size(x: usize) -> SizeType { x } ++ #[inline(always)] ++ pub fn assert_size(x: usize) -> SizeType { x } ++} + + #[cfg(feature = "gecko-ffi")] +-#[inline] +-fn assert_size(x: usize) -> SizeType { +- if x > MAX_CAP as usize { +- panic!("nsTArray size may not exceed the capacity of a 32-bit sized int"); ++mod impl_details { ++ // Support for briding a gecko nsTArray verbatim into a ThinVec. ++ // ++ // ThinVec can't see copy/move/delete implementations ++ // from C++ ++ // ++ // The actual layout of an nsTArray is: ++ // ++ // ```cpp ++ // struct { ++ // uint32_t mLength; ++ // uint32_t mCapacity: 31; ++ // uint32_t mIsAutoArray: 1; ++ // } ++ // ``` ++ // ++ // Rust doesn't natively support bit-fields, so we manually mask ++ // and shift the bit. When the "auto" bit is set, the header and buffer ++ // are actually on the stack, meaning the ThinVec pointer-to-header ++ // is essentially an "owned borrow", and therefore dangerous to handle. ++ // There are no safety guards for this situation. ++ // ++ // On little-endian platforms, the auto bit will be the high-bit of ++ // our capacity u32. On big-endian platforms, it will be the low bit. ++ // Hence we need some platform-specific CFGs for the necessary masking/shifting. ++ // ++ // ThinVec won't ever construct an auto array. They only happen when ++ // bridging from C++. This means we don't need to ever set/preserve the bit. ++ // We just need to be able to read and handle it if it happens to be there. ++ // ++ // Handling the auto bit mostly just means not freeing/reallocating the buffer. ++ ++ pub type SizeType = u32; ++ ++ pub const MAX_CAP: usize = i32::max_value() as usize; ++ ++ // Little endian: the auto bit is the high bit, and the capacity is ++ // verbatim. So we just need to mask off the high bit. Note that ++ // this masking is unnecessary when packing, because assert_size ++ // guards against the high bit being set. ++ #[cfg(target_endian = "little")] ++ pub fn pack_capacity(cap: SizeType) -> SizeType { ++ cap as SizeType ++ } ++ #[cfg(target_endian = "little")] ++ pub fn unpack_capacity(cap: SizeType) -> usize { ++ (cap as usize) & !(1 << 31) ++ } ++ #[cfg(target_endian = "little")] ++ pub fn is_auto(cap: SizeType) -> bool { ++ (cap & (1 << 31)) != 0 ++ } ++ ++ // Big endian: the auto bit is the low bit, and the capacity is ++ // shifted up one bit. Masking out the auto bit is unnecessary, ++ // as rust shifts always shift in 0's for unsigned integers. ++ #[cfg(target_endian = "big")] ++ pub fn pack_capacity(cap: SizeType) -> SizeType { ++ (cap as SizeType) << 1 ++ } ++ #[cfg(target_endian = "big")] ++ pub fn unpack_capacity(cap: SizeType) -> usize { ++ (cap >> 1) as usize ++ } ++ #[cfg(target_endian = "big")] ++ pub fn is_auto(cap: SizeType) -> bool { ++ (cap & 1) != 0 ++ } ++ ++ #[inline] ++ pub fn assert_size(x: usize) -> SizeType { ++ if x > MAX_CAP as usize { ++ panic!("nsTArray size may not exceed the capacity of a 32-bit sized int"); ++ } ++ x as SizeType + } +- x as SizeType ++ + } + +-/// The header of a ThinVec ++/// The header of a ThinVec. ++/// ++/// The _cap can be a bitfield, so use accessors to avoid trouble. + #[repr(C)] + struct Header { + _len: SizeType, +@@ -56,38 +258,10 @@ impl Header { + self._len as usize + } + +- #[cfg(feature = "gecko-ffi")] +- fn cap(&self) -> usize { +- (self._cap & CAP_MASK) as usize +- } +- +- #[cfg(not(feature = "gecko-ffi"))] +- fn cap(&self) -> usize { +- self._cap as usize +- } +- + fn set_len(&mut self, len: usize) { + self._len = assert_size(len); + } + +- #[cfg(feature = "gecko-ffi")] +- fn set_cap(&mut self, cap: usize) { +- debug_assert!(cap & (CAP_MASK as usize) == cap); +- // FIXME: this is busted because it reads uninit memory +- // debug_assert!(!self.uses_stack_allocated_buffer()); +- self._cap = assert_size(cap) & CAP_MASK; +- } +- +- #[cfg(feature = "gecko-ffi")] +- fn uses_stack_allocated_buffer(&self) -> bool { +- self._cap & AUTO_MASK != 0 +- } +- +- #[cfg(not(feature = "gecko-ffi"))] +- fn set_cap(&mut self, cap: usize) { +- self._cap = assert_size(cap); +- } +- + fn data(&self) -> *mut T { + let header_size = mem::size_of::
(); + let padding = padding::(); +@@ -105,6 +279,41 @@ impl Header { + } + } + ++ ++#[cfg(feature = "gecko-ffi")] ++impl Header { ++ fn cap(&self) -> usize { ++ unpack_capacity(self._cap) ++ } ++ ++ fn set_cap(&mut self, cap: usize) { ++ // debug check that our packing is working ++ debug_assert_eq!(unpack_capacity(pack_capacity(cap as SizeType)), cap); ++ // FIXME: this assert is busted because it reads uninit memory ++ // debug_assert!(!self.uses_stack_allocated_buffer()); ++ ++ // NOTE: this always stores a cleared auto bit, because set_cap ++ // is only invoked by Rust, and Rust doesn't create auto arrays. ++ self._cap = pack_capacity(assert_size(cap)); ++ } ++ ++ fn uses_stack_allocated_buffer(&self) -> bool { ++ is_auto(self._cap) ++ } ++} ++ ++#[cfg(not(feature = "gecko-ffi"))] ++impl Header { ++ fn cap(&self) -> usize { ++ self._cap as usize ++ } ++ ++ fn set_cap(&mut self, cap: usize) { ++ self._cap = assert_size(cap); ++ } ++} ++ ++ + /// Singleton that all empty collections share. + /// Note: can't store non-zero ZSTs, we allocate in that case. We could + /// optimize everything to not do that (basically, make ptr == len and branch +@@ -121,9 +330,7 @@ extern { + + // TODO: overflow checks everywhere + +-// Utils +- +-fn oom() -> ! { std::process::abort() } ++// Utils for computing layouts of allocations + + fn alloc_size(cap: usize) -> usize { + // Compute "real" header size with pointer math +@@ -156,15 +363,22 @@ fn alloc_align() -> usize { + max(mem::align_of::(), mem::align_of::
()) + } + +-fn header_with_capacity(cap: usize) -> NonNull
{ +- debug_assert!(cap > 0); ++fn layout(cap: usize) -> Layout { + unsafe { +- let header = heap::allocate( ++ Layout::from_size_align_unchecked( + alloc_size::(cap), + alloc_align::(), +- ) as *mut Header; ++ ) ++ } ++} + +- if header.is_null() { oom() } ++fn header_with_capacity(cap: usize) -> NonNull
{ ++ debug_assert!(cap > 0); ++ unsafe { ++ let layout = layout::(cap); ++ let header = alloc(layout) as *mut Header; ++ ++ if header.is_null() { handle_alloc_error(layout) } + + // "Infinite" capacity for zero-sized types: + (*header).set_cap(if mem::size_of::() == 0 { MAX_CAP } else { cap }); +@@ -176,28 +390,8 @@ fn header_with_capacity(cap: usize) - + + + +-/// ThinVec is exactly the same as Vec, except that it stores its `len` and `capacity` in the buffer +-/// it allocates. +-/// +-/// This makes the memory footprint of ThinVecs lower; notably in cases where space is reserved for +-/// a non-existence ThinVec. So `Vec>` and `Option>::None` will waste less +-/// space. Being pointer-sized also means it can be passed/stored in registers. +-/// +-/// Of course, any actually constructed ThinVec will theoretically have a bigger allocation, but +-/// the fuzzy nature of allocators means that might not actually be the case. +-/// +-/// Properties of Vec that are preserved: +-/// * `ThinVec::new()` doesn't allocate (it points to a statically allocated singleton) +-/// * reallocation can be done in place +-/// * `size_of::>()` == `size_of::>>()` +-/// * NOTE: This is only possible when the `unstable` feature is used. +-/// +-/// Properties of Vec that aren't preserved: +-/// * `ThinVec` can't ever be zero-cost roundtripped to a `Box<[T]>`, `String`, or `*mut T` +-/// * `from_raw_parts` doesn't exist +-/// * ThinVec currently doesn't bother to not-allocate for Zero Sized Types (e.g. `ThinVec<()>`), +-/// but it could be done if someone cared enough to implement it. +-#[cfg_attr(feature = "gecko-ffi", repr(C))] ++/// See the crate's top level documentation for a description of this type. ++#[repr(C)] + pub struct ThinVec { + ptr: NonNull
, + boo: PhantomData, +@@ -627,15 +821,15 @@ impl ThinVec { + } + + pub fn drain(&mut self, range: R) -> Drain +- where R: RangeArgument ++ where R: RangeBounds + { + let len = self.len(); +- let start = match range.start() { ++ let start = match range.start_bound() { + Bound::Included(&n) => n, + Bound::Excluded(&n) => n + 1, + Bound::Unbounded => 0, + }; +- let end = match range.end() { ++ let end = match range.end_bound() { + Bound::Included(&n) => n + 1, + Bound::Excluded(&n) => n, + Bound::Unbounded => len, +@@ -666,9 +860,10 @@ impl ThinVec { + + unsafe fn deallocate(&mut self) { + if self.has_allocation() { +- heap::deallocate(self.ptr() as *mut u8, +- alloc_size::(self.capacity()), +- alloc_align::()); ++ dealloc( ++ self.ptr() as *mut u8, ++ layout::(self.capacity()), ++ ) + } + } + +@@ -678,15 +873,36 @@ impl ThinVec { + debug_assert!(new_cap > 0); + if self.has_allocation() { + let old_cap = self.capacity(); +- let ptr = heap::reallocate(self.ptr() as *mut u8, +- alloc_size::(old_cap), +- alloc_size::(new_cap), +- alloc_align::()) as *mut Header; +- if ptr.is_null() { oom() } ++ let ptr = realloc( ++ self.ptr() as *mut u8, ++ layout::(old_cap), ++ alloc_size::(new_cap), ++ ) as *mut Header; ++ ++ if ptr.is_null() { handle_alloc_error(layout::(new_cap)) } + (*ptr).set_cap(new_cap); + self.ptr = NonNull::new_unchecked(ptr); + } else { +- self.ptr = header_with_capacity::(new_cap); ++ let mut new_header = header_with_capacity::(new_cap); ++ ++ // If we get here and have a non-zero len, then we must be handling ++ // a gecko auto array, and we have items in a stack buffer. We shouldn't ++ // free it, but we should memcopy the contents out of it and mark it as empty. ++ // ++ // T is assumed to be trivially relocatable, as this is ~required ++ // for Rust compatibility anyway. Furthermore, we assume C++ won't try ++ // to unconditionally destroy the contents of the stack allocated buffer ++ // (i.e. it's obfuscated behind a union). ++ // ++ // In effect, we are partially reimplementing the auto array move constructor ++ // by leaving behind a valid empty instance. ++ let len = self.len(); ++ if cfg!(feature = "gecko-ffi") && len > 0 { ++ new_header.as_mut().data::().copy_from_nonoverlapping(self.data_raw(), len); ++ self.set_len(0); ++ } ++ ++ self.ptr = new_header; + } + } + +@@ -1087,10 +1303,7 @@ mod tests { + use std::mem::size_of; + assert_eq!(size_of::>(), size_of::<&u8>()); + +- // We don't perform the null-pointer optimization on stable rust. +- if cfg!(feature = "unstable") { +- assert_eq!(size_of::>>(), size_of::<&u8>()); +- } ++ assert_eq!(size_of::>>(), size_of::<&u8>()); + } + + #[test] +@@ -1725,7 +1938,6 @@ mod std_tests { + assert_eq!(v, &[(), ()]); + } + +-/* TODO: support inclusive ranges + #[test] + fn test_drain_inclusive_range() { + let mut v = thin_vec!['a', 'b', 'c', 'd', 'e']; +@@ -1755,6 +1967,7 @@ mod std_tests { + } + + #[test] ++ #[cfg(not(feature = "gecko-ffi"))] + fn test_drain_max_vec_size() { + let mut v = ThinVec::<()>::with_capacity(usize::max_value()); + unsafe { v.set_len(usize::max_value()); } +@@ -1775,7 +1988,6 @@ mod std_tests { + let mut v = thin_vec![1, 2, 3, 4, 5]; + v.drain(5..=5); + } +-*/ + + /* TODO: implement splice? + #[test] +@@ -2181,7 +2393,7 @@ mod std_tests { + assert!(v.capacity() >= 33) + } + +-/* TODO: implement try_reserve ++/* TODO: implement try_reserve + #[test] + fn test_try_reserve() { + +diff -up firefox-78.1.0/third_party/rust/thin-vec/src/range.rs.D87019-thin-vec-big-endian.diff firefox-78.1.0/third_party/rust/thin-vec/src/range.rs +diff -up firefox-78.1.0/toolkit/components/cascade_bloom_filter/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/toolkit/components/cascade_bloom_filter/Cargo.toml +--- firefox-78.1.0/toolkit/components/cascade_bloom_filter/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:29.000000000 +0200 ++++ firefox-78.1.0/toolkit/components/cascade_bloom_filter/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -8,5 +8,5 @@ nserror = { path = "../../../xpcom/rust/ + nsstring = { path = "../../../xpcom/rust/nsstring" } + rental = "0.5.5" + rust_cascade = "0.6.0" +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + xpcom = { path = "../../../xpcom/rust/xpcom" } +diff -up firefox-78.1.0/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml +--- firefox-78.1.0/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:30.000000000 +0200 ++++ firefox-78.1.0/toolkit/components/extensions/storage/webext_storage_bridge/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -13,7 +13,7 @@ moz_task = { path = "../../../../../xpco + nserror = { path = "../../../../../xpcom/rust/nserror" } + nsstring = { path = "../../../../../xpcom/rust/nsstring" } + once_cell = "1" +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + xpcom = { path = "../../../../../xpcom/rust/xpcom" } + serde = "1" + serde_json = "1" +diff -up firefox-78.1.0/toolkit/components/kvstore/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/toolkit/components/kvstore/Cargo.toml +--- firefox-78.1.0/toolkit/components/kvstore/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:30.000000000 +0200 ++++ firefox-78.1.0/toolkit/components/kvstore/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -18,7 +18,7 @@ rkv = "0.10.2" + storage_variant = { path = "../../../storage/variant" } + xpcom = { path = "../../../xpcom/rust/xpcom" } + tempfile = "3" +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } + + # Get rid of failure's dependency on backtrace. Eventually + # backtrace will move into Rust core, but we don't need it here. +diff -up firefox-78.1.0/toolkit/components/places/bookmark_sync/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/toolkit/components/places/bookmark_sync/Cargo.toml +--- firefox-78.1.0/toolkit/components/places/bookmark_sync/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:30.000000000 +0200 ++++ firefox-78.1.0/toolkit/components/places/bookmark_sync/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -19,5 +19,5 @@ url = "2.0" + xpcom = { path = "../../../../xpcom/rust/xpcom" } + + [dependencies.thin-vec] +-version = "0.1.0" ++version = "0.2.1" + features = ["gecko-ffi"] +diff -up firefox-78.1.0/tools/profiler/rust-helper/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/tools/profiler/rust-helper/Cargo.toml +--- firefox-78.1.0/tools/profiler/rust-helper/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:30.000000000 +0200 ++++ firefox-78.1.0/tools/profiler/rust-helper/Cargo.toml 2020-08-17 17:04:24.135598590 +0200 +@@ -23,7 +23,7 @@ features = ["endian_fd", "elf32", "elf64 + default-features = false + + [dependencies.thin-vec] +-version = "0.1.0" ++version = "0.2.1" + features = ["gecko-ffi"] + + [features] +diff -up firefox-78.1.0/xpcom/rust/xpcom/Cargo.toml.D87019-thin-vec-big-endian.diff firefox-78.1.0/xpcom/rust/xpcom/Cargo.toml +--- firefox-78.1.0/xpcom/rust/xpcom/Cargo.toml.D87019-thin-vec-big-endian.diff 2020-07-22 17:56:30.000000000 +0200 ++++ firefox-78.1.0/xpcom/rust/xpcom/Cargo.toml 2020-08-17 17:04:24.136598593 +0200 +@@ -9,4 +9,4 @@ nsstring = { path = "../nsstring" } + nserror = { path = "../nserror" } + threadbound = "0.1" + xpcom_macros = { path = "xpcom_macros" } +-thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } ++thin-vec = { version = "0.2.1", features = ["gecko-ffi"] } diff --git a/SOURCES/build-debug-qcms.patch b/SOURCES/build-debug-qcms.patch deleted file mode 100644 index a65223a..0000000 --- a/SOURCES/build-debug-qcms.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-60.0/gfx/qcms/transform-altivec.c.debug firefox-60.0/gfx/qcms/transform-altivec.c ---- firefox-60.0/gfx/qcms/transform-altivec.c.debug 2018-05-15 09:26:43.603043100 +0200 -+++ firefox-60.0/gfx/qcms/transform-altivec.c 2018-05-15 09:28:57.302385632 +0200 -@@ -30,7 +30,7 @@ - static const ALIGN float floatScaleX4 = FLOATSCALE; - static const ALIGN float clampMaxValueX4 = CLAMPMAXVAL; - --inline vector float load_aligned_float(float *dataPtr) -+static vector float load_aligned_float(float *dataPtr) - { - vector float data = vec_lde(0, dataPtr); - vector unsigned char moveToStart = vec_lvsl(0, dataPtr); diff --git a/SOURCES/build-icu-big-endian.patch b/SOURCES/build-icu-big-endian.patch deleted file mode 100644 index ee5fd6a..0000000 --- a/SOURCES/build-icu-big-endian.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up firefox-68.0/build/autoconf/icu.m4.icu firefox-68.0/build/autoconf/icu.m4 ---- firefox-68.0/build/autoconf/icu.m4.icu 2019-06-25 21:25:25.394425654 +0200 -+++ firefox-68.0/build/autoconf/icu.m4 2019-06-25 21:26:23.544210474 +0200 -@@ -78,7 +78,7 @@ if test -n "$USE_ICU"; then - # TODO: the l is actually endian-dependent - # We could make this set as 'l' or 'b' for little or big, respectively, - # but we'd need to check in a big-endian version of the file. -- ICU_DATA_FILE="icudt${version}l.dat" -+ ICU_DATA_FILE="icudt${version}b.dat" - fi - - AC_SUBST(MOZ_ICU_VERSION) - diff --git a/SOURCES/fedora-shebang-build.patch b/SOURCES/fedora-shebang-build.patch new file mode 100644 index 0000000..9ade86c --- /dev/null +++ b/SOURCES/fedora-shebang-build.patch @@ -0,0 +1,9 @@ +diff -up firefox-73.0/build/unix/run-mozilla.sh.old firefox-73.0/build/unix/run-mozilla.sh +--- firefox-73.0/build/unix/run-mozilla.sh.old 2020-02-12 09:58:00.150895904 +0100 ++++ firefox-73.0/build/unix/run-mozilla.sh 2020-02-12 09:58:06.505860696 +0100 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/usr/bin/sh + # + # This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/SOURCES/firefox-centos-default-prefs.js b/SOURCES/firefox-centos-default-prefs.js deleted file mode 100644 index ea10021..0000000 --- a/SOURCES/firefox-centos-default-prefs.js +++ /dev/null @@ -1,35 +0,0 @@ -pref("app.update.auto", false); -pref("app.update.enabled", false); -pref("app.update.autoInstallEnabled", false); -pref("general.smoothScroll", true); -pref("intl.locale.matchOS", true); -pref("toolkit.storage.synchronous", 0); -pref("toolkit.networkmanager.disable", false); -pref("offline.autoDetect", true); -pref("browser.backspace_action", 2); -pref("browser.display.use_system_colors", true); -pref("browser.download.folderList", 1); -pref("browser.link.open_external", 3); -pref("browser.shell.checkDefaultBrowser", false); -pref("network.manage-offline-status", true); -pref("extensions.shownSelectionUI", true); -pref("ui.SpellCheckerUnderlineStyle", 1); -pref("startup.homepage_override_url", "http://www.centos.org"); -pref("startup.homepage_welcome_url", "http://www.centos.org"); -pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/doc/HTML/index.html"); -pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"); -pref("media.gmp-gmpopenh264.provider.enabled",false); -pref("media.gmp-gmpopenh264.autoupdate",false); -pref("media.gmp-gmpopenh264.enabled",false); -pref("media.gmp-gmpopenh264.enabled",false); -pref("plugins.notifyMissingFlash", false); -/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */ -pref("browser.display.use_system_colors", false); -pref("layers.use-image-offscreen-surfaces", false); -/* Allow sending credetials to all https:// sites */ -pref("network.negotiate-auth.trusted-uris", "https://"); -pref("security.use_sqldb", false); -/* Use OS settings for UI language */ -pref("intl.locale.requested", ""); -/* See https://bugzilla.redhat.com/show_bug.cgi?id=1672424 */ -pref("storage.nfs_filesystem", true); diff --git a/SOURCES/firefox-dont-check-binary.patch b/SOURCES/firefox-dont-check-binary.patch deleted file mode 100644 index c498034..0000000 --- a/SOURCES/firefox-dont-check-binary.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff -up firefox-68.0/config/rules.mk.old firefox-68.0/config/rules.mk ---- firefox-68.0/config/rules.mk.old 2019-06-26 09:36:58.537034443 +0200 -+++ firefox-68.0/config/rules.mk 2019-06-26 09:37:38.004970573 +0200 -@@ -569,7 +569,6 @@ ifdef MOZ_PROFILE_GENERATE - endif - else # !WINNT || GNU_CC - $(call EXPAND_CC_OR_CXX,$@) -o $@ $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) $($(notdir $@)_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(STATIC_LIBS) $(RUST_STATIC_LIB) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS) -- $(call py_action,check_binary,--target $@) - endif # WINNT && !GNU_CC - - ifdef ENABLE_STRIP -@@ -604,9 +603,6 @@ else - $(HOST_CC) -o $@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS) $($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) - endif # HOST_CPP_PROG_LINK - endif --ifndef CROSS_COMPILE -- $(call py_action,check_binary,--host $@) --endif - - # - # This is an attempt to support generation of multiple binaries -@@ -630,7 +626,6 @@ ifdef MSMANIFEST_TOOL - endif # MSVC with manifest tool - else - $(call EXPAND_CC_OR_CXX,$@) $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) -o $@ $($@_$(OBJS_VAR_SUFFIX)) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS) -- $(call py_action,check_binary,--target $@) - endif # WINNT && !GNU_CC - - ifdef ENABLE_STRIP -@@ -651,9 +646,6 @@ else - $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_C_LDFLAGS) $($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) - endif - endif --ifndef CROSS_COMPILE -- $(call py_action,check_binary,--host $@) --endif - - $(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) - $(REPORT_BUILD) -@@ -691,7 +683,6 @@ ifndef INCREMENTAL_LINKER - $(RM) $@ - endif - $(MKSHLIB) $($@_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(LDFLAGS) $(STATIC_LIBS) $(RUST_STATIC_LIB) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) -- $(call py_action,check_binary,--target $@) - - ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) - ifdef MSMANIFEST_TOOL diff --git a/SOURCES/firefox-mozconfig b/SOURCES/firefox-mozconfig index 5585559..6efa937 100644 --- a/SOURCES/firefox-mozconfig +++ b/SOURCES/firefox-mozconfig @@ -5,12 +5,10 @@ ac_add_options --enable-default-toolkit=cairo-gtk3 ac_add_options --prefix="$PREFIX" ac_add_options --libdir="$LIBDIR" ac_add_options --with-system-zlib -ac_add_options --with-system-bz2 ac_add_options --disable-strip ac_add_options --disable-tests #ac_add_options --enable-libnotify ac_add_options --enable-necko-wifi -ac_add_options --enable-startup-notification ac_add_options --disable-updater ac_add_options --enable-chrome-format=omni ac_add_options --enable-pulseaudio diff --git a/SOURCES/firefox-pipewire-0-3.patch b/SOURCES/firefox-pipewire-0-3.patch index 7aa06b9..0844209 100644 --- a/SOURCES/firefox-pipewire-0-3.patch +++ b/SOURCES/firefox-pipewire-0-3.patch @@ -18,6 +18,19 @@ index 2081d0c683a4..641133bf1ea4 100644 'pixman.h', 'pk11func.h', 'pk11pqg.h', +diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +index ba885217b3ba..201d3b755221 100644 +--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn ++++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +@@ -158,7 +158,7 @@ if (rtc_include_tests) { + if (is_linux) { + if (rtc_use_pipewire) { + pkg_config("pipewire") { +- packages = [ "libpipewire-0.2" ] ++ packages = [ "libpipewire-0.3" ] + + defines = [ "WEBRTC_USE_PIPEWIRE" ] + } diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build index 90b40431c7e4..d844aa79d591 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build @@ -67,7 +80,7 @@ index 1eb8ead26efa..316468eed1fc 100644 }; diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -index 379341c833de..53e2683df2e8 100644 +index 379341c833de..76349f1fbd4d 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc @@ -15,8 +15,11 @@ @@ -250,13 +263,13 @@ index 379341c833de..53e2683df2e8 100644 - pw_buffer* buf = nullptr; + struct pw_buffer *next_buffer; + struct pw_buffer *buffer = nullptr; - -- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) { ++ + next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); + while (next_buffer) { + buffer = next_buffer; + next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -+ + +- if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) { + if (next_buffer) + pw_stream_queue_buffer (that->pw_stream_, buffer); + } @@ -365,7 +378,7 @@ index 379341c833de..53e2683df2e8 100644 if (pw_thread_loop_start(pw_main_loop_) < 0) { RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -@@ -278,81 +266,120 @@ void BaseCapturerPipeWire::InitPipeWire() { +@@ -278,81 +266,132 @@ void BaseCapturerPipeWire::InitPipeWire() { } } @@ -476,14 +489,27 @@ index 379341c833de..53e2683df2e8 100644 + map = static_cast(mmap( + nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, + PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ + src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); + } else if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { + int fd; + fd = spaBuffer->datas[0].fd; -+ + +- if (!(src = spaBuffer->datas[0].data)) { + map = static_cast(mmap( + nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, + PROT_READ, MAP_PRIVATE, fd, 0)); ++ ++ if (map == MAP_FAILED) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return; ++ } ++ + SyncDmaBuf(fd, DMA_BUF_SYNC_START); + + src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); @@ -491,16 +517,15 @@ index 379341c833de..53e2683df2e8 100644 + map = nullptr; + src = static_cast(spaBuffer->datas[0].data); + } else { -+ return; -+ } - -- if (!(src = spaBuffer->datas[0].data)) { -+ if (!src) { return; } - uint32_t maxSize = spaBuffer->datas[0].maxsize; - int32_t srcStride = spaBuffer->datas[0].chunk->stride; ++ if (!src) { ++ return; ++ } ++ + DesktopSize prev_crop_size = DesktopSize(0, 0); + if (video_crop_size_initialized_) { + prev_crop_size = video_crop_size_; @@ -544,7 +569,7 @@ index 379341c833de..53e2683df2e8 100644 if (srcStride != (desktop_size_.width() * kBytesPerPixel)) { RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: " << srcStride -@@ -361,21 +388,40 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { +@@ -361,21 +400,40 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { return; } @@ -598,7 +623,7 @@ index 379341c833de..53e2683df2e8 100644 } } -@@ -725,10 +771,7 @@ void BaseCapturerPipeWire::OnStartRequestResponseSignal( +@@ -725,10 +783,7 @@ void BaseCapturerPipeWire::OnStartRequestResponseSignal( g_variant_get(variant, "(u@a{sv})", &stream_id, &options); RTC_DCHECK(options != nullptr); @@ -610,7 +635,7 @@ index 379341c833de..53e2683df2e8 100644 g_variant_unref(options); g_variant_unref(variant); } -@@ -813,10 +856,15 @@ void BaseCapturerPipeWire::CaptureFrame() { +@@ -813,10 +868,15 @@ void BaseCapturerPipeWire::CaptureFrame() { return; } @@ -629,7 +654,7 @@ index 379341c833de..53e2683df2e8 100644 if (!result) { callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); return; -@@ -837,4 +885,22 @@ bool BaseCapturerPipeWire::SelectSource(SourceId id) { +@@ -837,4 +897,22 @@ bool BaseCapturerPipeWire::SelectSource(SourceId id) { return true; } diff --git a/SOURCES/mozilla-1170092.patch b/SOURCES/mozilla-1170092.patch index 5aebd73..40db2c6 100644 --- a/SOURCES/mozilla-1170092.patch +++ b/SOURCES/mozilla-1170092.patch @@ -1,7 +1,7 @@ -diff -up firefox-68.5.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-68.5.0/extensions/pref/autoconfig/src/nsReadConfig.cpp ---- firefox-68.5.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-02-07 01:27:03.000000000 +0100 -+++ firefox-68.5.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-02-24 11:30:32.058044651 +0100 -@@ -246,8 +246,20 @@ nsresult nsReadConfig::openAndEvaluateJS +diff -up firefox-78.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-78.0/extensions/pref/autoconfig/src/nsReadConfig.cpp +--- firefox-78.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2020-06-17 04:18:58.000000000 +0200 ++++ firefox-78.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2020-06-25 13:45:28.816999491 +0200 +@@ -244,8 +244,20 @@ nsresult nsReadConfig::openAndEvaluateJS if (NS_FAILED(rv)) return rv; rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); @@ -23,10 +23,10 @@ diff -up firefox-68.5.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 } else { nsAutoCString location("resource://gre/defaults/autoconfig/"); location += aFileName; -diff -up firefox-68.5.0/modules/libpref/Preferences.cpp.1170092 firefox-68.5.0/modules/libpref/Preferences.cpp ---- firefox-68.5.0/modules/libpref/Preferences.cpp.1170092 2020-02-24 11:30:32.059044645 +0100 -+++ firefox-68.5.0/modules/libpref/Preferences.cpp 2020-02-24 11:35:14.613443673 +0100 -@@ -4436,6 +4436,8 @@ static nsresult pref_ReadDefaultPrefs(co +diff -up firefox-78.0/modules/libpref/Preferences.cpp.1170092 firefox-78.0/modules/libpref/Preferences.cpp +--- firefox-78.0/modules/libpref/Preferences.cpp.1170092 2020-06-25 13:45:28.818999498 +0200 ++++ firefox-78.0/modules/libpref/Preferences.cpp 2020-06-25 13:48:45.996708102 +0200 +@@ -4499,6 +4499,8 @@ nsresult Preferences::InitInitialObjects // // Thus, in the omni.jar case, we always load app-specific default // preferences from omni.jar, whether or not `$app == $gre`. @@ -34,11 +34,11 @@ diff -up firefox-68.5.0/modules/libpref/Preferences.cpp.1170092 firefox-68.5.0/m + // - /etc/firefox/pref/*.js nsresult rv = NS_ERROR_FAILURE; - nsZipFind* findPtr; -diff -up firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp ---- firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-02-07 01:28:06.000000000 +0100 -+++ firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp 2020-02-24 11:34:27.284704700 +0100 -@@ -61,6 +61,7 @@ + UniquePtr find; +diff -up firefox-78.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-78.0/toolkit/xre/nsXREDirProvider.cpp +--- firefox-78.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2020-06-17 04:20:11.000000000 +0200 ++++ firefox-78.0/toolkit/xre/nsXREDirProvider.cpp 2020-06-25 13:48:28.613645633 +0200 +@@ -60,6 +60,7 @@ #endif #ifdef XP_UNIX # include @@ -46,7 +46,7 @@ diff -up firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-68.5.0/ #endif #ifdef XP_IOS # include "UIKitDirProvider.h" -@@ -524,6 +525,21 @@ nsXREDirProvider::GetFile(const char* aP +@@ -533,6 +534,21 @@ nsXREDirProvider::GetFile(const char* aP } } } @@ -68,9 +68,9 @@ diff -up firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-68.5.0/ if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE; if (ensureFilePermissions) { -@@ -880,6 +896,17 @@ nsresult nsXREDirProvider::GetFilesInter +@@ -845,6 +861,17 @@ nsresult nsXREDirProvider::GetFilesInter + LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); - LoadDirsIntoArray(mAppBundleDirectories, kAppendPrefDir, directories); + // Add /etc//pref/ directory if it exists + nsCOMPtr systemPrefDir; @@ -86,10 +86,10 @@ diff -up firefox-68.5.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-68.5.0/ rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile)); } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) { // NS_APP_CHROME_DIR_LIST is only used to get default (native) icons -diff -up firefox-68.5.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-68.5.0/xpcom/io/nsAppDirectoryServiceDefs.h ---- firefox-68.5.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-02-07 01:27:52.000000000 +0100 -+++ firefox-68.5.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-02-24 11:30:32.059044645 +0100 -@@ -62,6 +62,7 @@ +diff -up firefox-78.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-78.0/xpcom/io/nsAppDirectoryServiceDefs.h +--- firefox-78.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2020-06-17 04:20:17.000000000 +0200 ++++ firefox-78.0/xpcom/io/nsAppDirectoryServiceDefs.h 2020-06-25 13:45:28.819999502 +0200 +@@ -60,6 +60,7 @@ #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" #define NS_APP_PREFS_OVERRIDE_DIR \ "PrefDOverride" // Directory for per-profile defaults diff --git a/SOURCES/mozilla-1603112-accept-lang.patch b/SOURCES/mozilla-1603112-accept-lang.patch deleted file mode 100644 index b67b232..0000000 --- a/SOURCES/mozilla-1603112-accept-lang.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/intl/strres/nsStringBundle.cpp b/intl/strres/nsStringBundle.cpp ---- a/intl/strres/nsStringBundle.cpp -+++ b/intl/strres/nsStringBundle.cpp -@@ -66,7 +66,6 @@ - "chrome://global/locale/commonDialogs.properties", - "chrome://global/locale/css.properties", - "chrome://global/locale/dom/dom.properties", -- "chrome://global/locale/intl.properties", - "chrome://global/locale/layout/HtmlForm.properties", - "chrome://global/locale/layout/htmlparser.properties", - "chrome://global/locale/layout_errors.properties", - diff --git a/SOURCES/mozilla-bmo1005535.patch b/SOURCES/mozilla-bmo1005535.patch index 96f6e1a..cab0134 100644 --- a/SOURCES/mozilla-bmo1005535.patch +++ b/SOURCES/mozilla-bmo1005535.patch @@ -1,15 +1,7 @@ -# HG changeset patch -# User Steve Singer -# Date 1558451540 -7200 -# Tue May 21 17:12:20 2019 +0200 -# Node ID 433beec63e6b5f409683af20a0c1ab137cc7bfad -# Parent 42c99b59a87b904063bad3193f10c51d068d2eac -Bug 1005535 - Get skia GPU building on big endian. - -diff -r 42c99b59a87b -r 433beec63e6b gfx/skia/skia/include/private/GrColor.h ---- a/gfx/skia/skia/include/private/GrColor.h Wed Jun 05 08:48:08 2019 +0200 -+++ b/gfx/skia/skia/include/private/GrColor.h Tue May 21 17:12:20 2019 +0200 -@@ -63,7 +63,7 @@ +diff -up firefox-78.0/gfx/skia/skia/src/gpu/GrColor.h.mozilla.bmo1005535 firefox-78.0/gfx/skia/skia/src/gpu/GrColor.h +--- firefox-78.0/gfx/skia/skia/src/gpu/GrColor.h.mozilla.bmo1005535 2020-06-25 16:16:34.459083304 +0200 ++++ firefox-78.0/gfx/skia/skia/src/gpu/GrColor.h 2020-06-25 16:17:00.968174743 +0200 +@@ -64,7 +64,7 @@ static inline GrColor GrColorPackRGBA(un * Since premultiplied means that alpha >= color, we construct a color with * each component==255 and alpha == 0 to be "illegal" */ diff --git a/SOURCES/mozilla-bmo1504834-part1.patch b/SOURCES/mozilla-bmo1504834-part1.patch index cb985bb..01da145 100644 --- a/SOURCES/mozilla-bmo1504834-part1.patch +++ b/SOURCES/mozilla-bmo1504834-part1.patch @@ -1,11 +1,7 @@ -# HG changeset patch -# Parent 051b75a600dfbf7503c3485cebfd34d4eb29be96 -Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834 - -diff -r 051b75a600df gfx/2d/DrawTargetSkia.cpp ---- a/gfx/2d/DrawTargetSkia.cpp Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/2d/DrawTargetSkia.cpp Mon Jul 08 10:59:30 2019 +0200 -@@ -138,8 +138,7 @@ +diff -up firefox-78.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1 firefox-78.0/gfx/2d/DrawTargetSkia.cpp +--- firefox-78.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1 2020-06-17 04:18:58.000000000 +0200 ++++ firefox-78.0/gfx/2d/DrawTargetSkia.cpp 2020-06-25 16:52:29.824532769 +0200 +@@ -135,8 +135,7 @@ static IntRect CalculateSurfaceBounds(co return surfaceBounds.Intersect(bounds); } @@ -15,48 +11,48 @@ diff -r 051b75a600df gfx/2d/DrawTargetSkia.cpp static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { -diff -r 051b75a600df gfx/2d/Types.h ---- a/gfx/2d/Types.h Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/2d/Types.h Mon Jul 08 10:59:30 2019 +0200 -@@ -85,15 +85,8 @@ +diff -up firefox-78.0/gfx/2d/Types.h.mozilla-bmo1504834-part1 firefox-78.0/gfx/2d/Types.h +--- firefox-78.0/gfx/2d/Types.h.mozilla-bmo1504834-part1 2020-06-25 16:52:29.826532776 +0200 ++++ firefox-78.0/gfx/2d/Types.h 2020-06-25 16:55:02.942063616 +0200 +@@ -90,15 +90,8 @@ enum class SurfaceFormat : int8_t { // The following values are endian-independent synonyms. The _UINT32 suffix // indicates that the name reflects the layout when viewed as a uint32_t // value. --#if MOZ_LITTLE_ENDIAN +-#if MOZ_LITTLE_ENDIAN() A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB - X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB --#elif MOZ_BIG_ENDIAN + X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB +-#elif MOZ_BIG_ENDIAN() - A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB -- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB +- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB -#else -# error "bad endianness" -#endif - }; - static inline int BytesPerPixel(SurfaceFormat aFormat) { -diff -r 051b75a600df gfx/skia/skia/third_party/skcms/skcms.cc ---- a/gfx/skia/skia/third_party/skcms/skcms.cc Fri Jul 05 12:42:44 2019 +0200 -+++ b/gfx/skia/skia/third_party/skcms/skcms.cc Mon Jul 08 10:59:30 2019 +0200 -@@ -17,6 +17,8 @@ - #include - #elif defined(__SSE__) - #include + // The following values are OS and endian-independent synonyms. + // +diff -up firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc.mozilla-bmo1504834-part1 firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc +--- firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc.mozilla-bmo1504834-part1 2020-06-17 04:18:58.000000000 +0200 ++++ firefox-78.0/gfx/skia/skia/third_party/skcms/skcms.cc 2020-06-25 16:54:02.993855444 +0200 +@@ -30,6 +30,8 @@ + #include + #include + #endif +#else + #define SKCMS_PORTABLE #endif // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others. -@@ -124,20 +126,28 @@ +@@ -280,20 +282,28 @@ enum { static uint16_t read_big_u16(const uint8_t* ptr) { uint16_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) +- return _byteswap_ushort(be); +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return be; -+#else + #else + #if defined(_MSC_VER) - return _byteswap_ushort(be); --#else ++ return _byteswap_ushort(be); + #else return __builtin_bswap16(be); + #endif @@ -67,12 +63,12 @@ diff -r 051b75a600df gfx/skia/skia/third_party/skcms/skcms.cc uint32_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) +- return _byteswap_ulong(be); +#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ + return be; -+#else + #else + #if defined(_MSC_VER) - return _byteswap_ulong(be); --#else ++ return _byteswap_ulong(be); + #else return __builtin_bswap32(be); + #endif diff --git a/SOURCES/mozilla-bmo1626236.patch b/SOURCES/mozilla-bmo1626236.patch new file mode 100644 index 0000000..32e3742 --- /dev/null +++ b/SOURCES/mozilla-bmo1626236.patch @@ -0,0 +1,86 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1582805876 -3600 +# Thu Feb 27 13:17:56 2020 +0100 +# Node ID cc3d09abea31068e57f1ab918782f9f86fc6a158 +# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f +imported patch decoder_workaround.patch + +diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp +--- a/image/decoders/nsGIFDecoder2.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsGIFDecoder2.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -422,6 +422,9 @@ + MOZ_ASSERT(mSwizzleFn); + uint8_t* data = reinterpret_cast(aColormap); + mSwizzleFn(data, data, aColors); ++#if MOZ_BIG_ENDIAN() ++ SwizzleRow(SurfaceFormat::A8R8G8B8, SurfaceFormat::B8G8R8A8)(data, data, aColors); ++#endif + } + + LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator, +diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp +--- a/image/decoders/nsJPEGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsJPEGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -263,6 +263,9 @@ + case JCS_YCbCr: + // By default, we will output directly to BGRA. If we need to apply + // special color transforms, this may change. ++#if MOZ_BIG_ENDIAN() ++ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB; ++#else + switch (SurfaceFormat::OS_RGBX) { + case SurfaceFormat::B8G8R8X8: + mInfo.out_color_space = JCS_EXT_BGRX; +@@ -277,6 +280,7 @@ + mState = JPEG_ERROR; + return Transition::TerminateFailure(); + } ++#endif + break; + case JCS_CMYK: + case JCS_YCCK: +diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp +--- a/image/decoders/nsPNGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsPNGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -361,7 +361,7 @@ + IResumable* aOnResume) { + MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!"); + +- return mLexer.Lex(aIterator, aOnResume, ++ LexerResult res = mLexer.Lex(aIterator, aOnResume, + [=](State aState, const char* aData, size_t aLength) { + switch (aState) { + case State::PNG_DATA: +@@ -371,6 +371,14 @@ + } + MOZ_CRASH("Unknown State"); + }); ++ ++#if MOZ_BIG_ENDIAN() ++ if(res.is() && res.as() == TerminalState::SUCCESS) { ++ NativeEndian::swapToLittleEndianInPlace((uint32_t*)(mImageData), mImageDataLength / 4); ++ } ++#endif ++ ++ return res; + } + + LexerTransition nsPNGDecoder::ReadPNGData( +diff -r 9cd90914846f image/decoders/nsWebPDecoder.cpp +--- a/image/decoders/nsWebPDecoder.cpp Thu Feb 27 12:57:14 2020 +0100 ++++ b/image/decoders/nsWebPDecoder.cpp Fri Mar 27 13:06:18 2020 +0100 +@@ -237,7 +237,12 @@ + // WebP doesn't guarantee that the alpha generated matches the hint in the + // header, so we always need to claim the input is BGRA. If the output is + // BGRX, swizzling will mask off the alpha channel. ++#if MOZ_BIG_ENDIAN() ++ mBuffer.colorspace = MODE_ARGB; ++ SurfaceFormat inFormat = mFormat; ++#else + SurfaceFormat inFormat = SurfaceFormat::OS_RGBA; ++#endif + + SurfacePipeFlags pipeFlags = SurfacePipeFlags(); + if (mFormat == SurfaceFormat::OS_RGBA && + diff --git a/SOURCES/mozilla-bmo998749.patch b/SOURCES/mozilla-bmo998749.patch new file mode 100644 index 0000000..4ddde4c --- /dev/null +++ b/SOURCES/mozilla-bmo998749.patch @@ -0,0 +1,30 @@ +# HG changeset patch +# User msirringhaus@suse.de +# Date 1583738770 -3600 +# Mon Mar 09 08:26:10 2020 +0100 +# Node ID 34676feac1a542e409e22acf5b98735f8313b1ce +# Parent 506857dace0a08d1c9685e3ac264646590b3e27f +[mq]: mozilla-bmo998749.patch + +diff -r 506857dace0a -r 34676feac1a5 gfx/2d/FilterProcessing.h +--- a/gfx/2d/FilterProcessing.h Fri Feb 28 12:31:51 2020 +0100 ++++ b/gfx/2d/FilterProcessing.h Mon Mar 09 08:26:10 2020 +0100 +@@ -13,10 +13,17 @@ + namespace mozilla { + namespace gfx { + ++#if MOZ_BIG_ENDIAN() ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 3; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 2; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 1; ++const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 0; ++#else + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 0; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 1; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 2; + const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 3; ++#endif + + class FilterProcessing { + public: + diff --git a/SOURCES/mozilla-nestegg-big-endian.patch b/SOURCES/mozilla-nestegg-big-endian.patch deleted file mode 100644 index de9adbf..0000000 --- a/SOURCES/mozilla-nestegg-big-endian.patch +++ /dev/null @@ -1,38 +0,0 @@ -# HG changeset patch -# Parent 381102061fccdec40efda75c7423a766f68201ba -Bug-behavior: Youtube-videos using VP9 and opus as audio-codec started loading but did not play -Reason: While parsing the audio-stream, the sampling frequency (short rate) was wrongly parsed by - nestegg, returning 0 all the time. This led to the audio-track reporting that it neither had - valid video nor audio. Which led to an endless-loop in the video state machine. -Solution: Correct parsing of rate in nestegg, which is a float and cuts of bytes. -Link: https://github.com/kinetiknz/nestegg/issues/64 - -diff -r 381102061fcc -r 8da4be020b1e media/libnestegg/src/nestegg.c ---- a/media/libnestegg/src/nestegg.c Tue Aug 13 07:51:27 2019 +0200 -+++ b/media/libnestegg/src/nestegg.c Tue Aug 20 07:59:54 2019 +0200 -@@ -768,7 +768,15 @@ - { - union { - uint64_t u; -- float f; -+ struct { -+#if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__ -+ uint32_t _pad; -+ float f; -+#else -+ float f; -+ uint32_t _pad; -+#endif -+ } f; - double d; - } value; - int r; -@@ -780,7 +788,7 @@ - if (r != 1) - return r; - if (length == 4) -- *val = value.f; -+ *val = value.f.f; - else - *val = value.d; - return 1; diff --git a/SOURCES/mozilla-s390x-skia-gradient.patch b/SOURCES/mozilla-s390x-skia-gradient.patch new file mode 100644 index 0000000..8c0e3bd --- /dev/null +++ b/SOURCES/mozilla-s390x-skia-gradient.patch @@ -0,0 +1,52 @@ +# HG changeset patch +# Parent acf59ea86dd1d878b43920832093f082dcfc61c0 + +diff -r acf59ea86dd1 gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp +--- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Mon Mar 09 08:26:10 2020 +0100 ++++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp Fri Mar 27 13:30:28 2020 +0100 +@@ -7,7 +7,7 @@ + + #include "include/core/SkPaint.h" + #include "src/shaders/gradients/Sk4fLinearGradient.h" +- ++#include "src/core/SkEndian.h" + #include + #include + +@@ -28,6 +28,9 @@ + + while (n >= 4) { + DstTraits::store4x(c0, c1, c2, c3, dst, bias0, bias1); ++#ifdef SK_CPU_BENDIAN ++ SkEndianSwap32s(dst, 4); ++#endif + dst += 4; + + c0 = c0 + dc4; +@@ -37,12 +40,23 @@ + n -= 4; + } + if (n & 2) { +- DstTraits::store(c0, dst++, bias0); +- DstTraits::store(c1, dst++, bias1); ++ DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; ++ DstTraits::store(c1, dst, bias1); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif ++ ++dst; + c0 = c0 + dc2; + } + if (n & 1) { + DstTraits::store(c0, dst, bias0); ++#ifdef SK_CPU_BENDIAN ++ *dst = SkEndianSwap32(*dst); ++#endif + } + } + + diff --git a/SOURCES/nss-build-mozilla-1564499.patch b/SOURCES/nss-build-mozilla-1564499.patch deleted file mode 100644 index 9d5bb5c..0000000 --- a/SOURCES/nss-build-mozilla-1564499.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-68.0/security/nss/lib/freebl/mpi/mpcpucache.c.old firefox-68.0/security/nss/lib/freebl/mpi/mpcpucache.c ---- firefox-68.0/security/nss/lib/freebl/mpi/mpcpucache.c.old 2019-07-26 07:09:02.383303420 +0200 -+++ firefox-68.0/security/nss/lib/freebl/mpi/mpcpucache.c 2019-07-26 07:09:27.228193798 +0200 -@@ -727,7 +727,7 @@ static inline void - dcbzl(char *array) - { - register char *a asm("r2") = array; -- __asm__ __volatile__("dcbzl %0,r0" -+ __asm__ __volatile__("dcbzl %0,0" - : "=r"(a) - : "0"(a)); - } diff --git a/SOURCES/nss-setup-flags-env.inc b/SOURCES/nss-setup-flags-env.inc new file mode 100644 index 0000000..c3624b1 --- /dev/null +++ b/SOURCES/nss-setup-flags-env.inc @@ -0,0 +1,7 @@ +sed -i 's@%{gtk3_install_path}@%{_buildrootdir}%{gtk3_install_path}@g' %{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig/nss*.pc + +export LDFLAGS="-L%{_buildrootdir}%{gtk3_install_path}/%{_lib} $LDFLAGS" +export LDFLAGS="-Wl,-rpath,%{gtk3_install_path}/%{_lib} $LDFLAGS" +export LDFLAGS="-Wl,-rpath-link,%{_buildrootdir}%{gtk3_install_path}/%{_lib} $LDFLAGS" +export PKG_CONFIG_PATH=%{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig +export PATH="{_buildrootdir}%{gtk3_install_path}/bin:$PATH" diff --git a/SOURCES/rhbz-1821418.patch b/SOURCES/rhbz-1821418.patch index 588084c..8b02dfb 100644 --- a/SOURCES/rhbz-1821418.patch +++ b/SOURCES/rhbz-1821418.patch @@ -1,7 +1,7 @@ -diff -up firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp ---- firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 2020-04-03 21:30:08.000000000 +0200 -+++ firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp 2020-04-23 21:15:56.015491502 +0200 -@@ -147,8 +147,12 @@ bool nsAvailableMemoryWatcher::IsVirtual +diff -up firefox-78.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 firefox-78.0/xpcom/base/AvailableMemoryTracker.cpp +--- firefox-78.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 2020-06-17 04:20:44.000000000 +0200 ++++ firefox-78.0/xpcom/base/AvailableMemoryTracker.cpp 2020-06-25 14:50:46.369798294 +0200 +@@ -157,8 +157,12 @@ bool nsAvailableMemoryWatcher::IsVirtual /* static */ bool nsAvailableMemoryWatcher::IsCommitSpaceLow(const MEMORYSTATUSEX& aStat) { @@ -16,7 +16,7 @@ diff -up firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 firef sNumLowCommitSpaceEvents++; CrashReporter::AnnotateCrashReport( CrashReporter::Annotation::LowCommitSpaceEvents, -@@ -206,13 +210,16 @@ void nsAvailableMemoryWatcher::AdjustPol +@@ -210,12 +214,15 @@ void nsAvailableMemoryWatcher::AdjustPol // polling interval accordingly. NS_IMETHODIMP nsAvailableMemoryWatcher::Notify(nsITimer* aTimer) { @@ -28,10 +28,9 @@ diff -up firefox-68.7.0/xpcom/base/AvailableMemoryTracker.cpp.rhbz-1821418 firef bool success = GlobalMemoryStatusEx(&stat); - if (success) { -+ if (success || forceLowMem) { - bool lowMemory = IsVirtualMemoryLow(stat) || IsCommitSpaceLow(stat) || -- IsPhysicalMemoryLow(stat); -+ IsPhysicalMemoryLow(stat) || forceLowMem; +- bool lowMemory = IsVirtualMemoryLow(stat) || IsCommitSpaceLow(stat); ++ if (success || forceLowMemory) { ++ bool lowMemory = IsVirtualMemoryLow(stat) || IsCommitSpaceLow(stat || forceLowMem); if (lowMemory) { SendMemoryPressureEvent(); diff --git a/SOURCES/rhel6-abiv2-mozbz1642174.patch b/SOURCES/rhel6-abiv2-mozbz1642174.patch new file mode 100644 index 0000000..57d217c --- /dev/null +++ b/SOURCES/rhel6-abiv2-mozbz1642174.patch @@ -0,0 +1,29 @@ +diff -up firefox-78.2.0/security/nss/lib/freebl/freebl.gyp.rhel6-abiv2-mozbz1642174 firefox-78.2.0/security/nss/lib/freebl/freebl.gyp +--- firefox-78.2.0/security/nss/lib/freebl/freebl.gyp.rhel6-abiv2-mozbz1642174 2020-09-12 08:29:08.527410514 +0200 ++++ firefox-78.2.0/security/nss/lib/freebl/freebl.gyp 2020-09-12 08:42:26.279064334 +0200 +@@ -259,7 +259,7 @@ + 'type': 'static_library', + 'sources': [ + 'gcm-ppc.c', +- 'sha512-p8.s', ++ #'sha512-p8.s', + ], + 'dependencies': [ + '<(DEPTH)/exports.gyp:nss_exports' +diff -up firefox-78.2.0/security/nss/lib/freebl/Makefile.rhel6-abiv2-mozbz1642174 firefox-78.2.0/security/nss/lib/freebl/Makefile +--- firefox-78.2.0/security/nss/lib/freebl/Makefile.rhel6-abiv2-mozbz1642174 2020-08-17 20:34:06.000000000 +0200 ++++ firefox-78.2.0/security/nss/lib/freebl/Makefile 2020-09-12 08:28:08.089142990 +0200 +@@ -267,9 +267,12 @@ ifeq ($(CPU_ARCH),arm) + endif + ifeq ($(CPU_ARCH),ppc) + EXTRA_SRCS += gcm-ppc.c +- ASFILES += sha512-p8.s + ifdef USE_64 + DEFINES += -DNSS_NO_INIT_SUPPORT ++ #PPC_ABI := $(shell $(CC) -dM -E - < /dev/null | awk '$$2 == "_CALL_ELF" {print $$3}') ++ # ifeq ($(PPC_ABI),2) ++ # ASFILES += sha512-p8.s ++ # endif + endif # USE_64 + endif # ppc + endif # Linux diff --git a/SOURCES/rhel6-auxvh.patch b/SOURCES/rhel6-auxvh.patch new file mode 100644 index 0000000..3234196 --- /dev/null +++ b/SOURCES/rhel6-auxvh.patch @@ -0,0 +1,39 @@ +diff -up firefox-78.2.0/mozglue/build/ppc.cpp.ppc-vsx firefox-78.2.0/mozglue/build/ppc.cpp +--- firefox-78.2.0/mozglue/build/ppc.cpp.ppc-vsx 2020-09-11 07:07:05.850864720 +0200 ++++ firefox-78.2.0/mozglue/build/ppc.cpp 2020-09-11 07:08:48.884202679 +0200 +@@ -14,10 +14,6 @@ + #if defined(XP_LINUX) + // Use the getauxval() function if available. + // ARCH_3_00 wasn't defined until glibc 2.23, so include just in case. +-# include +-# ifndef PPC_FEATURE2_ARCH_3_00 +-# define PPC_FEATURE2_ARCH_3_00 0x00800000 +-# endif + #endif + + const unsigned PPC_FLAG_VMX = 1; +@@ -33,24 +29,8 @@ static signed get_ppc_cpu_flags(void) { + } + cpu_flags = 0; + +-#if defined(XP_LINUX) +- // Try getauxval(). +- unsigned long int cap = getauxval(AT_HWCAP); +- unsigned long int cap2 = getauxval(AT_HWCAP2); +- +- if (cap & PPC_FEATURE_HAS_ALTIVEC) { +- cpu_flags |= PPC_FLAG_VMX; +- } +- if (cap & PPC_FEATURE_HAS_VSX) { +- cpu_flags |= PPC_FLAG_VSX; +- } +- if (cap2 & PPC_FEATURE2_ARCH_3_00) { +- cpu_flags |= PPC_FLAG_VSX3; +- } +-#else + // Non-Linux detection here. Currently, on systems other than Linux, + // no CPU SIMD features will be detected. +-#endif + + return cpu_flags; + } diff --git a/SOURCES/rhel6-dbusver.patch b/SOURCES/rhel6-dbusver.patch new file mode 100644 index 0000000..d07224b --- /dev/null +++ b/SOURCES/rhel6-dbusver.patch @@ -0,0 +1,41 @@ +diff -up firefox-78.2.0/third_party/rust/libdbus-sys/build.rs.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/build.rs +--- firefox-78.2.0/third_party/rust/libdbus-sys/build.rs.rhel6-dbusver 2020-08-17 20:34:46.000000000 +0200 ++++ firefox-78.2.0/third_party/rust/libdbus-sys/build.rs 2020-09-09 21:06:34.932374254 +0200 +@@ -3,5 +3,5 @@ extern crate pkg_config; + fn main() { + // See https://github.com/joshtriplett/metadeps/issues/9 for why we don't use + // metadeps here, but instead keep this manually in sync with Cargo.toml. +- pkg_config::Config::new().atleast_version("1.6").probe("dbus-1").unwrap(); ++ pkg_config::Config::new().atleast_version("1.2").probe("dbus-1").unwrap(); + } +diff -up firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json +--- firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json.rhel6-dbusver 2020-08-17 20:35:05.000000000 +0200 ++++ firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json 2020-09-09 21:11:37.045287830 +0200 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"7054b852a13a318562f3ef791e69802f234c9f3d943f2de2d1cef8b31fd0939a","LICENSE-APACHE":"453745410e3be8cf25d56872ea2aec975a78e6c9f217443d0bf908a5bce7c8ff","LICENSE-MIT":"de3911c2d98c8bd2d701ee721347053d9b55995a11f9a8c955e44d3ca1b376bf","build.rs":"9fbc218277d76a570c01c5795a7c8008f5458317cc036d7c88b1dc1a4af22fb7","src/lib.rs":"c8a0d43a3b7e9c8828d4946437379f1985492bd6b04fdd5e967bbcace2197c3d"},"package":"18cb88963258d00f4962205dbb5933d82780d9962c8c8a064b651d2ad7189210"} +\ No newline at end of file ++{"files":{"Cargo.toml":"7054b852a13a318562f3ef791e69802f234c9f3d943f2de2d1cef8b31fd0939a","LICENSE-APACHE":"453745410e3be8cf25d56872ea2aec975a78e6c9f217443d0bf908a5bce7c8ff","LICENSE-MIT":"de3911c2d98c8bd2d701ee721347053d9b55995a11f9a8c955e44d3ca1b376bf","build.rs":"41d24ea34bd37eb7a47253ac0681da2dde73e52caf04bbcecf795965e5d36466","src/lib.rs":"31e939a4a7f537265a84c91ba940ac31ac0f66c53a49971f1b21bbd2e4a7b5e9"},"package":"18cb88963258d00f4962205dbb5933d82780d9962c8c8a064b651d2ad7189210"} +diff -up firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs +--- firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs.rhel6-dbusver 2020-08-17 20:34:38.000000000 +0200 ++++ firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs 2020-09-09 21:06:34.933374260 +0200 +@@ -252,13 +252,14 @@ extern "C" { + pub fn dbus_signature_validate_single(signature: *const c_char, error: *mut DBusError) -> u32; + + pub fn dbus_threads_init_default() -> c_int; ++} ++ pub fn dbus_validate_bus_name(busname: *const c_char, error: *mut DBusError) -> u32 {return 1;} ++ pub fn dbus_validate_error_name(errorname: *const c_char, error: *mut DBusError) -> u32 {return 1;} ++ pub fn dbus_validate_interface(interface: *const c_char, error: *mut DBusError) -> u32 {return 1;} ++ pub fn dbus_validate_member(member: *const c_char, error: *mut DBusError) -> u32 {return 1;} ++ pub fn dbus_validate_path(path: *const c_char, error: *mut DBusError) -> u32 {return 1;} + +- pub fn dbus_validate_bus_name(busname: *const c_char, error: *mut DBusError) -> u32; +- pub fn dbus_validate_error_name(errorname: *const c_char, error: *mut DBusError) -> u32; +- pub fn dbus_validate_interface(interface: *const c_char, error: *mut DBusError) -> u32; +- pub fn dbus_validate_member(member: *const c_char, error: *mut DBusError) -> u32; +- pub fn dbus_validate_path(path: *const c_char, error: *mut DBusError) -> u32; +- ++extern "C" { + pub fn dbus_watch_get_enabled(watch: *mut DBusWatch) -> u32; + pub fn dbus_watch_get_flags(watch: *mut DBusWatch) -> c_uint; + pub fn dbus_watch_get_unix_fd(watch: *mut DBusWatch) -> c_int; diff --git a/SOURCES/rhel6-kernel.patch b/SOURCES/rhel6-kernel.patch new file mode 100644 index 0000000..4981285 --- /dev/null +++ b/SOURCES/rhel6-kernel.patch @@ -0,0 +1,16 @@ +diff -up firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.rhel6-kernel firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc +--- firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.rhel6-kernel 2020-09-09 19:56:13.159597467 +0200 ++++ firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc 2020-09-09 19:56:31.457712629 +0200 +@@ -385,11 +385,7 @@ bool DeviceInfoLinux::IsDeviceNameMatche + + bool DeviceInfoLinux::IsVideoCaptureDevice(struct v4l2_capability* cap) + { +- if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) { +- return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE; +- } else { +- return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE; +- } ++ return false; + } + + int32_t DeviceInfoLinux::FillCapabilities(int fd) { diff --git a/SOURCES/rhel6-mach-fail.patch b/SOURCES/rhel6-mach-fail.patch new file mode 100644 index 0000000..286be5e --- /dev/null +++ b/SOURCES/rhel6-mach-fail.patch @@ -0,0 +1,12 @@ +diff -up firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py.mach-fail firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py +--- firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py.mach-fail 2020-09-09 19:25:18.552930506 +0200 ++++ firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py 2020-09-09 19:25:31.081010223 +0200 +@@ -591,7 +591,7 @@ class TerminalLoggingHandler(logging.Han + if self.footer: + self.footer.clear() + +- self.fh.write(msg.encode("utf-8")) ++ self.fh.write(msg) + self.fh.write('\n') + + if self.footer: diff --git a/SOURCES/rhel6-zconst.patch b/SOURCES/rhel6-zconst.patch new file mode 100644 index 0000000..fedd335 --- /dev/null +++ b/SOURCES/rhel6-zconst.patch @@ -0,0 +1,12 @@ +diff -up firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp.zconst firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp +--- firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp.zconst 2020-09-09 20:29:17.489123431 +0200 ++++ firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp 2020-09-09 20:30:09.544457350 +0200 +@@ -523,7 +523,7 @@ nsProfiler::GetProfileDataAsGzippedArray + stream.opaque = nullptr; + stream.next_out = (Bytef*)outBuff.Elements(); + stream.avail_out = outBuff.Length(); +- stream.next_in = (z_const Bytef*)aResult.Data(); ++ stream.next_in = (Bytef*)aResult.Data(); + stream.avail_in = aResult.Length(); + + // A windowBits of 31 is the default (15) plus 16 for emitting a diff --git a/SOURCES/rust-network-check.patch b/SOURCES/rust-network-check.patch deleted file mode 100644 index d18f2fe..0000000 --- a/SOURCES/rust-network-check.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff -up firefox-68.0/config/makefiles/rust.mk.rust-network-check firefox-68.0/config/makefiles/rust.mk ---- firefox-68.0/config/makefiles/rust.mk.rust-network-check 2019-06-06 10:29:18.984737603 +0200 -+++ firefox-68.0/config/makefiles/rust.mk 2019-06-06 11:39:51.581028835 +0200 -@@ -127,7 +127,7 @@ export RUST_BACKTRACE=full - export MOZ_TOPOBJDIR=$(topobjdir) - - target_rust_ltoable := force-cargo-library-build --target_rust_nonltoable := force-cargo-test-run force-cargo-library-check $(foreach b,build check,force-cargo-program-$(b)) -+target_rust_nonltoable := force-cargo-test-run $(foreach b,build check,force-cargo-program-$(b)) - - $(target_rust_ltoable): RUSTFLAGS:=$(rustflags_override) $(RUSTFLAGS) $(if $(MOZ_LTO_RUST),-Clinker-plugin-lto) - $(target_rust_nonltoable): RUSTFLAGS:=$(rustflags_override) $(RUSTFLAGS) -@@ -238,19 +238,9 @@ force-cargo-library-build: - $(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags) - - $(RUST_LIBRARY_FILE): force-cargo-library-build --# When we are building in --enable-release mode; we add an additional check to confirm --# that we are not importing any networking-related functions in rust code. This reduces --# the chance of proxy bypasses originating from rust code. --ifndef DEVELOPER_OPTIONS --ifndef MOZ_DEBUG_RUST --ifeq ($(OS_ARCH), Linux) -- $(call py_action,check_binary,--target --networking $@) --endif --endif --endif - - force-cargo-library-check: -- $(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag) -+ @true - else - force-cargo-library-check: - @true -diff -up firefox-68.0/python/mozbuild/mozbuild/action/check_binary.py.rust-network-check firefox-68.0/python/mozbuild/mozbuild/action/check_binary.py ---- firefox-68.0/python/mozbuild/mozbuild/action/check_binary.py.rust-network-check 2019-05-20 18:17:57.000000000 +0200 -+++ firefox-68.0/python/mozbuild/mozbuild/action/check_binary.py 2019-06-06 10:29:18.986737599 +0200 -@@ -250,43 +250,6 @@ def check_mozglue_order(target, binary): - raise RuntimeError('Could not parse readelf output?') - - --def check_networking(binary): -- retcode = 0 -- networking_functions = set([ -- # socketpair is not concerning; it is restricted to AF_UNIX -- "socket", "connect", "accept", "bind", "listen", -- "getsockname", "getsockopt", "setsockopt", -- "recv", "recvfrom", -- "send", "sendto", -- # We would be concerned by recvmsg and sendmsg; but we believe -- # they are okay as documented in 1376621#c23 -- "gethostbyname", "gethostbyaddr", "gethostent", "sethostent", "endhostent", -- "gethostent_r", "gethostbyname2", "gethostbyaddr_r", "gethostbyname_r", -- "gethostbyname2_r", -- "getaddrinfo", "getservent", "getservbyname", "getservbyport", "setservent", -- "getprotoent", "getprotobyname", "getprotobynumber", "setprotoent", -- "endprotoent"]) -- bad_occurences_names = set() -- -- try: -- for sym in at_least_one(iter_symbols(binary)): -- if sym['addr'] == 0 and sym['name'] in networking_functions: -- bad_occurences_names.add(sym['name']) -- except Empty: -- raise RuntimeError('Could not parse llvm-objdump output?') -- -- basename = os.path.basename(binary) -- if bad_occurences_names: -- s = 'TEST-UNEXPECTED-FAIL | check_networking | {} | Identified {} ' + \ -- 'networking function(s) being imported in the rust static library ({})' -- print(s.format(basename, len(bad_occurences_names), -- ",".join(sorted(bad_occurences_names))), -- file=sys.stderr) -- retcode = 1 -- elif buildconfig.substs.get('MOZ_AUTOMATION'): -- print('TEST-PASS | check_networking | {}'.format(basename)) -- return retcode -- - def checks(target, binary): - # The clang-plugin is built as target but is really a host binary. - # Cheat and pretend we were passed the right argument. -@@ -330,8 +293,6 @@ def main(args): - help='Perform checks for a host binary') - parser.add_argument('--target', action='store_true', - help='Perform checks for a target binary') -- parser.add_argument('--networking', action='store_true', -- help='Perform checks for networking functions') - - parser.add_argument('binary', metavar='PATH', - help='Location of the binary to check') -@@ -343,14 +304,7 @@ def main(args): - file=sys.stderr) - return 1 - -- if options.networking and options.host: -- print('--networking is only valid with --target', -- file=sys.stderr) -- return 1 -- -- if options.networking: -- return check_networking(options.binary) -- elif options.host: -+ if options.host: - return checks(HOST, options.binary) - elif options.target: - return checks(TARGET, options.binary) diff --git a/SPECS/firefox.spec b/SPECS/firefox.spec index 3c18ec3..7e8a7aa 100644 --- a/SPECS/firefox.spec +++ b/SPECS/firefox.spec @@ -1,29 +1,63 @@ # Set for local builds only %global disable_toolsets 0 -# Use system nspr/nss? FIXME -%if 0%{?rhel} == 8 -%global system_nss 1 +%ifarch i686 +# no debug package for the i686 because oom on i686 with debuginfos +%global debug_package %{nil} %endif -%if 0%{?rhel} == 7 + +%global rhel_minor_version -1 +%if "%{?dist}" == ".el8" +%global rhel_minor_version 3 +%endif +%if "%{?dist}" == ".el8_3" +%global rhel_minor_version 3 +%endif +%if "%{?dist}" == ".el8_2" +%global rhel_minor_version 2 +%endif +%if "%{?dist}" == ".el8_1" +%global rhel_minor_version 1 +%endif +%if "%{?dist}" == ".el8_0" +%global rhel_minor_version 0 +%endif + %global system_nss 1 +%global bundle_nss 0 + +%if 0%{?rhel} == 8 + %if 0%{?rhel_minor_version} < 2 +%global bundle_nss 1 + %endif %endif + %if 0%{?rhel} == 6 -%global system_nss 1 +%global system_nss 0 %endif + %define use_bundled_ffi 0 + +%define use_bundled_python_2 1 +%define use_bundled_python_3 1 + %if 0%{?rhel} == 8 %define use_bundled_python_2 1 %define use_bundled_python_3 0 -%else -%define use_bundled_python_2 1 -%define use_bundled_python_3 1 +%endif + +%if 0%{?rhel} == 7 +%define use_bundled_python_2 0 +%define use_bundled_python_3 0 %endif %if 0%{?flatpak:1} %define use_bundled_python_2 1 %endif +# we need python2 because of icu data gen +%define use_bundled_python_2 1 + %define bundle_gnome_extension 0 # Don't use system hunspell for now @@ -49,8 +83,8 @@ %if 0%{?rhel} == 6 %global dts_version 8 %endif -%global rust_version 1.31 -%global rust_toolset_version 1.35 +%global rust_version 1.41 +%global rust_toolset_version 1.41 %global llvm_version 7.0 %if 0%{?rhel} == 8 %global llvm_version 6.0 @@ -101,28 +135,13 @@ %global libvpx_version 1.4.0 %endif -%global rhel_minor_version -1 -%if "%{?dist}" == "el8" -%global rhel_minor_version 3 -%endif -%if "%{?dist}" == ".el8_2" -%global rhel_minor_version 2 -%endif -%if "%{?dist}" == ".el8_1" -%global rhel_minor_version 1 -%endif -%if "%{?dist}" == ".el8_0" -%global rhel_minor_version 0 -%endif - - %if 0%{?system_nss} -%global nspr_version 4.21 +%global nspr_version 4.25 # NSS/NSPR quite often ends in build override, so as requirement the version # we're building against could bring us some broken dependencies from time to time. #%global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536) %global nspr_build_version %{nspr_version} -%global nss_version 3.44 +%global nss_version 3.53.1 #%global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536) %global nss_build_version %{nss_version} %endif @@ -135,19 +154,25 @@ %define bundled_python_version_2 2.7.13 %define bundled_python_version_3 3.6.8 -%define use_bundled_yasm 1 %define use_bundled_openssl 0 %define use_bundled_nodejs 0 -%if 0%{?rhel} < 8 +%define use_bundled_yasm 0 + +%if 0%{?rhel} == 8 + %if 0%{?rhel_minor_version} <= 2 %define use_bundled_nodejs 1 -%if 0%{?rhel} == 6 -%define use_bundled_openssl 1 + %endif %endif + +%if 0%{?rhel} == 7 +%define use_bundled_nodejs 1 +%define use_bundled_yasm 1 %endif -# GTK3 bundling -%define avoid_bundled_rebuild 0 %if 0%{?rhel} == 6 +%define use_bundled_nodejs 1 +%define use_bundled_openssl 1 +%define use_bundled_yasm 1 %define bundle_gtk3 1 # In-tree libffi is able to build on following platforms, we have to bundle it for the rest %ifnarch x86_64 i686 aarch64 @@ -155,6 +180,9 @@ %endif %endif +# GTK3 bundling +%define avoid_bundled_rebuild 0 + %define gtk3_nvr 3.22.26-1 %define gtk3_install_path %{mozappdir}/bundled @@ -165,7 +193,6 @@ %define include_file() %{expand:%(cat '%1')} %endif - %global mozappdir %{_libdir}/%{name} %global mozappdirdev %{_libdir}/%{name}-devel-%{version} %global langpackdir %{mozappdir}/distribution/extensions @@ -185,7 +212,7 @@ Summary: Mozilla Firefox Web browser Name: firefox -Version: 68.12.0 +Version: 78.3.0 Release: 1%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -198,9 +225,9 @@ ExclusiveArch: i686 x86_64 ppc64 s390x Source0: https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz %if %{build_langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20200820.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20200918.tar.xz %endif -Source2: cbindgen-vendor.tar.xz +Source2: cbindgen-vendor-0.14.3.tar.xz Source10: firefox-mozconfig %if 0%{?centos} Source12: firefox-centos-default-prefs.js @@ -225,9 +252,12 @@ Source205: gtk3-private-%{gtk3_nvr}-setup-flags-env.inc Source206: gtk3-private-%{gtk3_nvr}-requires-provides-filter.inc Source301: yasm-1.2.0-3.el5.src.rpm Source303: libffi-3.0.13-18.el7_3.src.rpm -Source304: nodejs-8.11.4-1.3.fc27.src.rpm +Source304: nodejs-10.21.0-5.fc32.src.rpm Source305: openssl-1.0.2k-19.6.bundle.el7_7.src.rpm +Source403: nss-3.53.1-3.fc32.src.rpm +Source401: nss-setup-flags-env.inc +Source402: nspr-4.25.0-1.el8_0.src.rpm #Python %if 0%{?use_bundled_python_2} Source100: https://www.python.org/ftp/python/%{bundled_python_version_2}/Python-%{bundled_python_version_2}.tar.xz @@ -242,35 +272,27 @@ Patch1002: python-2.7-gcc8-fix.patch Patch1003: python-missing-utimensat.patch Patch1004: build-icu-make.patch # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1699374 -Patch2: rust-network-check.patch Patch4: build-mozconfig-fix.patch Patch6: build-nss-version.patch Patch7: firefox-debugedits-error.patch -Patch8: firefox-dont-check-binary.patch -Patch9: nss-build-mozilla-1564499.patch -Patch26: build-icu-big-endian.patch -Patch41: build-debug-qcms.patch # Fedora/RHEL specific patches Patch215: firefox-enable-addons.patch Patch219: rhbz-1173156.patch Patch224: mozilla-1170092.patch #ARM run-time patch -#Patch226: rhbz-1354671.patch Patch231: firefox-pipewire.patch Patch232: firefox-rhel6-hugepage.patch Patch233: firefox-rhel6-nss-tls1.3.patch Patch234: rhbz-1821418.patch Patch235: firefox-pipewire-0-3.patch +Patch236: fedora-shebang-build.patch # Upstream patches Patch402: mozilla-1196777.patch -#Patch500: debug.patch Patch501: python-encode.patch -Patch502: mozilla-1603112-accept-lang.patch Patch503: mozilla-s390-context.patch -Patch504: mozilla-nestegg-big-endian.patch Patch505: mozilla-bmo1005535.patch Patch506: mozilla-bmo1504834-part1.patch Patch507: mozilla-bmo1504834-part2.patch @@ -279,6 +301,11 @@ Patch509: mozilla-bmo1504834-part4.patch Patch510: mozilla-bmo1554971.patch Patch511: mozilla-bmo1602730.patch Patch512: mozilla-bmo849632.patch +Patch513: mozilla-bmo998749.patch +Patch514: mozilla-s390x-skia-gradient.patch +Patch515: mozilla-bmo1626236.patch +Patch516: D87019-thin-vec-big-endian.diff + # CentOS patches %if 0%{?centos} @@ -286,11 +313,21 @@ Patch10000: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch Patch10001: Bug-1526653---fix_user_vfp_armv7.patch %endif +# RHEL6 patches +Patch600: rhel6-dbusver.patch +Patch601: rhel6-kernel.patch +Patch602: rhel6-mach-fail.patch +Patch603: rhel6-zconst.patch +Patch604: rhel6-auxvh.patch +Patch605: rhel6-abiv2-mozbz1642174.patch + %if %{?system_nss} +%if !0%{?bundle_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} BuildRequires: nss-static >= %{nss_version} %endif +%endif %if %{?system_cairo} BuildRequires: pkgconfig(cairo) >= %{cairo_version} %endif @@ -340,6 +377,7 @@ BuildRequires: llvm-toolset-%{llvm_version}-llvm-devel %endif BuildRequires: scl-utils +BuildRequires: findutils %if 0%{?rhel} == 8 @@ -351,24 +389,36 @@ BuildRequires: clang >= %{llvm_version} BuildRequires: clang-devel >= %{llvm_version} BuildRequires: rustfmt >= %{rust_version} BuildRequires: python3 -BuildRequires: nodejs >= 8.11 +BuildRequires: nodejs >= 10.21 %else %if 0%{?use_rustts} BuildRequires: rust-toolset-%{rust_toolset_version} %endif +%if 0%{?rhel} == 7 +#BuildRequires: rh-nodejs12 +%endif %if 0%{?use_llvmts} BuildRequires: llvm-toolset-%{llvm_version} BuildRequires: llvm-toolset-%{llvm_version}-llvm-devel %endif %endif +%if ! 0%{?use_bundled_yasm} +BuildRequires: yasm +%endif + + %if 0%{?use_bundled_python_2} # Needed for Python in RHEL6 BuildRequires: openssl-devel %endif %if 0%{?rhel} == 8 + %if 0%{?rhel_minor_version} >= 3 +BuildRequires: pkgconfig(libpipewire-0.3) + %else BuildRequires: pipewire-devel + %endif %endif %if 0%{?bundle_gtk3} @@ -416,16 +466,37 @@ BuildRequires: gtk3-devel BuildRequires: glib2-devel %endif +# Bundled nss/nspr requirement +%if 0%{?bundle_nss} +BuildRequires: nss-softokn +BuildRequires: sqlite-devel +BuildRequires: zlib-devel +BuildRequires: pkgconfig +BuildRequires: gawk +BuildRequires: psmisc +%if 0%{?rhel} == 6 +BuildRequires: perl +%else +BuildRequires: perl-interpreter +%endif +BuildRequires: gcc-c++ +BuildRequires: xmlto +%endif + Requires: mozilla-filesystem Requires: p11-kit-trust %if %{?system_nss} +%if !0%{?bundle_nss} Requires: nspr >= %{nspr_build_version} Requires: nss >= %{nss_build_version} %endif +%endif BuildRequires: desktop-file-utils BuildRequires: system-bookmarks Requires: redhat-indexhtml +#for the python2 +BuildRequires: pkgconfig(sqlite3) %if %{?system_sqlite} BuildRequires: pkgconfig(sqlite3) >= %{sqlite_version} Requires: sqlite >= %{sqlite_build_version} @@ -442,6 +513,19 @@ BuildRequires: pkgconfig(libffi) %endif %endif +%if %{?use_bundled_nodejs} +%if !0%{?use_bundled_python_3} +BuildRequires: python3-devel +%endif +BuildRequires: zlib-devel +#BuildRequires: brotli-devel +#BuildRequires: gcc >= 4.9.4 +#BuildRequires: gcc-c++ >= 4.9.4 +BuildRequires: chrpath +BuildRequires: libatomic +BuildRequires: openssl-devel +%endif + Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -504,6 +588,20 @@ https://extensions.gnome.org. %endif %prep +echo "Build environment" +echo "dist %{?dist}" +echo "RHEL 8 minor version: %{?rhel_minor_version}" +echo "use_bundled_ffi %{?use_bundled_ffi}" +echo "use_bundled_python_2 %{?use_bundled_python_2}" +echo "use_bundled_python_3 %{?use_bundled_python_3}" +echo "bundle_nss %{?bundle_nss}" +echo "system_nss %{?system_nss}" +echo "use_rustts %{?use_rustts}" +echo "use_bundled_nodejs %{?use_bundled_nodejs}" +echo "use_bundled_openssl %{?use_bundled_openssl}" +echo "use_bundled_yasm %{?use_bundled_yasm}" + + %if 0%{?use_bundled_python_2} %setup -q -T -c -n python2 -a 100 %patch1000 -p0 -b .build @@ -519,22 +617,13 @@ https://extensions.gnome.org. # Build patches, can't change backup suffix from default because during build # there is a compare of config and js/config directories and .orig suffix is # ignored during this compare. -%patch2 -p1 -b .rust-network-check %patch7 -p1 -b .debugedits-error %ifarch %{ix86} %{arm} ppc # binary check fails OOM on 32bit arches -%patch8 -p1 -b .dont-check-binary %endif -%patch9 -p1 -b .nss-build-mozilla-1564499 - -%if %{?debug_build} -%patch41 -p1 -b .build-debug-qcms -%endif -#%if 0%{?rhel} == 8 -#%endif %patch4 -p1 -b .build-mozconfig-fix -%patch6 -p1 -b .nss-version +#%patch6 -p1 -b .nss-version # Fedora patches %patch215 -p1 -b .addons @@ -547,30 +636,23 @@ https://extensions.gnome.org. %patch231 -p1 -b .pipewire %endif %endif + +#%patch236 -p1 -b .fedora-shebang-build + %if 0%{?rhel} == 6 %patch232 -p1 -b .hugepage %patch233 -p1 -b .rhel6-nss-tls1.3 %endif %patch234 -p1 -b .rhbz-1821418 - -#ARM run-time patch -#%ifarch aarch64 -#%patch226 -p1 -b .1354671 -#%endif - %patch402 -p1 -b .1196777 # Patch for big endian platforms only %if 0%{?big_endian} -%patch26 -p1 -b .icu %endif -#%patch500 -p1 -b .debug %patch501 -p1 -b .python-encode -%patch502 -p1 -b .1603112-accept-lang %patch503 -p1 -b .mozilla-s390-context -%patch504 -p1 -b .mozilla-nestegg-big-endian %patch505 -p1 -b .mozilla-bmo1005535 %patch506 -p1 -b .mozilla-bmo1504834-part1 %patch507 -p1 -b .mozilla-bmo1504834-part2 @@ -579,9 +661,24 @@ https://extensions.gnome.org. %patch510 -p1 -b .mozilla-bmo1554971 %patch511 -p1 -b .mozilla-bmo1602730 %patch512 -p1 -b .mozilla-bmo849632 +%patch513 -p1 -b .mozilla-bmo998749 +%patch514 -p1 -b .mozilla-s390x-skia-gradient +%patch515 -p1 -b .mozilla-bmo1626236 +%patch516 -p1 -b .D87019-thin-vec-big-endian.diff + + %patch1001 -p1 -b .ppc64le-inline %patch1004 -p1 -b .icu-make +%if 0%{?rhel} == 6 +%patch600 -p1 -b .rhel6-dbusver +%patch601 -p1 -b .rhel6-kernel +%patch602 -p1 -b .rhel6-mach-fail +%patch603 -p1 -b .rhel6-zconst +%patch604 -p1 -b .rhel6-auxvh +%patch605 -p1 -b .rhel6-abiv2-mozbz1642174 +%endif + # CentOS patches %if 0%{?centos} %patch10000 -p1 -b .mozilla-1238661 @@ -604,12 +701,6 @@ echo "ac_add_options --without-system-nspr" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig %endif -%if %{?system_sqlite} -echo "ac_add_options --enable-system-sqlite" >> .mozconfig -%else -echo "ac_add_options --disable-system-sqlite" >> .mozconfig -%endif - %if %{?system_cairo} echo "ac_add_options --enable-system-cairo" >> .mozconfig %else @@ -692,18 +783,32 @@ echo "ac_add_options --with-system-icu" >> .mozconfig echo "ac_add_options --without-system-icu" >> .mozconfig %endif %ifarch s390 s390x -echo "ac_add_options --disable-ion" >> .mozconfig +echo "ac_add_options --disable-jit" >> .mozconfig +%endif + +%ifnarch %{ix86} +%if !0%{?debug_build} +echo "ac_add_options --disable-debug-symbols" >> .mozconfig +%endif %endif echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs +chmod a-x third_party/rust/gfx-backend-vulkan/src/*.rs +chmod a-x third_party/rust/gfx-hal/src/*.rs +chmod a-x third_party/rust/ash/src/extensions/ext/*.rs +chmod a-x third_party/rust/ash/src/extensions/khr/*.rs +chmod a-x third_party/rust/ash/src/extensions/mvk/*.rs +chmod a-x third_party/rust/ash/src/extensions/nv/*.rs #--------------------------------------------------------------------- %build -set -e +ulimit -a +free +#set -e # Hack for missing shell when building in brew on RHEL6 %if 0%{?rhel} == 6 export SHELL=/bin/sh @@ -724,7 +829,9 @@ function install_rpms_to_current_dir() { %ifarch i386 i686 ARCH_STR="i?86" %endif - PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %if 0%{?rhel} > 6 + PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %endif fi for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM) @@ -738,6 +845,7 @@ function build_bundled_package() { PACKAGE_RPM=$1 PACKAGE_FILES=$2 PACKAGE_SOURCE=$3 + PACKAGE_BUILD_OPTIONS=$4 export PACKAGE_DIR="%{_topdir}/RPMS" PACKAGE_ALREADY_BUILD=0 @@ -751,20 +859,25 @@ function build_bundled_package() { %endif if [ $PACKAGE_ALREADY_BUILD == 0 ]; then echo "Rebuilding $PACKAGE_RPM from $PACKAGE_SOURCE"; echo "===============================" - rpmbuild --nodeps --rebuild $PACKAGE_SOURCE + rpmbuild --nodeps $PACKAGE_BUILD_OPTIONS --rebuild $PACKAGE_SOURCE + cat /var/tmp/rpm-tmp* fi + find $PACKAGE_DIR if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then # Hack for tps tests ARCH_STR=%{_arch} %ifarch i386 i686 ARCH_STR="i?86" %endif - export PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %if 0%{?rhel} > 6 + export PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %endif fi pushd $PACKAGE_DIR echo "Installing $PACKAGE_DIR/$PACKAGE_RPM"; echo "===============================" + pwd PACKAGE_LIST=$(echo $PACKAGE_DIR/$PACKAGE_RPM | tr " " "\n") for PACKAGE in $PACKAGE_LIST do @@ -786,10 +899,60 @@ function build_bundled_package() { # Build and install local yasm if needed # ====================================== -%if %{use_bundled_yasm} +%if 0%{?use_bundled_yasm} build_bundled_package 'yasm-1*.rpm' 'yasm-*.rpm' '%{SOURCE301}' %endif +%if 0%{?bundle_nss} + rpm -ivh %{SOURCE402} + #rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' --without=tests -ba %{_specdir}/nspr.spec + rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/nspr.spec + pushd %{_buildrootdir} + install_rpms_to_current_dir nspr-4*.rpm + install_rpms_to_current_dir nspr-devel*.rpm + popd + echo "Setting nspr flags" + # nss-setup-flags-env.inc + sed -i 's@%{gtk3_install_path}@%{_buildrootdir}%{gtk3_install_path}@g' %{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig/nspr*.pc + + export LDFLAGS="-L%{_buildrootdir}%{gtk3_install_path}/%{_lib} $LDFLAGS" + export LDFLAGS="-Wl,-rpath,%{gtk3_install_path}/%{_lib} $LDFLAGS" + export LDFLAGS="-Wl,-rpath-link,%{_buildrootdir}%{gtk3_install_path}/%{_lib} $LDFLAGS" + export PKG_CONFIG_PATH=%{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig + export PATH="{_buildrootdir}%{gtk3_install_path}/bin:$PATH" + + #%include_file %{SOURCE401} + export PATH=%{_buildrootdir}/%{gtk3_install_path}/bin:$PATH + echo $PKG_CONFIG_PATH + + rpm -ivh %{SOURCE403} + rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/nss.spec + pushd %{_buildrootdir} + #cleanup + #rm -rf {_buildrootdir}/usr/lib/debug/* + #rm -rf {_buildrootdir}/usr/lib/.build-id + #install_rpms_to_current_dir nss-%{gtk3_nvr}*.rpm + #install_rpms_to_current_dir nss-devel-%{gtk3_nvr}*.rpm + install_rpms_to_current_dir nss-3*.rpm + install_rpms_to_current_dir nss-devel*.rpm + install_rpms_to_current_dir nss-pkcs11-devel*.rpm + install_rpms_to_current_dir nss-softokn-3*.rpm + install_rpms_to_current_dir nss-softokn-devel*.rpm + install_rpms_to_current_dir nss-softokn-freebl-3*.rpm + install_rpms_to_current_dir nss-softokn-freebl-devel*.rpm + install_rpms_to_current_dir nss-util-3*.rpm + install_rpms_to_current_dir nss-util-devel*.rpm + popd + %filter_provides_in %{gtk3_install_path}/%{_lib} + %filter_requires_in %{gtk3_install_path}/%{_lib} + %filter_from_requires /libnss3.so.*/d + %filter_from_requires /libsmime3.so.*/d + %filter_from_requires /libssl3.so.*/d + %filter_from_requires /libnssutil3.so.*/d + %filter_from_requires /libnspr4.so.*/d + +%endif + %if 0%{?bundle_gtk3} %if ! 0%{?avoid_bundled_rebuild} rpm -ivh %{SOURCE200} @@ -820,7 +983,7 @@ function build_bundled_package() { # If needed build the bundled python 2.7 and 3.6 and put it in the PATH %if 0%{?use_bundled_python_3} pushd %{_builddir}/python3/Python-%{bundled_python_version_3} - ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" --with-pydebug + ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" || cat config.log make %{?_smp_mflags} install V=1 -j1 cp Tools/scripts/pathfix.py %{_buildrootdir}/bin popd @@ -829,7 +992,7 @@ function build_bundled_package() { pushd %{_builddir}/python2/Python-%{bundled_python_version_2} ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" || cat config.log make %{?_smp_mflags} install V=1 - popd + popd %endif function replace_prefix() { @@ -875,10 +1038,15 @@ source scl_source enable devtoolset-%{dts_version} source scl_source enable rust-toolset-%{rust_toolset_version} %endif +env +which gcc +which c++ +which g++ +which ld # Build and install local node if needed # ====================================== %if %{use_bundled_nodejs} - build_bundled_package 'nodejs-8*.rpm' 'nodejs-*.rpm' %{SOURCE304} + build_bundled_package 'nodejs-10*.rpm' 'nodejs-*.rpm npm-*.rpm' %{SOURCE304} "--with bootstrap" export MOZ_NODEJS=$PACKAGE_DIR/usr/bin/node %else export MOZ_NODEJS=/usr/bin/node @@ -914,6 +1082,9 @@ case "%{sqlite_build_version}" in esac %endif +# debug missing sqlite3 python module +./mach python -c "import sys;print(sys.path)" + %if 0%{?big_endian} echo "Generate big endian version of config/external/icu/data/icud64l.dat" ./mach python intl/icu_sources_data.py . @@ -925,6 +1096,7 @@ echo "Generate big endian version of config/external/icu/data/icud64l.dat" mkdir %{_buildrootdir}/bin || : cp %{SOURCE28} %{_buildrootdir}/bin || : +chmod +x %{_buildrootdir}/bin/node-stdout-nonblocking-wrapper # Update the various config.guess to upstream release for aarch64 support find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';' @@ -961,14 +1133,20 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/') # (OOM when linking, rhbz#1238225) export MOZ_DEBUG_FLAGS=" " %endif -%ifarch s390 %{arm} ppc aarch64 i686 + +# We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss +MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT" + +%ifarch s390 %{arm} ppc aarch64 i686 x86_64 s390x MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif -%ifarch %{arm} %{ix86} -export RUSTFLAGS="-Cdebuginfo=0" +%ifarch %{arm} i686 +MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--strip-debug" +echo "ac_add_options --enable-linker=gold" >> .mozconfig %endif -%ifarch %{ix86} -export PROFILE=release + +%ifarch %{arm} i686 +export RUSTFLAGS="-Cdebuginfo=0" %endif export CFLAGS=$MOZ_OPT_FLAGS export CXXFLAGS=$MOZ_OPT_FLAGS @@ -990,20 +1168,58 @@ MOZ_SMP_FLAGS=-j1 [ -z "$RPM_BUILD_NCPUS" ] && \ RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j2 -[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j2 +[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 +[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j4 %endif %endif +cat /proc/meminfo +# Free memory in kB + +MEM_AVAILABLE=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }') + +# Usually the compiler processes can take 2 GB of memory at peaks +TASK_SIZE=4000000 +MEM_CONSTRAINED_JOBS=$(( MEM_AVAILABLE / TASK_SIZE )) +CPU_AVAILABLE=$(/usr/bin/getconf _NPROCESSORS_ONLN) +# Pick the minimum from available CPUs or memory constrained number of jobs +#MOZ_SMP_FLAGS=-j$([ "$CPU_AVAILABLE" -le "$MEM_CONSTRAINED_JOBS" ] && echo "$CPU_AVAILABLE" || echo "$MEM_CONSTRAINED_JOBS") + %if 0%{?bundle_gtk3} # gtk3-private-setup-flags-env.inc %include_file %{SOURCE205} %endif +%if 0%{?bundle_nss} +echo "Setting nss flags" +# nss-setup-flags-env.inc +%include_file %{SOURCE401} +export PATH=%{_buildrootdir}/%{gtk3_install_path}/bin:$PATH +echo $PKG_CONFIG_PATH +%endif + export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" export MOZ_SERVICES_SYNC="1" +# we need to strip the sources on i686 because to we don't use rpm to generate debugsymbols because of oom +%ifnarch i686 i386 export STRIP=/bin/true +%endif +which node +echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' +env +ls %{_buildrootdir} + + +%if 0%{?rhel} == 6 +export POLICY_FILE="rhel6.config" +export POLICT_PATH="/etc/pki/nss-legacy" +%endif + +%if 0%{?use_llvmts} +scl enable llvm-toolset-%{llvm_version} './mach build -v' +%else ./mach build -v +%endif # create debuginfo for crash-stats.mozilla.com %if %{enable_mozilla_crashreporter} @@ -1048,7 +1264,6 @@ rm -f objdir/dist/bin/pk12util export SHELL=/bin/sh %endif -%if 0%{?bundle_gtk3} function install_rpms_to_current_dir() { PACKAGE_RPM=$(eval echo $1) PACKAGE_DIR=%{_rpmdir} @@ -1059,7 +1274,9 @@ function install_rpms_to_current_dir() { %ifarch i386 i686 ARCH_STR="i?86" %endif - PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %if 0%{?rhel} > 6 + PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + %endif fi for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM) @@ -1069,6 +1286,7 @@ function install_rpms_to_current_dir() { done } +%if 0%{?bundle_gtk3} pushd %{buildroot} # Install gtk3-private again to the buildroot, but without devel subpackage install_rpms_to_current_dir gtk3-private-%{gtk3_nvr}*.rpm @@ -1076,6 +1294,29 @@ install_rpms_to_current_dir gtk3-private-rpm-scripts-%{gtk3_nvr}*.rpm popd %endif +%if 0%{?bundle_nss} + pushd %{buildroot} + #install_rpms_to_current_dir nss-*.rpm + install_rpms_to_current_dir nspr-4*.rpm + install_rpms_to_current_dir nss-3*.rpm + install_rpms_to_current_dir nss-softokn-3*.rpm + install_rpms_to_current_dir nss-softokn-freebl-3*.rpm + install_rpms_to_current_dir nss-util-3*.rpm + + # cleanup unecessary nss files + #rm -rf %{_buildrootdir}/%{gtk3_install_path}/bin + #rm -rf %{_buildrootdir}/%{gtk3_install_path}/include + rm -rf %{buildroot}/%{gtk3_install_path}/lib/dracut + rm -rf %{buildroot}/%{gtk3_install_path}/%{_lib}/nss + #rm -rf %{_buildrootdir}/%{gtk3_install_path}/%{_lib}/pkgconfig + rm -rf %{buildroot}/%{gtk3_install_path}/%{_lib}/share + rm -rf %{buildroot}/%{gtk3_install_path}/share + rm -rf %{buildroot}/etc/pki + rm -rf %{buildroot}/usr/lib/.build-id + rm -rf %{buildroot}/etc/crypto-policies + popd +%endif + # Install bundled libffi %if %{use_bundled_ffi} pushd %{buildroot} @@ -1278,7 +1519,6 @@ if [ $1 -eq 0 ]; then %{__rm} -rf %{mozappdir}/components %{__rm} -rf %{mozappdir}/extensions %{__rm} -rf %{mozappdir}/plugins - %{__rm} -rf %{langpackdir} fi %clean @@ -1288,6 +1528,10 @@ rm -rf %{_srcrpmdir}/libffi*.src.rpm find %{_rpmdir} -name "libffi*.rpm" -delete rm -rf %{_srcrpmdir}/openssl*.src.rpm find %{_rpmdir} -name "openssl*.rpm" -delete +rm -rf %{_srcrpmdir}/nss*.src.rpm +find %{_rpmdir} -name "nss*.rpm" -delete +rm -rf %{_srcrpmdir}/nspr*.src.rpm +find %{_rpmdir} -name "nspr*.rpm" -delete %post update-desktop-database &> /dev/null || : @@ -1329,17 +1573,14 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %dir %{mozappdir} %doc %{mozappdir}/LICENSE %{mozappdir}/browser/chrome -%{mozappdir}/browser/chrome.manifest %{mozappdir}/defaults/preferences/* %{mozappdir}/browser/defaults/preferences %{mozappdir}/browser/features/*.xpi %{mozappdir}/distribution/distribution.ini -%attr(644, root, root) %{mozappdir}/browser/blocklist.xml %if %{build_langpacks} %dir %{langpackdir} %endif %{mozappdir}/browser/omni.ja -%{mozappdir}/chrome.manifest %{mozappdir}/run-mozilla.sh %{mozappdir}/application.ini %{mozappdir}/pingsender @@ -1368,13 +1609,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{mozappdir}/plugin-container %{mozappdir}/gmp-clearkey %{mozappdir}/fonts/*.ttf -%if !%{?system_libicu} -#%{mozappdir}/icudt*.dat -%endif %if !%{?system_nss} -%{mozappdir}/libfreeblpriv3.chk -%{mozappdir}/libnssdbm3.chk -%{mozappdir}/libsoftokn3.chk %exclude %{mozappdir}/libnssckbi.so %endif %if 0%{use_bundled_ffi} @@ -1387,14 +1622,30 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %include_file %{SOURCE204} %endif +%if 0%{?bundle_nss} +%{mozappdir}/bundled/%{_lib}/libfreebl* +%{mozappdir}/bundled/%{_lib}/libnss3* +%{mozappdir}/bundled/%{_lib}/libnssdbm3* +%{mozappdir}/bundled/%{_lib}/libnssutil3* +%{mozappdir}/bundled/%{_lib}/libsmime3* +%{mozappdir}/bundled/%{_lib}/libsoftokn* +%{mozappdir}/bundled/%{_lib}/libssl3* +%{mozappdir}/bundled/%{_lib}/libnspr4.so +%{mozappdir}/bundled/%{_lib}/libplc4.so +%{mozappdir}/bundled/%{_lib}/libplds4.so +%endif + #--------------------------------------------------------------------- %changelog -* Thu Aug 20 2020 Jan Horak -- Update to 68.12.0 build1 +* Fri Sep 18 2020 Jan Horak +- Update to 78.3.0 build1 + +* Tue Aug 18 2020 Jan Horak - 78.2.0-3 +- Update to 78.2.0 build1 -* Thu Jul 23 2020 Jan Horak +* Fri Jul 24 2020 Jan Horak - Update to 68.11.0 build1 * Fri Jun 26 2020 Jan Horak