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

run-make-fulldeps/c-link-to-rust-va-list-fn fails on aarch64-linux-gnu #56475

Open
parched opened this issue Dec 3, 2018 · 7 comments
Open
Labels
A-codegen Area: Code generation A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. F-c_variadic `#![feature(c_variadic)]` O-AArch64 Armv8-A or later processors in AArch64 mode T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@parched
Copy link
Contributor

parched commented Dec 3, 2018

Running python2.7 ./x.py test --stage 2 on aarch64-linux-gnu I end up with the following failure

---- [run-make] run-make-fulldeps/c-link-to-rust-va-list-fn stdou
t ----                                                           
                                                                 
error: make failed                                               
status: exit code: 2                                             
command: "make"                                                  
stdout:                                                          
------------------------------------------                       
LD_LIBRARY_PATH="/usr/src/myapp/build/aarch64-unknown-linux-gnu/t
est/run-make-fulldeps/c-link-to-rust-va-list-fn/c-link-to-rust-va
-list-fn:/usr/src/myapp/build/aarch64-unknown-linux-gnu/stage2/li
b:/usr/src/myapp/build/aarch64-unknown-linux-gnu/stage0-bootstrap
-tools/aarch64-unknown-linux-gnu/release/deps:/usr/src/myapp/buil
d/aarch64-unknown-linux-gnu/stage0/lib:" '/usr/src/myapp/build/aa
rch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /usr/src/myap
p/build/aarch64-unknown-linux-gnu/test/run-make-fulldeps/c-link-t
o-rust-va-list-fn/c-link-to-rust-va-list-fn -L /usr/src/myapp/bui
ld/aarch64-unknown-linux-gnu/test/run-make-fulldeps/c-link-to-rus
t-va-list-fn/c-link-to-rust-va-list-fn  checkrust.rs             
cc -ffunction-sections -fdata-sections -fPIC test.c /usr/src/myap
p/build/aarch64-unknown-linux-gnu/test/run-make-fulldeps/c-link-t
o-rust-va-list-fn/c-link-to-rust-va-list-fn/libcheckrust.a -o /us
r/src/myapp/build/aarch64-unknown-linux-gnu/test/run-make-fulldep
s/c-link-to-rust-va-list-fn/c-link-to-rust-va-list-fn/test -lm -l
rt -ldl -lpthread 
LD_LIBRARY_PATH="/usr/src/myapp/build/aarch64-unknown-linux-gnu/t
est/run-make-fulldeps/c-link-to-rust-va-list-fn/c-link-to-rust-va
-list-fn:/usr/src/myapp/build/aarch64-unknown-linux-gnu/stage2/li
b/rustlib/aarch64-unknown-linux-gnu/lib:/usr/src/myapp/build/aarc
h64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linu
x-gnu/release/deps:/usr/src/myapp/build/aarch64-unknown-linux-gnu
/stage0/lib:" /usr/src/myapp/build/aarch64-unknown-linux-gnu/test
/run-make-fulldeps/c-link-to-rust-va-list-fn/c-link-to-rust-va-li
st-fn/test                                                       
Makefile:4: recipe for target 'all' failed                       
                                                                 
------------------------------------------                       
stderr:                                                          
------------------------------------------                       
test: test.c:32: main: Assertion `test_rust(check_list_0, 0x01LL,
 0x02, 0x03LL) == 0' failed.                                     
Aborted (core dumped)                                            
make: *** [all] Error 134                                        
                                                                 
------------------------------------------

I was building this commit 9cd3bef

I haven't had the chance to debug it yet but I'll take a look when I get a chance.

cc @dlrobertson

@dlrobertson
Copy link
Contributor

dlrobertson commented Dec 3, 2018

We rely on the LLVM implementation of va_arg for Aarch64 (unlike clang). I bet we'll have to manually implement it like we do for i686.

@dlrobertson
Copy link
Contributor

BTW thanks for testing and reporting this!

@jonas-schievink jonas-schievink added A-FFI Area: Foreign function interface (FFI) O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Jan 27, 2019
smaeul added a commit to smaeul/rust that referenced this issue May 27, 2019
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
simd-intrinsic-generic-bitmask.rs: broken on BE, rust-lang#59356
simd-intrinsic-generic-select.rs: broken on BE, rust-lang#59356
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Nov 5, 2019
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
simd-intrinsic-generic-bitmask.rs: broken on BE, rust-lang#59356
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Mar 14, 2020
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
simd-intrinsic-generic-bitmask.rs: broken on BE, rust-lang#59356
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Mar 14, 2020
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
simd-intrinsic-generic-bitmask.rs: broken on BE, rust-lang#59356
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
@JamieCunliffe
Copy link
Contributor

I had a brief conversation with @parched yesterday regarding this issue, and picking up the pull request that was opened. The following comment #62207 (review) about some platforms using the va_arg instruction and some using rust generated LLVM IR. Does the rust community now have a preference as to how to handle va_args as that comment was made almost a year ago?

I think there is more benefit in fixing up the va_arg instruction within LLVM. But I would like to get this issue fixed in a way that is approved by the rust community.

@dlrobertson
Copy link
Contributor

I had a brief conversation with @parched yesterday regarding this issue, and picking up the pull request that was opened.

Awesome! Excited to see some interest in this. I've recently had some conversations with co-workers about work on this as well.

I think there is more benefit in fixing up the va_arg instruction within LLVM.

Do you mean within the rustc codegen or upstream LLVM?

@JamieCunliffe
Copy link
Contributor

I think there is more benefit in fixing up the va_arg instruction within LLVM.

Do you mean within the rustc codegen or upstream LLVM?

I was thinking upstream LLVM.

I thought it would be best to raise the question here though as there didn't seem to be a decision on your comment about if rust was going to standardise it's approach to this, and if it is then which approach it would be.

@dlrobertson
Copy link
Contributor

I was thinking upstream LLVM.

Last I checked there didn't seem to be much interest in this and it would require a quite large effort.

there didn't seem to be a decision on your comment about if rust was going to standardise it's approach to this, and if it is then which approach it would be.

IMHO a non-standarrd solution is better than a broken one 😄 My first implementation of Aarch64 variadics is broken, so I'd love to get something merged whether or not it is entirely standard. That being said, if we can implement this in codegen, I'd greatly prefer that.

@jonas-schievink jonas-schievink added A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-codegen Area: Code generation and removed A-testsuite Area: The testsuite used to check the correctness of rustc labels May 25, 2020
@JamieCunliffe
Copy link
Contributor

I have had a look at implementing this in rustc_codegen_llvm and started on this so if you want to assign it to me I'll continue on.

@jonas-schievink jonas-schievink added the F-c_variadic `#![feature(c_variadic)]` label Jun 15, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 22, 2020
va_args implementation for AAPCS.

Implement the va args in codegen for AAPCS, this will be used as the
default va_args implementation for AArch64 rather than the va_args
llvm-ir as it currently is.

This should fix the following issues:
rust-lang#56475
rust-lang#72579
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 22, 2020
va_args implementation for AAPCS.

Implement the va args in codegen for AAPCS, this will be used as the
default va_args implementation for AArch64 rather than the va_args
llvm-ir as it currently is.

This should fix the following issues:
rust-lang#56475
rust-lang#72579
smaeul added a commit to smaeul/rust that referenced this issue Jan 22, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 22, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 23, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 24, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 24, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 24, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jan 27, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
@workingjubilee workingjubilee added O-AArch64 Armv8-A or later processors in AArch64 mode and removed O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Mar 18, 2022
smaeul added a commit to smaeul/rust that referenced this issue Apr 24, 2022
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
simd-intrinsic-generic-bitmask.rs: broken on BE, rust-lang#59356
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
smaeul added a commit to smaeul/rust that referenced this issue Jun 24, 2024
c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, rust-lang#56475
env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
long-linker-command-lines: takes >10 minutes to run (but still passes)
sparc-struct-abi: no sparc target
sysroot-crates-are-unstable: can't run rustc without RPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-FFI Area: Foreign function interface (FFI) C-bug Category: This is a bug. F-c_variadic `#![feature(c_variadic)]` O-AArch64 Armv8-A or later processors in AArch64 mode T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants