Skip to content

Commit

Permalink
fix link error
Browse files Browse the repository at this point in the history
  • Loading branch information
crabtw authored and brson committed Jan 2, 2012
1 parent 21eadbe commit 274fc1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 -L/usr/local/lib -lexecinfo
CFG_GCCISH_LINK_FLAGS += -shared -fPIC -lpthread -lrt
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
Expand Down
5 changes: 4 additions & 1 deletion src/comp/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ fn link_binary(sess: session::session,
}

if sess.get_targ_cfg().os == session::os_freebsd {
gcc_args += ["-lrt", "-L/usr/local/lib", "-lexecinfo"];
gcc_args += ["-lrt", "-L/usr/local/lib", "-lexecinfo",
"-L/usr/local/lib/gcc46",
"-L/usr/local/lib/gcc44", "-lstdc++",
"-Wl,-z,origin"];
}

// OS X 10.6 introduced 'compact unwind info', which is produced by the
Expand Down
10 changes: 9 additions & 1 deletion src/etc/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def scrub(b):
"lib/std-*.dll",
"lib/rustc-*.dll",
"lib/rustrt.dll",
"lib/rustllvm.dll"]
"lib/rustllvm.dll"],
"freebsd": ["bin/rustc",
"lib/libcore-*.so",
"lib/libstd-*.so",
"lib/librustc-*.so",
"lib/librustrt.so",
"lib/librustllvm.so"]
}

def parse_line(n, line):
Expand Down Expand Up @@ -73,6 +79,8 @@ def get_kernel(triple):
return "winnt"
if os_name == "darwin":
return "macos"
if os_name == "freebsd":
return "freebsd"
return "linux"

def get_cpu(triple):
Expand Down

0 comments on commit 274fc1b

Please sign in to comment.