Skip to content

Commit 499c300

Browse files
Fix broken wasm linker flags for LLVM16 (#7652)
* Fix broken wasm linker flags for LLVM16 * Update WasmExecutor.cpp
1 parent 932ad0b commit 499c300

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/WasmExecutor.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ std::vector<char> compile_to_wasm(const Module &module, const std::string &fn_na
339339

340340
std::string lld_arg_strs[] = {
341341
"HalideJITLinker",
342-
"-flavor", "wasm",
342+
#if LLVM_VERSION >= 170
343+
"-flavor",
344+
"wasm",
345+
#endif
343346
// For debugging purposes:
344347
// "--verbose",
345348
// "-error-limit=0",
@@ -350,7 +353,8 @@ std::vector<char> compile_to_wasm(const Module &module, const std::string &fn_na
350353
obj_file.pathname(),
351354
"--entry=" + fn_name,
352355
"-o",
353-
wasm_output.pathname()};
356+
wasm_output.pathname()
357+
};
354358

355359
constexpr int c = sizeof(lld_arg_strs) / sizeof(lld_arg_strs[0]);
356360
const char *lld_args[c];

0 commit comments

Comments
 (0)