Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8cf3818

Browse files
committed
Disable global_asm! on macOS for now
1 parent 893497c commit 8cf3818

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

example/mini_core_hello_world.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,18 @@ fn main() {
285285
#[cfg(not(jit))]
286286
test_tls();
287287

288-
#[cfg(not(jit))]
288+
#[cfg(all(not(jit), target_os = "linux"))]
289289
unsafe {
290290
global_asm_test();
291291
}
292292
}
293293

294-
#[cfg(not(jit))]
294+
#[cfg(all(not(jit), target_os = "linux"))]
295295
extern "C" {
296296
fn global_asm_test();
297297
}
298298

299-
#[cfg(not(jit))]
299+
#[cfg(all(not(jit), target_os = "linux"))]
300300
global_asm! {
301301
"
302302
.global global_asm_test

src/driver/aot.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,15 @@ fn codegen_global_asm(tcx: TyCtxt<'_>, cgu_name: &str, global_asm: &str) {
277277
return;
278278
}
279279

280+
if tcx.sess.target.target.options.is_like_osx || tcx.sess.target.target.options.is_like_windows {
281+
if global_asm.contains("__rust_probestack") {
282+
return;
283+
}
284+
285+
// FIXME fix linker error on macOS
286+
tcx.sess.fatal("global_asm! is not yet supported on macOS and Windows");
287+
}
288+
280289
let assembler = crate::toolchain::get_toolchain_binary(tcx.sess, "as");
281290
let linker = crate::toolchain::get_toolchain_binary(tcx.sess, "ld");
282291

0 commit comments

Comments
 (0)