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

risc-v: Set ABI correctly for 32-bit targets #429

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
risc-v: Set ABI correctly for 32-bit targets
Pick the correct softfloat mode based on bitness:

- `-mabi=lp64` for 64 bit RISC-V
- `-mabi=ilp32` for 32-bit RISC-V

Currently it fails for rv32 due to a conflict between the ABI and arch:

    cc1: error: ABI requires -march=rv64
  • Loading branch information
laanwj committed Aug 8, 2019
commit b15493847edca64203a08565863d74dd08961fdc
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1436,7 +1436,11 @@ impl Build {
cmd.args.push(("-march=rv".to_owned() + arch).into());
// ABI is always soft-float right now, update this when this is no longer the
// case:
cmd.args.push("-mabi=lp64".into());
if arch.starts_with("64") {
cmd.args.push("-mabi=lp64".into());
} else {
cmd.args.push("-mabi=ilp32".into());
}
}
}
}