add support for linux_riscv64 and freestanding_riscv64

This commit is contained in:
Laytan
2024-08-15 20:39:35 +02:00
committed by Laytan Laats
parent 29838da782
commit ca6ef95b03
28 changed files with 1395 additions and 116 deletions

View File

@@ -3245,6 +3245,15 @@ int main(int arg_count, char const **arg_ptr) {
}
}
// NOTE(laytan): on riscv64 we want to enforce some features.
if (build_context.metrics.arch == TargetArch_riscv64) {
String disabled;
if (!check_target_feature_is_enabled(str_lit("64bit,f,d,m"), &disabled)) { // 64bit, floats, doubles, integer multiplication.
gb_printf_err("missing required target feature: \"%.*s\", enable it by setting a different -microarch or explicitly adding it through -target-features\n", LIT(disabled));
gb_exit(1);
}
}
if (build_context.show_debug_messages) {
debugf("Selected microarch: %.*s\n", LIT(march));
debugf("Default microarch features: %.*s\n", LIT(default_features));