!8 Fix firefox build with rust 1.38

Merge pull request !8 from ultra_planet/master
This commit is contained in:
openeuler-ci-bot 2020-08-03 11:14:14 +08:00 committed by Gitee
commit cdf9afc1d9
8 changed files with 373 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From f8f381bf03b528000e3269451efe945a38fe5f0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Sun, 13 Jan 2019 21:42:38 +0100
Subject: [PATCH] Bug 1519629 - Document a few more macros.
---
servo/components/style/gecko/regen_atoms.py | 1 +
servo/components/style/gecko_string_cache/namespace.rs | 2 ++
2 files changed, 3 insertions(+)
diff --git a/servo/components/style/gecko/regen_atoms.py b/servo/components/style/gecko/regen_atoms.py
index 3666121..fde5463 100755
--- a/servo/components/style/gecko/regen_atoms.py
+++ b/servo/components/style/gecko/regen_atoms.py
@@ -202,6 +202,7 @@ RULE_TEMPLATE = ('("{atom}") =>\n '
' }}}};')
MACRO = '''
+/// Returns a static atom by passing the literal string it represents.
#[macro_export]
macro_rules! atom {{
{}
diff --git a/servo/components/style/gecko_string_cache/namespace.rs b/servo/components/style/gecko_string_cache/namespace.rs
index aad7b03..cf01819 100644
--- a/servo/components/style/gecko_string_cache/namespace.rs
+++ b/servo/components/style/gecko_string_cache/namespace.rs
@@ -11,6 +11,8 @@ use std::fmt;
use std::ops::Deref;
use string_cache::{Atom, WeakAtom};
+/// In Gecko namespaces are just regular atoms, so this is a simple macro to
+/// forward one macro to the other.
#[macro_export]
macro_rules! ns {
() => {

View File

@ -0,0 +1,62 @@
From 9d5e559547d0b4c7eb6d3c1843cc929328e0f2e4 Mon Sep 17 00:00:00 2001
From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 11 Jan 2019 14:03:44 +0100
Subject: [PATCH] Bug 1519729 - Document public macros. r=emilio
Undocumented public macros emit warnings in nightly-2019-01-11,
and we #![deny] that warning.
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
---
.../style/properties/properties.mako.rs | 17 ++++++++++++++++-
servo/components/style_traits/values.rs | 2 +-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs
index 2d91273be15a7..9220c3b1a6655 100644
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -3821,7 +3821,14 @@ impl AliasId {
}
}
-// NOTE(emilio): Callers are responsible to deal with prefs.
+/// Call the given macro with tokens like this for each longhand and shorthand properties
+/// that is enabled in content:
+///
+/// ```
+/// [CamelCaseName, SetCamelCaseName, PropertyId::Longhand(LonghandId::CamelCaseName)],
+/// ```
+///
+/// NOTE(emilio): Callers are responsible to deal with prefs.
#[macro_export]
macro_rules! css_properties_accessors {
($macro_name: ident) => {
@@ -3844,6 +3851,14 @@ macro_rules! css_properties_accessors {
}
}
+/// Call the given macro with tokens like this for each longhand properties:
+///
+/// ```
+/// { snake_case_ident, true }
+/// ```
+///
+/// … where the boolean indicates whether the property value type
+/// is wrapped in a `Box<_>` in the corresponding `PropertyDeclaration` variant.
#[macro_export]
macro_rules! longhand_properties_idents {
($macro_name: ident) => {
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 2851082c22e05..0d7ee3f506ce2 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -432,7 +432,7 @@ impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
-#[macro_export]
+/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
macro_rules! define_css_keyword_enum {
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
#[allow(missing_docs)]

View File

@ -0,0 +1,39 @@
From 9bdfa9fecaf15456ba634fdef4c5130d4bf663e6 Mon Sep 17 00:00:00 2001
From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 11 Jan 2019 14:02:28 +0100
Subject: [PATCH] Bug 1519729 - Remove unused macro. r=emilio
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
---
servo/components/style_traits/values.rs | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 6da235c07b645..2851082c22e05 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -158,24 +158,6 @@ where
}
}
-#[macro_export]
-macro_rules! serialize_function {
- ($dest: expr, $name: ident($( $arg: expr, )+)) => {
- serialize_function!($dest, $name($($arg),+))
- };
- ($dest: expr, $name: ident($first_arg: expr $( , $arg: expr )*)) => {
- {
- $dest.write_str(concat!(stringify!($name), "("))?;
- $first_arg.to_css($dest)?;
- $(
- $dest.write_str(", ")?;
- $arg.to_css($dest)?;
- )*
- $dest.write_char(')')
- }
- }
-}
-
/// Convenience wrapper to serialise CSS values separated by a given string.
pub struct SequenceWriter<'a, 'b: 'a, W: 'b> {
inner: &'a mut CssWriter<'b, W>,

View File

@ -0,0 +1,25 @@
From 2b08ae08b260aa17327f811e5eaf9f7aeba3dfec Mon Sep 17 00:00:00 2001
From: lqd <remy.rakic+github@gmail.com>
Date: Fri, 11 Jan 2019 16:35:26 +0100
Subject: [PATCH] Bug 1519729 - Typo fix in new doc-comment. r=emilio
Cherry-picks a commit from https://github.com/servo/servo/pull/22674
Co-Authored-By: SimonSapin <simon.sapin@exyr.org>
---
servo/components/style_traits/values.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 0d7ee3f506ce2..582e34eb3db03 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -432,7 +432,7 @@ impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
-/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
+/// Define an enum type with unit variants that each correspond to a CSS keyword.
macro_rules! define_css_keyword_enum {
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
#[allow(missing_docs)]

View File

@ -0,0 +1,72 @@
From c4573875e2765595093d23b2e73cfa3a976a4ed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Mon, 11 Mar 2019 19:28:37 +0000
Subject: [PATCH] Bug 1533969 - Fix build error with newer glibc. r=nbp
New glibc versions provide a wrapper for gettid, which means that our stuff
fails to build with:
```
/home/emilio/src/moz/gecko/js/src/util/NativeStack.cpp:28:14: error: static declaration of 'gettid' follows non-static declaration
static pid_t gettid() { return syscall(__NR_gettid); }
^
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration is here
extern __pid_t gettid (void) __THROW;
```
Differential Revision: https://phabricator.services.mozilla.com/D22829
--HG--
extra : moz-landing-system : lando
---
js/src/util/NativeStack.cpp | 2 +-
tools/profiler/core/platform.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/js/src/util/NativeStack.cpp b/js/src/util/NativeStack.cpp
index 57beda99c76c1..b988faee7c5b7 100644
--- a/js/src/util/NativeStack.cpp
+++ b/js/src/util/NativeStack.cpp
@@ -25,11 +25,7 @@
# include <sys/syscall.h>
# include <sys/types.h>
# include <unistd.h>
-static pid_t
-gettid()
-{
- return syscall(__NR_gettid);
-}
+# define gettid() static_cast<pid_t>(syscall(__NR_gettid))
# endif
#else
# error "Unsupported platform"
diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
index f02faf2822364..8379eb0347554 100644
--- a/tools/profiler/core/platform.h
+++ b/tools/profiler/core/platform.h
@@ -39,22 +39,16 @@
#include "PlatformMacros.h"
#include <vector>
-// We need a definition of gettid(), but glibc doesn't provide a
+// We need a definition of gettid(), but old glibc versions don't provide a
// wrapper for it.
#if defined(__GLIBC__)
#include <unistd.h>
#include <sys/syscall.h>
-static inline pid_t gettid()
-{
- return (pid_t) syscall(SYS_gettid);
-}
+# define gettid() static_cast<pid_t>(syscall(SYS_gettid))
#elif defined(GP_OS_darwin)
#include <unistd.h>
#include <sys/syscall.h>
-static inline pid_t gettid()
-{
- return (pid_t) syscall(SYS_thread_selfid);
-}
+# define gettid() static_cast<pid_t>(syscall(SYS_thread_selfid))
#elif defined(GP_OS_android)
#include <unistd.h>
#elif defined(GP_OS_windows)

View File

@ -0,0 +1,61 @@
From be4391585f7069c6bcb9efb364a97bd3554d6a01 Mon Sep 17 00:00:00 2001
From: Kartikaya Gupta <kgupta@mozilla.com>
Date: Wed, 5 Jun 2019 14:06:25 +0000
Subject: [PATCH] Bug 1556597 - Fix warnings in webrender_bindings in nightly
rust. r=Gankro
Depends on D33782
Differential Revision: https://phabricator.services.mozilla.com/D33783
--HG--
extra : moz-landing-system : lando
---
gfx/webrender_bindings/src/bindings.rs | 4 ++--
gfx/webrender_bindings/src/moz2d_renderer.rs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs
index cf3b9efa1d898..f2693b99474bc 100644
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -577,7 +577,7 @@ extern "C" {
}
impl RenderNotifier for CppNotifier {
- fn clone(&self) -> Box<RenderNotifier> {
+ fn clone(&self) -> Box<dyn RenderNotifier> {
Box::new(CppNotifier {
window_id: self.window_id,
})
@@ -1167,7 +1167,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
-> bool {
assert!(unsafe { is_in_render_thread() });
- let recorder: Option<Box<ApiRecordingReceiver>> = if unsafe { gfx_use_wrench() } {
+ let recorder: Option<Box<dyn ApiRecordingReceiver>> = if unsafe { gfx_use_wrench() } {
let name = format!("wr-record-{}.bin", window_id.0);
Some(Box::new(BinaryRecorder::new(&PathBuf::from(name))))
} else {
diff --git a/gfx/webrender_bindings/src/moz2d_renderer.rs b/gfx/webrender_bindings/src/moz2d_renderer.rs
index ee672ee..6d9dcb2 100644
--- a/gfx/webrender_bindings/src/moz2d_renderer.rs
+++ b/webrender_bindings/src/moz2d_renderer.rs
@@ -365,7 +365,7 @@ impl BlobImageRenderer for Moz2dImageRenderer {
}
fn request(&mut self,
- resources: &BlobImageResources,
+ resources: &dyn BlobImageResources,
request: BlobImageRequest,
descriptor: &BlobImageDescriptor,
dirty_rect: Option<DeviceUintRect>) {
@@ -403,7 +403,7 @@ impl BlobImageRenderer for Moz2dImageRenderer {
unsafe { AddNativeFontHandle(key, cstr.as_ptr() as *mut c_void, handle.index) };
}
- fn process_fonts(mut extra_data: BufReader, resources: &BlobImageResources) {
+ fn process_fonts(mut extra_data: BufReader, resources: &dyn BlobImageResources) {
let font_count = extra_data.read_usize();
for _ in 0..font_count {
let key = extra_data.read_font_key();

View File

@ -1,7 +1,7 @@
Name: firefox
Summary: Mozilla Firefox Web browser
Version: 62.0.3
Release: 6
Release: 7
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: http://download-origin.cdn.mozilla.net/pub/firefox/releases/62.0.3/source/firefox-62.0.3.source.tar.xz
@ -34,6 +34,13 @@ Patch6000: CVE-2020-6811.patch
Patch6001: CVE-2020-6814-Add-FlippedOnce-class.patch
Patch6002: CVE-2020-6814-1.patch
Patch6003: CVE-2020-6814-2.patch
Patch6004: rust-cssparser-Fix-a-future-compat-warning.patch
Patch6005: Bug-1519729-Remove-unused-macro.patch
Patch6006: Bug-1519729-Document-public-macros.patch
Patch6007: Bug-1519729-Typo-fix-in-new-doc-comment.patch
Patch6008: Bug-1556597-Fix-warnings-in-webrender_bindings-in-nightly-rust.patch
Patch6009: Bug-1519629-Document-a-few-more-macros.patch
Patch6010: Bug-1533969-Fix-build-error-with-newer-glibc.patch
BuildRequires: pkgconfig(nspr) >= 4.19 pkgconfig(nss) >= 3.37.3 pkgconfig(libpng) pkgconfig(libffi)
BuildRequires: pkgconfig(zlib) pkgconfig(libIDL-2.0) pkgconfig(gtk+-3.0) pkgconfig(gtk+-2.0) pkgconfig(krb5)
@ -321,6 +328,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/applications/firefox-wayland.desktop
%changelog
* Wed Jul 22 2020 lingsheng <lingsheng@huawei.com> - 62.0.3-7
- Fix firefox build with rust 1.38
* Mon May 25 2020 huanghaitao <huanghaitao8@huawei.com> - 62.0.3-6
- Type:cves
- ID: CVE-2020-6811 CVE-2020-6814

View File

@ -0,0 +1,68 @@
diff --git a/third_party/rust/cssparser/src/parser.rs b/third_party/rust/cssparser/src/parser.rs
index 76736a8..83acaa6 100644
--- a/third_party/rust/cssparser/src/parser.rs
+++ b/third_party/rust/cssparser/src/parser.rs
@@ -555,28 +555,34 @@ impl<'i: 't, 't> Parser<'i, 't> {
}
let token_start_position = self.input.tokenizer.position();
- let token;
- match self.input.cached_token {
- Some(ref cached_token)
- if cached_token.start_position == token_start_position => {
- self.input.tokenizer.reset(&cached_token.end_state);
- match cached_token.token {
- Token::Function(ref name) => self.input.tokenizer.see_function(name),
- _ => {}
- }
- token = &cached_token.token
- }
- _ => {
- let new_token = self.input.tokenizer.next()
- .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
- self.input.cached_token = Some(CachedToken {
- token: new_token,
- start_position: token_start_position,
- end_state: self.input.tokenizer.state(),
- });
- token = self.input.cached_token_ref()
+ let using_cached_token = self
+ .input
+ .cached_token
+ .as_ref()
+ .map_or(false, |cached_token| {
+ cached_token.start_position == token_start_position
+ });
+ let token = if using_cached_token {
+ let cached_token = self.input.cached_token.as_ref().unwrap();
+ self.input.tokenizer.reset(&cached_token.end_state);
+ match cached_token.token {
+ Token::Function(ref name) => self.input.tokenizer.see_function(name),
+ _ => {}
}
- }
+ &cached_token.token
+ } else {
+ let new_token = self
+ .input
+ .tokenizer
+ .next()
+ .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
+ self.input.cached_token = Some(CachedToken {
+ token: new_token,
+ start_position: token_start_position,
+ end_state: self.input.tokenizer.state(),
+ });
+ self.input.cached_token_ref()
+ };
if let Some(block_type) = BlockType::opening(token) {
self.at_start_of = Some(block_type);
diff --git a/third_party/rust/cssparser/.cargo-checksum.json b/third_party/rust/cssparser/.cargo-checksum.json
index 48ec8cc..7debeb8 100644
--- a/third_party/rust/cssparser/.cargo-checksum.json
+++ b/third_party/rust/cssparser/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{".travis.yml":"e8f586288c39dbaebefdd391f68376e58f3a4c568a8dc3cd97c4a362194716dd","Cargo.toml":"007ec70e8421e1889e8f28645d08967af29fdc2fbafa520f2b50a636de09e528","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"c5781e673335f37ed3d7acb119f8ed33efdf6eb75a7094b7da2abe0c3230adb8","build.rs":"ce686e87cccb6aa85a8cd34688d809398c5a624f179fd9a172d1049892da3f4c","build/match_byte.rs":"0f7d39170e746d59deebf7894086f63ee39ea61fb161d24b0c7a3c1db3945e0d","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"c60f1b0ab7a2a6213e434604ee33f78e7ef74347f325d86d0b9192d8225ae1cc","src/cow_rc_str.rs":"541216f8ef74ee3cc5cbbc1347e5f32ed66588c401851c9a7d68b867aede1de0","src/from_bytes.rs":"331fe63af2123ae3675b61928a69461b5ac77799fff3ce9978c55cf2c558f4ff","src/lib.rs":"a474ee88ef8f73fcb7b7272d426e5eafb4ad10d104797a5a188d1676c8180972","src/macros.rs":"adb9773c157890381556ea83d7942dcc676f99eea71abbb6afeffee1e3f28960","src/nth.rs":"5c70fb542d1376cddab69922eeb4c05e4fcf8f413f27563a2af50f72a47c8f8c","src/parser.rs":"9ed4aec998221eb2d2ba99db2f9f82a02399fb0c3b8500627f68f5aab872adde","src/rules_and_declarations.rs":"be2c4f3f3bb673d866575b6cb6084f1879dff07356d583ca9a3595f63b7f916f","src/serializer.rs":"3e2dfc60613f885cb6f99abfc854fde2a1e00de507431bd2e51178b61abfd69b","src/size_of_tests.rs":"e5f63c8c18721cc3ff7a5407e84f9889ffa10e66da96e8510a696c3e00ad72d5","src/tests.rs":"80b02c80ab0fd580dad9206615c918e0db7dff63dfed0feeedb66f317d24b24b","src/tokenizer.rs":"429b2cba419cf8b923fbcc32d3bd34c0b39284ebfcb9fc29b8eb8643d8d5f312","src/unicode_range.rs":"191d50a1588e5c88608b84cfe9279def71f495f8e016fa093f90399bbd2b635f"},"package":"205647ffe2b63a9726a4c3bb6f31c7325e8ceff10e2f1b75a6fb7609e20419ea"}
\ No newline at end of file
+{"files":{".travis.yml":"e8f586288c39dbaebefdd391f68376e58f3a4c568a8dc3cd97c4a362194716dd","Cargo.toml":"007ec70e8421e1889e8f28645d08967af29fdc2fbafa520f2b50a636de09e528","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"c5781e673335f37ed3d7acb119f8ed33efdf6eb75a7094b7da2abe0c3230adb8","build.rs":"ce686e87cccb6aa85a8cd34688d809398c5a624f179fd9a172d1049892da3f4c","build/match_byte.rs":"0f7d39170e746d59deebf7894086f63ee39ea61fb161d24b0c7a3c1db3945e0d","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"c60f1b0ab7a2a6213e434604ee33f78e7ef74347f325d86d0b9192d8225ae1cc","src/cow_rc_str.rs":"541216f8ef74ee3cc5cbbc1347e5f32ed66588c401851c9a7d68b867aede1de0","src/from_bytes.rs":"331fe63af2123ae3675b61928a69461b5ac77799fff3ce9978c55cf2c558f4ff","src/lib.rs":"a474ee88ef8f73fcb7b7272d426e5eafb4ad10d104797a5a188d1676c8180972","src/macros.rs":"adb9773c157890381556ea83d7942dcc676f99eea71abbb6afeffee1e3f28960","src/nth.rs":"5c70fb542d1376cddab69922eeb4c05e4fcf8f413f27563a2af50f72a47c8f8c","src/parser.rs":"6bd16e08c29cb31c358f3cfeb9c6659227f24a95d399c14cf969c8b1a0e931fd","src/rules_and_declarations.rs":"be2c4f3f3bb673d866575b6cb6084f1879dff07356d583ca9a3595f63b7f916f","src/serializer.rs":"3e2dfc60613f885cb6f99abfc854fde2a1e00de507431bd2e51178b61abfd69b","src/size_of_tests.rs":"e5f63c8c18721cc3ff7a5407e84f9889ffa10e66da96e8510a696c3e00ad72d5","src/tests.rs":"80b02c80ab0fd580dad9206615c918e0db7dff63dfed0feeedb66f317d24b24b","src/tokenizer.rs":"429b2cba419cf8b923fbcc32d3bd34c0b39284ebfcb9fc29b8eb8643d8d5f312","src/unicode_range.rs":"191d50a1588e5c88608b84cfe9279def71f495f8e016fa093f90399bbd2b635f"},"package":"205647ffe2b63a9726a4c3bb6f31c7325e8ceff10e2f1b75a6fb7609e20419ea"}