]> git.lizzy.rs Git - rust.git/commitdiff
Disable global_asm! on macOS for now
authorbjorn3 <bjorn3@users.noreply.github.com>
Thu, 9 Jul 2020 16:56:17 +0000 (18:56 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Thu, 9 Jul 2020 16:56:17 +0000 (18:56 +0200)
example/mini_core_hello_world.rs
src/driver/aot.rs

index d83fb2aece91d322af5327e121000362f8e570e4..9c2ab5a5165cdfe61e841bece7f29d505fccc78d 100644 (file)
@@ -285,18 +285,18 @@ struct ExternTypeWrapper {
     #[cfg(not(jit))]
     test_tls();
 
-    #[cfg(not(jit))]
+    #[cfg(all(not(jit), target_os = "linux"))]
     unsafe {
         global_asm_test();
     }
 }
 
-#[cfg(not(jit))]
+#[cfg(all(not(jit), target_os = "linux"))]
 extern "C" {
     fn global_asm_test();
 }
 
-#[cfg(not(jit))]
+#[cfg(all(not(jit), target_os = "linux"))]
 global_asm! {
     "
     .global global_asm_test
index 4128148ed363d809da9074226d6a9e0284053959..48445c43a92eb2df9b754cca0c2ac9b7797d361f 100644 (file)
@@ -277,6 +277,15 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
         return;
     }
 
+    if tcx.sess.target.target.options.is_like_osx || tcx.sess.target.target.options.is_like_windows {
+        if global_asm.contains("__rust_probestack") {
+            return;
+        }
+
+        // FIXME fix linker error on macOS
+        tcx.sess.fatal("global_asm! is not yet supported on macOS and Windows");
+    }
+
     let assembler = crate::toolchain::get_toolchain_binary(tcx.sess, "as");
     let linker = crate::toolchain::get_toolchain_binary(tcx.sess, "ld");