Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64-apple-ios-sim and aarch64-apple-ios target builds are broken since 0.8.0 #64

Open
tonylazarew opened this issue Aug 23, 2024 · 2 comments

Comments

@tonylazarew
Copy link

Hi @Xudong-Huang. Having an issue with 0.8.0 and newer on iOS targets. 0.7.5 builds fine, but 0.8.0 fails with inline assembly errors (see the log below).

Toolchains I checked on:

  • 1.79.0-aarch64-apple-darwin
  • 1.80.0-aarch64-apple-darwin
  • 1.80.1-aarch64-apple-darwin
  • current nightly

Here's a simplest repro case: check-generator.zip
Run this with cargo build --target aarch64-apple-ios-sim or cargo build --target aarch64-apple-ios and it will fail.

Exact error log:

# cargo build --target aarch64-apple-ios-sim
   Compiling generator v0.8.2
error: unknown directive
  |
note: instantiated into assembly here
 --> <inline asm>:3:1
  |
3 | .type prefetch,@function
  | ^

error: unknown directive
  |
note: instantiated into assembly here
 --> <inline asm>:8:1
  |
8 | .size prefetch,.-prefetch
  | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:12:1
   |
12 | .type bootstrap_green_task,@function
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:19:1
   |
19 | .size bootstrap_green_task,.-bootstrap_green_task
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:23:1
   |
23 | .type swap_registers,@function
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:57:1
   |
57 | .size swap_registers,.-swap_registers
   | ^

error: unexpected token in '.section' directive
   |
note: instantiated into assembly here
  --> <inline asm>:60:19
   |
60 | .section .note.GNU-stack,"",%progbits
   |                   ^

error: could not compile `generator` (lib) due to 7 previous errors
@Xudong-Huang
Copy link
Owner

seems it select the wrong os-target, isn't "macos"?

cfg_if::cfg_if! {
if #[cfg(target_os = "macos")] {
std::arch::global_asm!(include_str!("asm/asm_aarch64_aapcs_macho.S"));
} else {
std::arch::global_asm!(include_str!("asm/asm_aarch64_aapcs_elf.S"));
}
}

@Xudong-Huang
Copy link
Owner

now it should build, but I don't know how to test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants