mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
wasm does not like PIC
This commit is contained in:
parent
3162fbf83f
commit
0f5f5fbe54
1 changed files with 3 additions and 2 deletions
|
@ -106,12 +106,13 @@ fn generateObjectFile(
|
||||||
step_name: []const u8,
|
step_name: []const u8,
|
||||||
object_name: []const u8,
|
object_name: []const u8,
|
||||||
) void {
|
) void {
|
||||||
const obj = b.addObject(.{ .strip = true, .pic = true, .name = object_name, .root_source_file = main_path, .optimize = mode, .target = target, .use_llvm = true });
|
const is_wasm = target.result.cpu.arch == .wasm32 or target.result.cpu.arch == .wasm64;
|
||||||
|
const obj = b.addObject(.{ .strip = true, .pic = !is_wasm, .name = object_name, .root_source_file = main_path, .optimize = mode, .target = target, .use_llvm = true });
|
||||||
|
|
||||||
obj.link_function_sections = true;
|
obj.link_function_sections = true;
|
||||||
obj.root_module.stack_check = false;
|
obj.root_module.stack_check = false;
|
||||||
|
|
||||||
if (target.result.cpu.arch != std.Target.Cpu.Arch.wasm32)
|
if (!is_wasm)
|
||||||
obj.bundle_compiler_rt = true;
|
obj.bundle_compiler_rt = true;
|
||||||
|
|
||||||
const obj_file = obj.getEmittedBin();
|
const obj_file = obj.getEmittedBin();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue