Skip to content

Commit 581e1d9

Browse files
authored
compilation: Use the dedicated stack-sizes section only for AOT (#3732)
For JIT, we naturally use mach-o on macOS, where the section name we currently use is not valid and ends up with the errors like: ``` LLVM ERROR: Global variable '__orc_lcl.aot_stack_sizes.0' has an invalid section specifier '.aot_stack_sizes': mach-o section specifier requires a segment and section separated by a comma. ``` Because the dedicated section is not necessary for JIT, this commit simply stops using it. Fixes: #3730
1 parent 97c95a2 commit 581e1d9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/iwasm/compilation/aot_llvm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,15 @@ aot_create_stack_sizes(const AOTCompData *comp_data, AOTCompContext *comp_ctx)
16901690
* avoid creating extra relocations in the precheck functions.
16911691
*/
16921692
LLVMSetLinkage(stack_sizes, LLVMInternalLinkage);
1693-
LLVMSetSection(stack_sizes, aot_stack_sizes_section_name);
1693+
/*
1694+
* for AOT, place it into a dedicated section for the convenience
1695+
* of the AOT file generation and symbol resolutions.
1696+
*
1697+
* for JIT, it doesn't matter.
1698+
*/
1699+
if (!comp_ctx->is_jit_mode) {
1700+
LLVMSetSection(stack_sizes, aot_stack_sizes_section_name);
1701+
}
16941702
comp_ctx->stack_sizes_type = stack_sizes_type;
16951703
comp_ctx->stack_sizes = stack_sizes;
16961704
return true;

0 commit comments

Comments
 (0)