Disable global_asm! on macOS for now

This commit is contained in:
bjorn3 2020-07-09 18:56:17 +02:00
parent 893497c93e
commit 8cf38181ad
2 changed files with 12 additions and 3 deletions

View File

@ -285,18 +285,18 @@ fn main() {
#[cfg(not(jit))] #[cfg(not(jit))]
test_tls(); test_tls();
#[cfg(not(jit))] #[cfg(all(not(jit), target_os = "linux"))]
unsafe { unsafe {
global_asm_test(); global_asm_test();
} }
} }
#[cfg(not(jit))] #[cfg(all(not(jit), target_os = "linux"))]
extern "C" { extern "C" {
fn global_asm_test(); fn global_asm_test();
} }
#[cfg(not(jit))] #[cfg(all(not(jit), target_os = "linux"))]
global_asm! { global_asm! {
" "
.global global_asm_test .global global_asm_test

View File

@ -277,6 +277,15 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
return; 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 assembler = crate::toolchain::get_toolchain_binary(tcx.sess, "as");
let linker = crate::toolchain::get_toolchain_binary(tcx.sess, "ld"); let linker = crate::toolchain::get_toolchain_binary(tcx.sess, "ld");