From 24bbade217ed814bd6c4d94ed93442824b7153a4 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 2 Oct 2018 12:31:21 +0200 Subject: [PATCH] fix build-exe for --target-arch wasm32 (#1570) Pass --no-entry instead of --relocatable to lld. Both stop a reference to the _start() entry point from being emitted but --relocatable also prevents public symbols from being exported when creating an executable. --- src/link.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/link.cpp b/src/link.cpp index 2b58f1426..e3753bff2 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -386,7 +386,7 @@ static void construct_linker_job_elf(LinkJob *lj) { static void construct_linker_job_wasm(LinkJob *lj) { CodeGen *g = lj->codegen; - lj->args.append("--relocatable"); // So lld doesn't look for _start. + lj->args.append("--no-entry"); // So lld doesn't look for _start. lj->args.append("-o"); lj->args.append(buf_ptr(&g->output_file_path));