[tor-bugs] #28766 [Applications/Tor Browser]: Tor Build for Android

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Sep 23 15:46:58 UTC 2019


#28766: Tor Build for Android
-------------------------------------------------+-------------------------
 Reporter:  sisbell                              |          Owner:  tbb-
                                                 |  team
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:
Component:  Applications/Tor Browser             |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tbb-mobile, tbb-rbm,                 |  Actual Points:
  TorBrowserTeam201812, tbb-parity               |
Parent ID:  #28704                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by eighthave):

 I just added a patch to move key Android configuration to `./configure
 --enable-android` so that it is shared across all the builds.  There is
 more stuff that can be moved there, that is not yet:

 * Android NDK version detection and enforcement (e.g. `>= r19` or only
 exactly `r20`)
 *  `CFLAGS` and `LDFLAGS` to find parity with Android NDK builds done with
 `ndk-build`, which automatically sets things there.
 * Perhaps the state of `--disable-linker-hardening` and `--disable-gcc-
 hardening` could also be maintained there, since we're all building with
 the Android NDK's clang.

 The patch is attached, here's the diff:
 {{{
 diff --git a/configure.ac b/configure.ac
 index a639ffaf3..afee6940c 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -88,6 +88,27 @@ else
              [Defined if we're building with OpenSSL or LibreSSL])
  fi

 +dnl Enable Android only features.
 +AC_ARG_ENABLE(android,
 +     AS_HELP_STRING(--enable-android, [build with Android features
 enabled]))
 +AM_CONDITIONAL([USE_ANDROID], [test "x$enable_android" = "xyes"])
 +
 +if test "x$enable_android" = "xyes"; then
 +  AC_DEFINE([USE_ANDROID], [1], [Compile with Android specific features
 enabled])
 +
 +  dnl Check if the Android log library is available.
 +  AC_CHECK_HEADERS([android/log.h])
 +  AC_SEARCH_LIBS(__android_log_write, [log])
 +
 +  asciidoc=false
 +  enable_html_manual=no
 +  enable_manpage=no
 +  enable_pic=yes
 +  enable_system_torrc=no
 +  enable_tool_name_check=no
 +  have_systemd=no
 +fi
 +
  if test "$enable_static_tor" = "yes"; then
    enable_static_libevent="yes";
    enable_static_openssl="yes";
 @@ -117,7 +138,7 @@ AC_ARG_ENABLE(asciidoc,
          "yes") asciidoc=true ;;
          "no")  asciidoc=false ;;
          *) AC_MSG_ERROR(bad value for --disable-asciidoc) ;;
 -      esac], [asciidoc=true])
 +      esac], [test "x$asciidoc" = "xtrue" && asciidoc=true])

  # systemd notify support
  AC_ARG_ENABLE(systemd,
 @@ -227,20 +248,6 @@ if test x$enable_event_tracing_debug = xyes; then
    AC_DEFINE([TOR_EVENT_TRACING_ENABLED], [1], [Compile the event tracing
 instrumentation])
  fi

 -dnl Enable Android only features.
 -AC_ARG_ENABLE(android,
 -     AS_HELP_STRING(--enable-android, [build with Android features
 enabled]))
 -AM_CONDITIONAL([USE_ANDROID], [test "x$enable_android" = "xyes"])
 -
 -if test "x$enable_android" = "xyes"; then
 -  AC_DEFINE([USE_ANDROID], [1], [Compile with Android specific features
 enabled])
 -
 -  dnl Check if the Android log library is available.
 -  AC_CHECK_HEADERS([android/log.h])
 -  AC_SEARCH_LIBS(__android_log_write, [log])
 -
 -fi
 -
  dnl ---
  dnl Tor modules options. These options are namespaced with --disable-
 module-XXX
  dnl ---
 --
 2.20.1

 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28766#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list