Bug 1495610: Add bindgen arguments to build Cranelift on MacOS X; r=froydnj
authorBenjamin Bouvier <benj@benj.me>
Tue, 02 Oct 2018 13:13:54 +0200
changeset 494907 231b53d76122680bb682eb74cc73615a9a554f31
parent 494906 19d5e50db843b03d4aed8e5f5736a531035c9cf0
child 494908 17c314f6930d2b8d6e456aa9e9d41407a45c3008
child 494980 3eb35625a84fbf792af8b9e1e3378e7051af593e
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1495610
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1495610: Add bindgen arguments to build Cranelift on MacOS X; r=froydnj
js/src/wasm/cranelift/build.rs
--- a/js/src/wasm/cranelift/build.rs
+++ b/js/src/wasm/cranelift/build.rs
@@ -70,20 +70,26 @@ fn main() {
                 Arch::Aarch64 => { bindings.clang_arg("--target=aarch64-linux-android") }
                 Arch::Arm => { bindings.clang_arg("--target=armv7-linux-androideabi") }
                 Arch::X86 => { bindings.clang_arg("--target=i686-linux-android") }
                 Arch::X64 => { bindings.clang_arg("--target=x86_64-linux-android") }
             };
         }
 
         Ok("linux") | Ok("freebsd") | Ok("dragonfly") | Ok("openbsd") | Ok("bitrig") | Ok("netbsd")
-            | Ok("macos") | Ok("ios") => {
+            | Ok("ios") => {
             // Nothing to do in particular for these OSes, until proven the contrary.
         }
 
+        Ok("macos") => {
+            bindings = bindings.clang_arg("-DOS_MACOSX=1");
+            bindings = bindings.clang_arg("-stdlib=libc++");
+            bindings = bindings.clang_arg("--target=x86_64-apple-darwin");
+        }
+
         Ok("windows") => {
             let arch = arch.expect("unknown Windows architecture");
             bindings = bindings.clang_arg("-DOS_WIN=1")
                 .clang_arg("-DWIN32=1");
             bindings = match env::var("CARGO_CFG_TARGET_ENV").as_ref().map(|x| x.as_str()) {
                 Ok("msvc") => {
                     bindings = bindings.clang_arg("-fms-compatibility-version=19");
                     bindings = bindings.clang_arg("-D_CRT_USE_BUILTIN_OFFSETOF");