Skip to content

Variadic FFI test fails on aarch64-apple-darwin #78092

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

Closed
Tracked by #73908
shepmaster opened this issue Oct 19, 2020 · 1 comment · Fixed by #78126
Closed
Tracked by #73908

Variadic FFI test fails on aarch64-apple-darwin #78092

shepmaster opened this issue Oct 19, 2020 · 1 comment · Fixed by #78126
Labels
A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. F-c_variadic `#![feature(c_variadic)]` O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS

Comments

@shepmaster
Copy link
Member

x.py test --stage 2 src/test/ui/abi/variadic-ffi
---- [ui] ui/abi/variadic-ffi.rs stdout ----

error: test run failed!
status: exit code: 101
command: "/Users/shepmaster/Projects/rust/full/build/aarch64-apple-darwin/test/ui/abi/variadic-ffi/a"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `3078109020`,
 right: `30`', /Users/shepmaster/Projects/rust/src/test/ui/abi/variadic-ffi.rs:78:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

------------------------------------------

Meta

Fails in e3051d8

@shepmaster shepmaster added O-macos Operating system: macOS A-FFI Area: Foreign function interface (FFI) O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state C-bug Category: This is a bug. F-c_variadic `#![feature(c_variadic)]` labels Oct 19, 2020
@shepmaster
Copy link
Member Author

Based on the porting guide:

Because of these changes, the type va_list is an alias for char*, and not for the struct type in the generic procedure call standard.

So that's one thing that needs to be changed.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Oct 26, 2020
…ist, r=nagisa

Properly define va_arg and va_list for aarch64-apple-darwin

From [Apple][]:

> Because of these changes, the type `va_list` is an alias for `char*`,
> and not for the struct type in the generic procedure call standard.

With this change `/x.py test --stage 1 src/test/ui/abi/variadic-ffi`
passes.

Fixes rust-lang#78092

[Apple]: https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms
@bors bors closed this as completed in 0a91755 Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. F-c_variadic `#![feature(c_variadic)]` O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant