Просмотр исходного кода

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

Huang Qi 2 лет назад
Родитель
Сommit
e350e65b12
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      core/iwasm/compilation/aot_llvm.c

+ 3 - 2
core/iwasm/compilation/aot_llvm.c

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