From 5d21cd664887f7e9c1064cabcaff09426e490c6d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 4 Apr 2019 13:11:25 -0300 Subject: [PATCH] tmp --- Cargo.toml | 2 +- build.rs | 4 ++++ etc/patches/missing-cargon-in-vendored.patch | 10 ++++++++++ mozjs/third_party/rust/argon2rs/Cargo.toml | 2 +- mozjs/third_party/rust/bzip2/Cargo.toml | 2 +- src/jsgc.rs | 4 +++- src/jsglue.hpp | 15 ++++++++++++++- src/lib.rs | 1 + 8 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 etc/patches/missing-cargon-in-vendored.patch diff --git a/Cargo.toml b/Cargo.toml index 1e3fcc468c8..bf1d7a9e0b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,5 +30,5 @@ libc = "0.2" libz-sys = "1.0" [build-dependencies] -bindgen = "0.46" +bindgen = "0.49" cc = "1.0" diff --git a/build.rs b/build.rs index 899361b2b2c..e221cb073f6 100644 --- a/build.rs +++ b/build.rs @@ -63,6 +63,7 @@ fn cc_flags() -> Vec<&'static str> { "-fno-sized-deallocation", "-Wno-unused-parameter", "-Wno-invalid-offsetof", + "-Wno-unused-private-field", ]); } @@ -334,6 +335,9 @@ const BLACKLIST_TYPES: &'static [&'static str] = &[ // Bindgen generates bitfields with private fields, so they cannot // be used in const expressions. "JSJitInfo", + // Declared as a constexpr, and clang doesn't expose aggregate initializations, + // so it causes a link error. + "JSID_VOID", ]; /// Definitions for types that were blacklisted diff --git a/etc/patches/missing-cargon-in-vendored.patch b/etc/patches/missing-cargon-in-vendored.patch new file mode 100644 index 00000000000..9d008683ebc --- /dev/null +++ b/etc/patches/missing-cargon-in-vendored.patch @@ -0,0 +1,10 @@ +diff --git a/mozjs/third_party/rust/argon2rs/Cargo.toml b/mozjs/third_party/rust/argon2rs/Cargo.toml +index 1235e46e0d..4785ba616e 100644 +--- a/mozjs/third_party/rust/argon2rs/Cargo.toml ++++ b/mozjs/third_party/rust/argon2rs/Cargo.toml +@@ -18,4 +18,4 @@ blake2-rfc = "0.2.16" + scoped_threadpool = "0.1.7" + + [dev-dependencies] +-cargon = { path = "benches/cargon", version = "0.0.1" } ++#cargon = { path = "benches/cargon", version = "0.0.1" } diff --git a/mozjs/third_party/rust/argon2rs/Cargo.toml b/mozjs/third_party/rust/argon2rs/Cargo.toml index 1235e46e0d7..4785ba616e8 100644 --- a/mozjs/third_party/rust/argon2rs/Cargo.toml +++ b/mozjs/third_party/rust/argon2rs/Cargo.toml @@ -18,4 +18,4 @@ blake2-rfc = "0.2.16" scoped_threadpool = "0.1.7" [dev-dependencies] -cargon = { path = "benches/cargon", version = "0.0.1" } +#cargon = { path = "benches/cargon", version = "0.0.1" } diff --git a/mozjs/third_party/rust/bzip2/Cargo.toml b/mozjs/third_party/rust/bzip2/Cargo.toml index 707764579d7..0bec444f916 100644 --- a/mozjs/third_party/rust/bzip2/Cargo.toml +++ b/mozjs/third_party/rust/bzip2/Cargo.toml @@ -19,7 +19,7 @@ categories = ["compression", "api-bindings"] [dependencies] libc = "0.2" -bzip2-sys = { version = "0.1", path = "bzip2-sys" } +bzip2-sys = { version = "0.1", path = "../bzip2-sys" } tokio-io = { version = "0.1", optional = true } futures = { version = "0.1", optional = true } diff --git a/src/jsgc.rs b/src/jsgc.rs index 57c4cce115c..9cb236ca334 100644 --- a/src/jsgc.rs +++ b/src/jsgc.rs @@ -6,7 +6,6 @@ use jsapi::JS; use jsapi::jsid; use jsapi::JSFlatString; use jsapi::JSFunction; -use jsapi::JSID_VOID; use jsapi::JSObject; use jsapi::JSScript; use jsapi::JSString; @@ -90,6 +89,9 @@ pub trait GCMethods { unsafe fn post_barrier(v: *mut Self, prev: Self, next: Self); } +const JSID_TYPE_VOID: usize = 0x2; +const JSID_VOID: jsid = jsid { asBits: JSID_TYPE_VOID }; + impl GCMethods for jsid { unsafe fn initial() -> jsid { JSID_VOID } unsafe fn post_barrier(_: *mut jsid, _: jsid, _: jsid) {} diff --git a/src/jsglue.hpp b/src/jsglue.hpp index b52b9f48c36..d5f387b06c2 100644 --- a/src/jsglue.hpp +++ b/src/jsglue.hpp @@ -9,12 +9,25 @@ #include "jsapi.h" #include "jsfriendapi.h" +#include "js/BuildId.h" +#include "js/CompilationAndEvaluation.h" +#include "js/ContextOptions.h" #include "js/Conversions.h" +#include "js/Date.h" +#include "js/Equality.h" +#include "js/Id.h" #include "js/Initialization.h" +#include "js/JSON.h" #include "js/MemoryMetrics.h" +#include "js/Promise.h" #include "js/PropertySpec.h" -#include "js/CompilationAndEvaluation.h" +#include "js/Realm.h" +#include "js/SavedFrameAPI.h" #include "js/SourceText.h" +#include "js/Stream.h" +#include "js/StructuredClone.h" +#include "js/Symbol.h" +#include "js/Utility.h" // Reexport some functions that are marked inline. diff --git a/src/lib.rs b/src/lib.rs index 3e488471487..682c4bed0d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ extern crate libc; +#[allow(unused_extern_crates)] extern crate libz_sys; // The jsimpls module just implements traits so can be private