[aot] Ensure the LLVM tools path ends with a directory separator appropriate to the...
authorJoão Matos <joao@tritao.eu>
Fri, 13 Mar 2015 17:07:37 +0000 (17:07 +0000)
committerJoão Matos <joao@tritao.eu>
Fri, 13 Mar 2015 17:09:41 +0000 (17:09 +0000)
mono/mini/aot-compiler.c

index a182ca5a39e31bc5fff851f84d9f8126d73e776a..635f8e1db635af893c308fae4ec44e8dc22a7871 100644 (file)
@@ -6466,6 +6466,11 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts)
                        opts->mtriple = g_strdup (arg + strlen ("mtriple="));
                } else if (str_begins_with (arg, "llvm-path=")) {
                        opts->llvm_path = g_strdup (arg + strlen ("llvm-path="));
+                       if (!g_str_has_suffix (opts->llvm_path, G_DIR_SEPARATOR_S)) {
+                               gchar *old = opts->llvm_path;
+                               opts->llvm_path = g_strconcat (opts->llvm_path, G_DIR_SEPARATOR_S, NULL);
+                               g_free (old);
+                       }
                } else if (!strcmp (arg, "llvm")) {
                        opts->llvm = TRUE;
                } else if (str_begins_with (arg, "readonly-value=")) {