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))]
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

View 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");