A few changes related to WAMRC_LLC_COMPILER (#2218)

Print `target triple` for wamrc and set target triple for the LLVM module.
And update document.
This commit is contained in:
YAMAMOTO Takashi
2023-05-17 10:56:35 +09:00
committed by GitHub
parent f69ff70587
commit f759a1f960
2 changed files with 6 additions and 1 deletions

View File

@ -2007,6 +2007,7 @@ aot_create_comp_context(AOTCompData *comp_data, aot_comp_option_t option)
os_printf("Create AoT compiler with:\n");
os_printf(" target: %s\n", comp_ctx->target_arch);
os_printf(" target cpu: %s\n", cpu);
os_printf(" target triple: %s\n", triple_norm);
os_printf(" cpu features: %s\n", features);
os_printf(" opt level: %d\n", opt_level);
os_printf(" size level: %d\n", size_level);
@ -2025,6 +2026,8 @@ aot_create_comp_context(AOTCompData *comp_data, aot_comp_option_t option)
break;
}
LLVMSetTarget(comp_ctx->module, triple_norm);
if (!LLVMTargetHasTargetMachine(target)) {
snprintf(buf, sizeof(buf),
"no target machine for this target (%s).", triple_norm);