aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-09-14 11:03:00 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-10-06 15:12:04 -0400
commitae9042abbfbd9b854fe46138e62cc0b3f6696b68 (patch)
treeca7d06040a74d77e26562bbc1d209a462d59351f /configure.ac
parentc3e50f0fde701c01d68ebea60e8b9e978937a201 (diff)
downloadtor-ae9042abbfbd9b854fe46138e62cc0b3f6696b68.tar.gz
tor-ae9042abbfbd9b854fe46138e62cc0b3f6696b68.zip
rust: Remove Rust support from tree
Closes #40469 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac148
1 files changed, 0 insertions, 148 deletions
diff --git a/configure.ac b/configure.ac
index f010c547b7..85b23f24f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,10 +75,6 @@ AC_ARG_ENABLE(oss-fuzz,
AS_HELP_STRING(--enable-oss-fuzz, [build extra fuzzers based on 'oss-fuzz' environment]))
AC_ARG_ENABLE(memory-sentinels,
AS_HELP_STRING(--disable-memory-sentinels, [disable code that tries to prevent some kinds of memory access bugs. For fuzzing only.]))
-AC_ARG_ENABLE(rust,
- AS_HELP_STRING(--enable-rust, [enable rust integration]))
-AC_ARG_ENABLE(cargo-online-mode,
- AS_HELP_STRING(--enable-cargo-online-mode, [Allow cargo to make network requests to fetch crates. For builds with rust only.]))
AC_ARG_ENABLE(restart-debugging,
AS_HELP_STRING(--enable-restart-debugging, [Build Tor with support for debugging in-process restart. Developers only.]))
AC_ARG_ENABLE(zstd-advanced-apis,
@@ -115,7 +111,6 @@ AM_CONDITIONAL(COVERAGE_ENABLED, test "x$enable_coverage" = "xyes")
AM_CONDITIONAL(DISABLE_ASSERTS_IN_UNIT_TESTS, test "x$enable_asserts_in_tests" = "xno")
AM_CONDITIONAL(LIBFUZZER_ENABLED, test "x$enable_libfuzzer" = "xyes")
AM_CONDITIONAL(OSS_FUZZ_ENABLED, test "x$enable_oss_fuzz" = "xyes")
-AM_CONDITIONAL(USE_RUST, test "x$enable_rust" = "xyes")
AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
AM_CONDITIONAL(USE_OPENSSL, test "x$enable_nss" != "xyes")
@@ -483,13 +478,6 @@ fi
AM_CONDITIONAL(USEPYTHON, [test "x$PYTHON" != "x"])
-dnl List all external rust crates we depend on here. Include the version
-rust_crates=" \
- digest-0.7.2 \
- libc-0.2.39 \
-"
-AC_SUBST(rust_crates)
-
ifdef([AC_C_FLEXIBLE_ARRAY_MEMBER], [
AC_C_FLEXIBLE_ARRAY_MEMBER
], [
@@ -642,105 +630,6 @@ fi
AC_C_BIGENDIAN
-AC_ARG_VAR([TOR_RUST_TARGET], [Rust target, must be specified when cross-compiling (HOST != BUILD). example: i686-pc-windows-gnu])
-
-if test "x$enable_rust" = "xyes"; then
- AC_ARG_VAR([RUSTC], [path to the rustc binary])
- AC_CHECK_PROG([RUSTC], [rustc], [rustc],[no])
- if test "x$RUSTC" = "xno"; then
- AC_MSG_ERROR([rustc unavailable but rust integration requested.])
- fi
-
- AC_ARG_VAR([CARGO], [path to the cargo binary])
- AC_CHECK_PROG([CARGO], [cargo], [cargo],[no])
- if test "x$CARGO" = "xno"; then
- AC_MSG_ERROR([cargo unavailable but rust integration requested.])
- fi
-
- AC_DEFINE([HAVE_RUST], 1, [have Rust])
- if test "x$enable_fatal_warnings" = "xyes"; then
- RUST_WARN=
- else
- RUST_WARN=#
- fi
- if test "x$enable_cargo_online_mode" = "xyes"; then
- CARGO_ONLINE=
- RUST_DL=#
- else
- CARGO_ONLINE=--frozen
- RUST_DL=
-
- dnl When we're not allowed to touch the network, we need crate dependencies
- dnl locally available.
- AC_MSG_CHECKING([rust crate dependencies])
- AC_ARG_VAR([TOR_RUST_DEPENDENCIES], [path to directory with local crate mirror])
- if test "x$TOR_RUST_DEPENDENCIES" = "x"; then
- TOR_RUST_DEPENDENCIES="${srcdir}/src/ext/rust/crates"
- fi
- dnl Check whether the path exists before we try to cd into it.
- if test ! -d "$TOR_RUST_DEPENDENCIES"; then
- AC_MSG_ERROR([Rust dependency directory $TOR_RUST_DEPENDENCIES does not exist. Specify a dependency directory using the TOR_RUST_DEPENDENCIES variable or allow cargo to fetch crates using --enable-cargo-online-mode.])
- ERRORED=1
- fi
- dnl Make the path absolute, since we'll be using it from within a
- dnl subdirectory.
- TOR_RUST_DEPENDENCIES=$(cd "$TOR_RUST_DEPENDENCIES" ; pwd)
-
- for dep in $rust_crates; do
- if test ! -d "$TOR_RUST_DEPENDENCIES"/"$dep"; then
- AC_MSG_ERROR([Failure to find rust dependency $TOR_RUST_DEPENDENCIES/$dep. Specify a dependency directory using the TOR_RUST_DEPENDENCIES variable or allow cargo to fetch crates using --enable-cargo-online-mode.])
- ERRORED=1
- fi
- done
- if test "x$ERRORED" = "x"; then
- AC_MSG_RESULT([yes])
- fi
- fi
-
- dnl For now both MSVC and MinGW rust libraries will output static libs with
- dnl the MSVC naming convention.
- if test "$bwin32" = "true"; then
- tor_rust_static_name=tor_rust.lib
- else
- tor_rust_static_name=libtor_rust.a
- fi
-
- AC_CANONICAL_BUILD
-
- if test -n "$TOR_RUST_TARGET"; then
- if test "$host" = "$build"; then
- AC_MSG_ERROR([HOST = BUILD is invalid if TOR_RUST_TARGET is specified, see configure --help for more information.])
- fi
- RUST_TARGET_PROP="target = '$TOR_RUST_TARGET'"
- TOR_RUST_LIB_PATH="src/rust/target/$TOR_RUST_TARGET/release/$tor_rust_static_name"
- else
- if test "$host" != "$build"; then
- AC_MSG_ERROR([TOR_RUST_TARGET must be specified when cross-compiling with Rust enabled.])
- fi
- RUST_TARGET_PROP=
- TOR_RUST_LIB_PATH="src/rust/target/release/$tor_rust_static_name"
- fi
-
- AC_SUBST(RUST_TARGET_PROP)
- AC_SUBST(TOR_RUST_LIB_PATH)
- AC_SUBST(CARGO_ONLINE)
- AC_SUBST(RUST_WARN)
- AC_SUBST(RUST_DL)
-
- dnl Let's check the rustc version, too
- AC_MSG_CHECKING([rust version])
- RUSTC_VERSION=`$RUSTC --version`
- RUSTC_VERSION_MAJOR=`$RUSTC --version | cut -d ' ' -f 2 | cut -d '.' -f 1`
- RUSTC_VERSION_MINOR=`$RUSTC --version | cut -d ' ' -f 2 | cut -d '.' -f 2`
- if test "x$RUSTC_VERSION_MAJOR" = "x" -o "x$RUSTC_VERSION_MINOR" = "x"; then
- AC_MSG_ERROR([rustc version couldn't be identified])
- fi
- if test "$RUSTC_VERSION_MAJOR" -lt 2 -a "$RUSTC_VERSION_MINOR" -lt 31; then
- AC_MSG_ERROR([rustc must be at least version 1.31.0])
- fi
- AC_MSG_RESULT([$RUSTC_VERSION])
-fi
-
AC_SEARCH_LIBS(socket, [socket network])
AC_SEARCH_LIBS(gethostbyname, [nsl])
AC_SEARCH_LIBS(dlopen, [dl])
@@ -916,8 +805,6 @@ if test "$bwin32" = "true"; then
TOR_LIB_WS32=-lws2_32
TOR_LIB_IPHLPAPI=-liphlpapi
TOR_LIB_SHLWAPI=-lshlwapi
- # Some of the cargo-cults recommend -lwsock32 as well, but I don't
- # think it's actually necessary.
TOR_LIB_GDI=-lgdi32
TOR_LIB_USERENV=-luserenv
TOR_LIB_BCRYPT=-lbcrypt
@@ -1461,33 +1348,6 @@ if test "$fragile_hardening" = "yes"; then
TOR_CHECK_CFLAGS([-fno-omit-frame-pointer])
fi
-dnl Find the correct libraries to add in order to use the sanitizers.
-dnl
-dnl When building Rust, Cargo will run the linker with the -nodefaultlibs
-dnl option, which will prevent the compiler from linking the sanitizer
-dnl libraries it needs. We need to specify them manually.
-dnl
-dnl What's more, we need to specify them in a linker script rather than
-dnl from build.rs: these options aren't allowed in the cargo:rustc-flags
-dnl variable.
-RUST_LINKER_OPTIONS=""
-if test "x$have_clang" = "xyes"; then
- if test "x$CFLAGS_ASAN" != "x"; then
- RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -Clink-arg=$CFLAGS_ASAN -Cdefault-linker-libraries"
- fi
- if test "x$CFLAGS_UBSAN" != "x"; then
- RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -Clink-arg=$CFLAGS_UBSAN -Cdefault-linker-libraries"
- fi
-else
- if test "x$CFLAGS_ASAN" != "x"; then
- RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -Clink-arg=-fsanitize=address -Cdefault-linker-libraries"
- fi
- if test "x$CFLAGS_UBSAN" != "x"; then
- RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -Clink-arg=-fsanitize=undefined -Cdefault-linker-libraries"
- fi
-fi
-AC_SUBST(RUST_LINKER_OPTIONS)
-
CFLAGS_BUGTRAP="$CFLAGS_FTRAPV $CFLAGS_ASAN $CFLAGS_UBSAN"
CFLAGS_CONSTTIME="$CFLAGS_FWRAPV"
@@ -2698,11 +2558,9 @@ CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_z
AC_CONFIG_FILES([
Doxyfile
Makefile
- config.rust
contrib/operator-tools/tor.logrotate
src/config/torrc.sample
src/config/torrc.minimal
- src/rust/.cargo/config
scripts/maint/checkOptionDocs.pl
warning_flags
])
@@ -2778,12 +2636,6 @@ AS_ECHO
test "x$enable_fatal_warnings" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Warnings are fatal (--enable-fatal-warnings)], $value)
-test "x$enable_rust" = "xyes" && value=1 || value=0
-PPRINT_PROP_BOOL([Rust support (--enable-rust)], $value)
-
-test "x$enable_cargo_online_mode" = "xyes" && value=1 || value=0
-PPRINT_PROP_BOOL([Cargo Online Fetch (--enable-cargo-online-mode)], $value)
-
test "x$enable_android" = "xyes" && value=1 || value=0
PPRINT_PROP_BOOL([Android support (--enable-android)], $value)