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

Segfault when trying to build with mismatching architecture and pointer width #222

Open
trajing opened this issue Jun 6, 2018 · 0 comments

Comments

@trajing
Copy link

trajing commented Jun 6, 2018

Trying to build for arm-none-eabi as though it had a pointer width of 64 bits causes an "error: could not compile core" with no further elaboration, and rebuilding with --verbose reveals that rustc segfaults.

To reproduce:

xargo new --lib segfault-repro
cd segfault-repro
echo '{"llvm-target": "arm-none-eabi", "data-layout": "e-m:e-p:64:32-i64:64-v128:64:128-a:0:32-n32-S64", "linker-flavor": "gcc", "target-endian": "little", "target-pointer-width": "64", "target-c-int-width": "32", "arch": "arm", "os": "none"}' > arm-segfault.json
xargo build --target arm-segfault --verbose

Changing the llvm target to "aarch64-none-elf" and the arch to "aarch64", or changing the target file to claim that pointers are 32-bit, will fix the segfault.

I'm actually not sure if this is a rustc bug or a xargo bug, as I lack the knowledge to do this with rustc without xargo -- sorry if this is in the wrong place!

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

No branches or pull requests

1 participant