[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.4.1] Stub out some more functions in dirvote/*.h, fix compilation.



commit 4256ee0d379daf35098c396757ce92b97b025c6e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Aug 29 09:50:38 2019 -0400

    Stub out some more functions in dirvote/*.h, fix compilation.
    
    This fixes LTO compilation for Android and -O0 compilation in
    general, when --disable-module-dirauth is provided.
    
    Fixes bug 31552; bugfix on 0.4.1.1-alpha.
---
 changes/bug31552                    |  5 +++++
 src/feature/dirauth/process_descs.h | 26 +++++++++++++++++++++++---
 src/feature/dirauth/reachability.h  | 16 ++++++++++++++--
 3 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/changes/bug31552 b/changes/bug31552
new file mode 100644
index 000000000..fb33e1442
--- /dev/null
+++ b/changes/bug31552
@@ -0,0 +1,5 @@
+  o Minor bugfixes (compilation):
+    - Add more stub functions to fix compilation on Android with LTO, when
+      --disable-module-dirauth is used. Previously, these compilation
+      settings would make the compiler look for functions that didn't exist.
+      Fixes bug 31552; bugfix on 0.4.1.1-alpha.
diff --git a/src/feature/dirauth/process_descs.h b/src/feature/dirauth/process_descs.h
index 001c866eb..0da47c96c 100644
--- a/src/feature/dirauth/process_descs.h
+++ b/src/feature/dirauth/process_descs.h
@@ -25,15 +25,35 @@ enum was_router_added_t dirserv_add_descriptor(routerinfo_t *ri,
                                                const char **msg,
                                                const char *source);
 
-int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
-                                   int complain,
-                                   int *valid_out);
 uint32_t dirserv_router_get_status(const routerinfo_t *router,
                                    const char **msg,
                                    int severity);
 void dirserv_set_node_flags_from_authoritative_status(node_t *node,
                                                       uint32_t authstatus);
 
+#ifdef HAVE_MODULE_DIRAUTH
 int dirserv_would_reject_router(const routerstatus_t *rs);
+int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
+                                   int complain,
+                                   int *valid_out);
+#else
+static inline int
+dirserv_would_reject_router(const routerstatus_t *rs)
+{
+  (void)rs;
+  return 0;
+}
+static inline int
+authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
+                               int complain,
+                               int *valid_out)
+{
+  (void)ri;
+  (void)msg;
+  (void)complain;
+  (void)valid_out;
+  return 0;
+}
+#endif
 
 #endif /* !defined(TOR_RECV_UPLOADS_H) */
diff --git a/src/feature/dirauth/reachability.h b/src/feature/dirauth/reachability.h
index 873a3f9a2..0018c7f63 100644
--- a/src/feature/dirauth/reachability.h
+++ b/src/feature/dirauth/reachability.h
@@ -28,9 +28,21 @@ void dirserv_orconn_tls_done(const tor_addr_t *addr,
                              uint16_t or_port,
                              const char *digest_rcvd,
                              const struct ed25519_public_key_t *ed_id_rcvd);
-int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
-                                            const routerinfo_t *ri_old);
 void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
 void dirserv_test_reachability(time_t now);
 
+#ifdef HAVE_MODULE_DIRAUTH
+int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
+                                            const routerinfo_t *ri_old);
+#else
+static inline int
+dirserv_should_launch_reachability_test(const routerinfo_t *ri,
+                                            const routerinfo_t *ri_old)
+{
+  (void)ri;
+  (void)ri_old;
+  return 0;
+}
+#endif
+
 #endif /* !defined(TOR_REACHABILITY_H) */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits