diff --git a/recipes-browser/firefox/firefox/fixes/rust-libloading-revert-weak-static.patch b/recipes-browser/firefox/firefox/fixes/rust-libloading-revert-weak-static.patch new file mode 100644 index 000000000..d03ee2776 --- /dev/null +++ b/recipes-browser/firefox/firefox/fixes/rust-libloading-revert-weak-static.patch @@ -0,0 +1,129 @@ +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/.cargo-checksum.json firefox-60.4.0/third_party/rust/libloading/.cargo-checksum.json +--- firefox-60.4.0-bak/third_party/rust/libloading/.cargo-checksum.json 2018-12-04 08:10:56.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/.cargo-checksum.json 2018-12-18 16:29:24.343635721 +0900 +@@ -1 +1 @@ +-{"files":{".travis.yml":"3c9d7103068d644d68f5d0f9dd6a9ba00eb86bfb4cfc2c2c14c8a853144fcf09","Cargo.toml":"5bc50b6714c71bebc3b616d276e3c73c34ebd375ec99fcaba76b29ac5685e696","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"b4cd83f110d01dc5aa8fcaf3da34bdbe1478efdba767d73abc14d4d87e4775fa","appveyor.yml":"8382c7f1769f6cf78029a221058c4d73f35a48308b5dfc38d875facabec1c139","build.rs":"dd60f6fc4cef3f02f56b74b6f03ed665ee8ce47e4040e2919282289affa1aca8","src/changelog.rs":"1ac991741280fdd9c5268d617ae7279d08146cfb3222b86e32315ff90b392598","src/lib.rs":"c17a20b5b9125b5a6d7b0913c35448ee688795f3e03f7bf1bf0aaf3e7e4e729e","src/os/mod.rs":"51d733e5522dacd6069642ad66aa6d7acf6c82950c934eb040e8dfd112e6d610","src/os/unix/global_static.c":"b1096dedf7d4aed5c28b658fc917f6603339ffd92390c84e25cb543bdc9460ac","src/os/unix/mod.rs":"717c09d09c20b14b8b8344899ffc3448ef23cf230ec61536a9fd53e8900d05ee","src/os/windows/mod.rs":"0b648941117a1573501ce1be5fcd11416361e1fe9c19a49f0826569a6cbc400a","src/test_helpers.rs":"3a55052e8cd5231e97d9282b43398c2f144c57ced2d2df64bde7f482f5c778e7","src/util.rs":"0b0155448a26db4b00b2a6ca129e0e1f6f75870c56c9777d262941818c7581b7","tests/functions.rs":"4633f3673db6a5b3623ea8927b13314c25502c9fbb63bb17a5a35650ea489012","tests/markers.rs":"8e9c1b883404d9190e4f23ed39b3d6cbbccb3a07883f733b04aed4357b9c6aca","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"} +\ ファイル末尾に改行がありません ++{"files":{".travis.yml":"3c9d7103068d644d68f5d0f9dd6a9ba00eb86bfb4cfc2c2c14c8a853144fcf09","Cargo.toml":"d8001e8b4d0c2930492cfed9731395da77f495783d969b4fd9aaae43c2184dd0","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"b4cd83f110d01dc5aa8fcaf3da34bdbe1478efdba767d73abc14d4d87e4775fa","appveyor.yml":"8382c7f1769f6cf78029a221058c4d73f35a48308b5dfc38d875facabec1c139","build.rs":"b0cab713feb1fa86fec27af607272f2964e79cca6637ae837a1dfd9d88b67dd4","src/changelog.rs":"1ac991741280fdd9c5268d617ae7279d08146cfb3222b86e32315ff90b392598","src/lib.rs":"1f2751c7978d45010da9fc97cf6fda1f8e439910ce55f814f8d0019ca388639c","src/os/mod.rs":"51d733e5522dacd6069642ad66aa6d7acf6c82950c934eb040e8dfd112e6d610","src/os/unix/mod.rs":"2af876458bf0012f7c0a06e8e976aff897410e22f3776c34ab1f2aa79fbd59aa","src/os/windows/mod.rs":"0b648941117a1573501ce1be5fcd11416361e1fe9c19a49f0826569a6cbc400a","src/test_helpers.rs":"3a55052e8cd5231e97d9282b43398c2f144c57ced2d2df64bde7f482f5c778e7","src/util.rs":"0b0155448a26db4b00b2a6ca129e0e1f6f75870c56c9777d262941818c7581b7","tests/functions.rs":"4633f3673db6a5b3623ea8927b13314c25502c9fbb63bb17a5a35650ea489012","tests/markers.rs":"8e9c1b883404d9190e4f23ed39b3d6cbbccb3a07883f733b04aed4357b9c6aca","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"7711dfe19062d91356cd127546542b1b6e13aeef76ad3098f32c8a6ae319b66a"},"package":"9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"} +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/Cargo.toml firefox-60.4.0/third_party/rust/libloading/Cargo.toml +--- firefox-60.4.0-bak/third_party/rust/libloading/Cargo.toml 2018-12-04 08:10:56.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/Cargo.toml 2018-12-18 16:09:47.258622441 +0900 +@@ -20,8 +20,8 @@ + keywords = ["dlopen", "load", "shared", "dylib"] + license = "ISC" + repository = "https://github.com/nagisa/rust_libloading/" +-[build-dependencies.cc] +-version = "1.0" ++[dependencies] ++lazy_static = "1" + [target."cfg(windows)".dependencies.winapi] + version = "0.3" + features = ["winerror", "errhandlingapi", "libloaderapi"] +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/build.rs firefox-60.4.0/third_party/rust/libloading/build.rs +--- firefox-60.4.0-bak/third_party/rust/libloading/build.rs 2018-12-04 08:10:56.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/build.rs 2018-12-18 16:09:47.262622395 +0900 +@@ -1,11 +1,8 @@ +-extern crate cc; +- + use std::io::Write; + use std::env; + + fn main(){ + let target_os = env::var("CARGO_CFG_TARGET_OS"); +- let is_unix = env::var_os("CARGO_CFG_UNIX").is_some(); + match target_os.as_ref().map(|x| &**x) { + Ok("linux") | Ok("android") => println!("cargo:rustc-link-lib=dl"), + Ok("freebsd") | Ok("dragonfly") => println!("cargo:rustc-link-lib=c"), +@@ -23,9 +20,4 @@ + ::std::process::exit(0xfc); + } + } +- if is_unix { +- cc::Build::new() +- .file("src/os/unix/global_static.c") +- .compile("global_static"); +- } + } +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/src/lib.rs firefox-60.4.0/third_party/rust/libloading/src/lib.rs +--- firefox-60.4.0-bak/third_party/rust/libloading/src/lib.rs 2018-12-04 08:10:56.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/src/lib.rs 2018-12-18 16:09:47.262622395 +0900 +@@ -42,6 +42,10 @@ + use std::marker; + + #[cfg(unix)] ++#[macro_use] ++extern crate lazy_static; ++ ++#[cfg(unix)] + use self::os::unix as imp; + #[cfg(windows)] + use self::os::windows as imp; +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/src/os/unix/global_static.c firefox-60.4.0/third_party/rust/libloading/src/os/unix/global_static.c +--- firefox-60.4.0-bak/third_party/rust/libloading/src/os/unix/global_static.c 2018-12-04 08:09:58.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/src/os/unix/global_static.c 1970-01-01 09:00:00.000000000 +0900 +@@ -1,20 +0,0 @@ +-#include +-#include +- +-pthread_mutex_t __attribute__((weak)) rust_libloading_dlerror_mutex = PTHREAD_MUTEX_INITIALIZER; +- +-void __attribute__((weak)) +-rust_libloading_dlerror_mutex_lock(void) +-{ +- if (pthread_mutex_lock(&rust_libloading_dlerror_mutex) != 0) { +- abort(); +- } +-} +- +-void __attribute__((weak)) +-rust_libloading_dlerror_mutex_unlock(void) +-{ +- if (pthread_mutex_unlock(&rust_libloading_dlerror_mutex) != 0) { +- abort(); +- } +-} +diff -Nur firefox-60.4.0-bak/third_party/rust/libloading/src/os/unix/mod.rs firefox-60.4.0/third_party/rust/libloading/src/os/unix/mod.rs +--- firefox-60.4.0-bak/third_party/rust/libloading/src/os/unix/mod.rs 2018-12-04 08:10:56.000000000 +0900 ++++ firefox-60.4.0/third_party/rust/libloading/src/os/unix/mod.rs 2018-12-18 16:09:47.262622395 +0900 +@@ -4,29 +4,10 @@ + use std::{fmt, io, marker, mem, ptr}; + use std::os::raw; + use std::os::unix::ffi::OsStrExt; ++use std::sync::Mutex; + +-extern "C" { +- fn rust_libloading_dlerror_mutex_lock(); +- fn rust_libloading_dlerror_mutex_unlock(); +-} +- +-struct DlerrorMutexGuard(()); +- +-impl DlerrorMutexGuard { +- fn new() -> DlerrorMutexGuard { +- unsafe { +- rust_libloading_dlerror_mutex_lock(); +- } +- DlerrorMutexGuard(()) +- } +-} +- +-impl Drop for DlerrorMutexGuard { +- fn drop(&mut self) { +- unsafe { +- rust_libloading_dlerror_mutex_unlock(); +- } +- } ++lazy_static! { ++ static ref DLERROR_MUTEX: Mutex<()> = Mutex::new(()); + } + + // libdl is crazy. +@@ -38,7 +19,7 @@ + where F: FnOnce() -> Option { + // We will guard all uses of libdl library with our own mutex. This makes libdl + // safe to use in MT programs provided the only way a program uses libdl is via this library. +- let _lock = DlerrorMutexGuard::new(); ++ let _lock = DLERROR_MUTEX.lock(); + // While we could could call libdl here to clear the previous error value, only the dlsym + // depends on it being cleared beforehand and only in some cases too. We will instead clear the + // error inside the dlsym binding instead. diff --git a/recipes-browser/firefox/firefox_60esr.inc b/recipes-browser/firefox/firefox_60esr.inc index 9b196fd81..d5dc7d7b2 100644 --- a/recipes-browser/firefox/firefox_60esr.inc +++ b/recipes-browser/firefox/firefox_60esr.inc @@ -30,6 +30,7 @@ SRC_URI = "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${P file://fixes/0001-Add-a-preference-to-force-enable-touch-events-withou.patch \ file://fixes/fix-get-cpu-feature-definition-conflict.patch \ file://fixes/fix-camera-permission-dialg-doesnot-close.patch \ + file://fixes/rust-libloading-revert-weak-static.patch \ file://gn-configs/x64_False_arm64_linux.json \ file://gn-configs/x64_False_arm_linux.json \ "