Don't add "+d" to riscv cpu features if already given (#2855)

This commit is contained in:
Huang Qi 2023-12-04 17:00:21 +08:00 committed by GitHub
parent b0d5b8df1d
commit e350e65b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2708,15 +2708,16 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
meta_target_abi);
if (!strcmp(abi, "lp64d") || !strcmp(abi, "ilp32d")) {
if (features) {
if (features && !strstr(features, "+d")) {
snprintf(features_buf, sizeof(features_buf), "%s%s",
features, ",+d");
features = features_buf;
}
else
else if (!features) {
features = "+d";
}
}
}
if (!features)
features = "";