diff -r c8c9971bdc53 Lib/distutils/unixccompiler.py --- a/Lib/distutils/unixccompiler.py Thu Feb 27 18:48:13 2014 -0500 +++ b/Lib/distutils/unixccompiler.py Fri Feb 28 20:02:17 2014 +1100 @@ -225,6 +225,8 @@ if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir + elif sys.platform[:7] == "freebsd": + return "-Wl,-rpath=" + dir elif sys.platform[:5] == "hp-ux": if self._is_gcc(compiler): return ["-Wl,+s", "-L" + dir]