disable external toolchains for windows

This commit is contained in:
Xu Jun 2022-06-20 10:11:08 +08:00
parent fa26bcaee9
commit f1603faec9
2 changed files with 12 additions and 0 deletions

View File

@ -2693,6 +2693,7 @@ aot_obj_data_create(AOTCompContext *comp_ctx)
bh_print_time("Begin to emit object file"); bh_print_time("Begin to emit object file");
if (comp_ctx->external_llc_compiler || comp_ctx->external_asm_compiler) { if (comp_ctx->external_llc_compiler || comp_ctx->external_asm_compiler) {
#if !(defined(_WIN32) || defined(_WIN32_))
/* Generate a temp file name */ /* Generate a temp file name */
int ret; int ret;
char obj_file_name[64]; char obj_file_name[64];
@ -2720,6 +2721,7 @@ aot_obj_data_create(AOTCompContext *comp_ctx)
aot_set_last_error("create mem buffer with file failed."); aot_set_last_error("create mem buffer with file failed.");
goto fail; goto fail;
} }
#endif /* end of !(defined(_WIN32) || defined(_WIN32_)) */
} }
else if (!strncmp(LLVMGetTargetName(target), "arc", 3)) { else if (!strncmp(LLVMGetTargetName(target), "arc", 3)) {
#if defined(_WIN32) || defined(_WIN32_) #if defined(_WIN32) || defined(_WIN32_)

View File

@ -1663,6 +1663,10 @@ aot_create_comp_context(AOTCompData *comp_data, aot_comp_option_t option)
/* verify external llc compiler */ /* verify external llc compiler */
comp_ctx->external_llc_compiler = getenv("WAMRC_LLC_COMPILER"); comp_ctx->external_llc_compiler = getenv("WAMRC_LLC_COMPILER");
if (comp_ctx->external_llc_compiler) { if (comp_ctx->external_llc_compiler) {
#if defined(_WIN32) || defined(_WIN32_)
comp_ctx->external_llc_compiler = NULL;
LOG_WARNING("External LLC compiler not supported on Windows.");
#else
if (access(comp_ctx->external_llc_compiler, X_OK) != 0) { if (access(comp_ctx->external_llc_compiler, X_OK) != 0) {
LOG_WARNING("WAMRC_LLC_COMPILER [%s] not found, fallback to " LOG_WARNING("WAMRC_LLC_COMPILER [%s] not found, fallback to "
"default pipeline", "default pipeline",
@ -1674,12 +1678,17 @@ aot_create_comp_context(AOTCompData *comp_data, aot_comp_option_t option)
LOG_VERBOSE("Using external LLC compiler [%s]", LOG_VERBOSE("Using external LLC compiler [%s]",
comp_ctx->external_llc_compiler); comp_ctx->external_llc_compiler);
} }
#endif
} }
/* verify external asm compiler */ /* verify external asm compiler */
if (!comp_ctx->external_llc_compiler) { if (!comp_ctx->external_llc_compiler) {
comp_ctx->external_asm_compiler = getenv("WAMRC_ASM_COMPILER"); comp_ctx->external_asm_compiler = getenv("WAMRC_ASM_COMPILER");
if (comp_ctx->external_asm_compiler) { if (comp_ctx->external_asm_compiler) {
#if defined(_WIN32) || defined(_WIN32_)
comp_ctx->external_asm_compiler = NULL;
LOG_WARNING("External ASM compiler not supported on Windows.");
#else
if (access(comp_ctx->external_asm_compiler, X_OK) != 0) { if (access(comp_ctx->external_asm_compiler, X_OK) != 0) {
LOG_WARNING( LOG_WARNING(
"WAMRC_ASM_COMPILER [%s] not found, fallback to " "WAMRC_ASM_COMPILER [%s] not found, fallback to "
@ -1692,6 +1701,7 @@ aot_create_comp_context(AOTCompData *comp_data, aot_comp_option_t option)
LOG_VERBOSE("Using external ASM compiler [%s]", LOG_VERBOSE("Using external ASM compiler [%s]",
comp_ctx->external_asm_compiler); comp_ctx->external_asm_compiler);
} }
#endif
} }
} }