浏览代码

Merge remote-tracking branch 'public/bug24652_032' into maint-0.3.2

Nick Mathewson 7 年之前
父节点
当前提交
0cb89eb828
共有 3 个文件被更改,包括 19 次插入1 次删除
  1. 2 1
      Makefile.am
  2. 6 0
      changes/bug24652
  3. 11 0
      configure.ac

+ 2 - 1
Makefile.am

@@ -26,7 +26,8 @@ TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT)
 endif
 endif
 
 
 if USE_RUST
 if USE_RUST
-rust_ldadd=$(top_builddir)/src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@
+rust_ldadd=$(top_builddir)/src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@ \
+	@TOR_RUST_EXTRA_LIBS@
 else
 else
 rust_ldadd=
 rust_ldadd=
 endif
 endif

+ 6 - 0
changes/bug24652

@@ -0,0 +1,6 @@
+  o Minor bugfixes (build, compatibility, rust, OSX):
+
+    - When building with Rust on OSX, link against libresolv, to
+      work around the issue at
+      https://github.com/rust-lang/rust/issues/46797. Fixes bug
+      24652; bugfix on 0.3.1.1-alpha.

+ 11 - 0
configure.ac

@@ -436,6 +436,15 @@ if test "x$enable_rust" = "xyes"; then
     fi
     fi
   fi
   fi
 
 
+  dnl This is a workaround for #46797
+  dnl (a.k.a https://github.com/rust-lang/rust/issues/46797 ).  Once the
+  dnl upstream bug is fixed, we can remove this workaround.
+  case "$host_os" in
+      darwin*)
+        TOR_RUST_EXTRA_LIBS="-lresolv"
+	;;
+  esac
+
   dnl For now both MSVC and MinGW rust libraries will output static libs with
   dnl For now both MSVC and MinGW rust libraries will output static libs with
   dnl the MSVC naming convention.
   dnl the MSVC naming convention.
   if test "$bwin32" = "true"; then
   if test "$bwin32" = "true"; then
@@ -460,6 +469,8 @@ if test "x$enable_rust" = "xyes"; then
   fi
   fi
 fi
 fi
 
 
+AC_SUBST(TOR_RUST_EXTRA_LIBS)
+
 AC_SEARCH_LIBS(socket, [socket network])
 AC_SEARCH_LIBS(socket, [socket network])
 AC_SEARCH_LIBS(gethostbyname, [nsl])
 AC_SEARCH_LIBS(gethostbyname, [nsl])
 AC_SEARCH_LIBS(dlopen, [dl])
 AC_SEARCH_LIBS(dlopen, [dl])