Fix windows compile error and warning (#715)

This commit is contained in:
Wenyong Huang 2021-09-01 18:50:08 +08:00 committed by GitHub
parent ee24d78483
commit 3f316a99a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -2235,6 +2235,10 @@ aot_obj_data_create(AOTCompContext *comp_ctx)
bh_print_time("Begin to emit object file");
if (!strncmp(LLVMGetTargetName(target), "arc", 3)) {
#if defined(_WIN32) || defined(_WIN32_)
aot_set_last_error("emit object file on Windows is unsupported.");
goto fail;
#else
/* Emit to assmelby file instead for arc target
as it cannot emit to object file */
char file_name[] = "wasm-XXXXXX", buf[128];
@ -2297,6 +2301,7 @@ aot_obj_data_create(AOTCompContext *comp_ctx)
aot_set_last_error("create mem buffer with file failed.");
goto fail;
}
#endif /* end of defined(_WIN32) || defined(_WIN32_) */
}
else if (LLVMTargetMachineEmitToMemoryBuffer(comp_ctx->target_machine,
comp_ctx->module,

View File

@ -1674,7 +1674,7 @@ aot_create_comp_context(AOTCompData *comp_data,
goto fail;
if (cpu) {
int len = strlen(cpu) + 1;
uint32 len = (uint32)strlen(cpu) + 1;
if (!(comp_ctx->target_cpu = wasm_runtime_malloc(len))) {
aot_set_last_error("allocate memory failed");
goto fail;