提交 21eadbe6 编写于 作者: J Jyun-Yan You 提交者: Brian Anderson

add missing library, enable segmented stacks for freebsd

上级 d4884b6c
......@@ -25,7 +25,7 @@ ifneq ($(findstring freebsd,$(CFG_OSTYPE)),)
CFG_LIB_NAME=lib$(1).so
CFG_LIB_GLOB=lib$(1)-*.so
CFG_GCCISH_CFLAGS += -fPIC -I/usr/local/include
CFG_GCCISH_LINK_FLAGS += -shared -fPIC -lpthread -lrt
CFG_GCCISH_LINK_FLAGS += -shared -fPIC -lpthread -lrt -L/usr/local/lib -lexecinfo
CFG_GCCISH_DEF_FLAG := -Wl,--export-dynamic,--dynamic-list=
CFG_GCCISH_PRE_LIB_FLAGS := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS := -Wl,-no-whole-archive
......
......@@ -220,7 +220,6 @@ fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
} else { FileType = LLVMAssemblyFile; }
// Write optimized bitcode if --save-temps was on.
let seg_stack = sess.get_targ_cfg().os != session::os_freebsd;
if opts.save_temps {
// Always output the bitcode file with --save-temps
......@@ -245,7 +244,7 @@ fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
buf_o,
LLVMAssemblyFile,
CodeGenOptLevel,
seg_stack)})});
true)})});
}
......@@ -265,7 +264,7 @@ fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
buf_o,
LLVMObjectFile,
CodeGenOptLevel,
seg_stack)})});
true)})});
}
} else {
// If we aren't saving temps then just output the file
......@@ -283,7 +282,7 @@ fn run_passes(sess: session::session, llmod: ModuleRef, output: str) {
buf_o,
FileType,
CodeGenOptLevel,
seg_stack)})});
true)})});
}
// Clean up and return
......@@ -661,7 +660,7 @@ fn rmext(filename: str) -> str {
}
if sess.get_targ_cfg().os == session::os_freebsd {
gcc_args += ["-lrt"];
gcc_args += ["-lrt", "-L/usr/local/lib", "-lexecinfo"];
}
// OS X 10.6 introduced 'compact unwind info', which is produced by the
......
......@@ -14,21 +14,23 @@
.globl GET_SP
.globl CHECK_STACK
#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__)
RECORD_SP:
movq %rdi, %fs:112
ret
#else
#if defined(__APPLE__)
#elif defined(__APPLE__)
RECORD_SP:
movq $0x60+90*8, %rsi
movq %rdi, %gs:(%rsi)
ret
#elif defined(__FreeBSD__)
RECORD_SP:
movq %rdi, %fs:24
ret
#else
RECORD_SP:
ret
#endif
#endif
GET_SP:
movq %rsp, %rax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册