Skip to content

Commit

Permalink
risc-v: Set ABI correctly for 32-bit targets
Browse files Browse the repository at this point in the history
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
1 parent f6f6c81 commit b154938
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
}
Expand Down

0 comments on commit b154938

Please sign in to comment.