Commit 24bbade217

Ben Noordhuis <info@bnoordhuis.nl>
2018-10-02 12:31:21
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.
1 parent cd211bc
Changed files (1)
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));