Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Closed
tonylazarew opened this issue Aug 23, 2024 · 5 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

@amccloud
Copy link

amccloud commented Dec 3, 2024

@Xudong-Huang 0.8.3 is still broken cross compiling from M1. Reverting example to 0.7.5 works as expected.

@Xudong-Huang
Copy link
Owner

You should use the maser HEAD for testing, 0.8.3 doesn't contains the changes. I will release 0.8.4 soon

@Xudong-Huang
Copy link
Owner

I test with 0.8.4, and it wors on macos m4

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

No branches or pull requests

3 participants