Skip to content

Commit 4dcb0ee

Browse files
committed
rustc: Link in libmorestack.a when --stack-growth
1 parent 8d7863f commit 4dcb0ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/comp/back/link.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ fn link_binary(sess: session::session,
633633
gcc_args += ["-lrt", "-ldl"];
634634
}
635635

636+
// Stack growth requires statically linking a __morestack function
637+
if sess.get_opts().stack_growth {
638+
gcc_args += ["-lmorestack"];
639+
}
640+
636641
gcc_args += rpath::get_rpath_flags(sess, out_filename);
637642

638643
log #fmt("gcc link args: %s", str::connect(gcc_args, " "));

0 commit comments

Comments
 (0)