Only allow -disallow-rtti on freestanding targets

This commit is contained in:
gingerBill
2022-02-28 14:00:44 +00:00
parent f3adbae1ed
commit 882116e358
+5
View File
@@ -1077,6 +1077,11 @@ void init_build_context(TargetMetrics *cross_target) {
bc->optimization_level = gb_clamp(bc->optimization_level, 0, 3);
if (bc->disallow_rtti && bc->metrics.os != TargetOs_freestanding) {
gb_printf_err("-disallow-rtti is only allowed on freestanding targets\n");
gb_exit(1);
}
#undef LINK_FLAG_X64
#undef LINK_FLAG_386
}