Extract error functionality into a new lowest-level library.

This commit is contained in:
Nick Mathewson 2018-06-21 09:53:08 -04:00
parent b2346b1201
commit 2cfcb7b364
10 changed files with 27 additions and 6 deletions

4
.gitignore vendored
View File

@ -166,6 +166,10 @@ uptime-*.json
/src/ext/keccak-tiny/libkeccak-tiny.a
/src/ext/keccak-tiny/libkeccak-tiny.lib
# /src/lib
/src/lib/libtor-err.a
/src/lib/libtor-err-testing.a
# /src/or/
/src/or/Makefile
/src/or/Makefile.in

View File

@ -40,12 +40,14 @@ endif
# "Common" libraries used to link tor's utility code.
TOR_UTIL_LIBS = \
src/common/libor.a \
src/lib/libtor-err.a \
src/common/libor-ctime.a
# Variants of the above for linking the testing variant of tor (for coverage
# and tests)
TOR_UTIL_TESTING_LIBS = \
src/common/libor-testing.a \
src/lib/libtor-err-testing.a \
src/common/libor-ctime-testing.a
# Internal crypto libraries used in Tor

View File

@ -82,7 +82,6 @@ src_common_libor_ctime_testing_a_CFLAGS = @CFLAGS_CONSTTIME@ $(TEST_CFLAGS)
LIBOR_A_SRC = \
src/common/address.c \
src/common/address_set.c \
src/common/backtrace.c \
src/common/buffers.c \
src/common/compat.c \
src/common/compat_threads.c \
@ -99,7 +98,6 @@ LIBOR_A_SRC = \
src/common/sandbox.c \
src/common/storagedir.c \
src/common/token_bucket.c \
src/common/torerr.c \
src/common/workqueue.c \
$(libor_extra_source) \
$(threads_impl_source) \
@ -161,7 +159,6 @@ src_common_libor_event_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
COMMONHEADERS = \
src/common/address.h \
src/common/address_set.h \
src/common/backtrace.h \
src/common/buffers.h \
src/common/buffers_tls.h \
src/common/aes.h \
@ -203,7 +200,6 @@ COMMONHEADERS = \
src/common/testsupport.h \
src/common/timers.h \
src/common/token_bucket.h \
src/common/torerr.h \
src/common/torint.h \
src/common/torlog.h \
src/common/tortls.h \

View File

@ -1,6 +1,7 @@
include src/ext/include.am
include src/trunnel/include.am
include src/lib/err/include.am
include src/common/include.am
include src/trunnel/include.am
include src/or/include.am
include src/rust/include.am
include src/test/include.am

17
src/lib/err/include.am Normal file
View File

@ -0,0 +1,17 @@
noinst_LIBRARIES += src/lib/libtor-err.a
if UNITTESTS_ENABLED
noinst_LIBRARIES += src/lib/libtor-err-testing.a
endif
src_lib_libtor_err_a_SOURCES = \
src/lib/err/backtrace.c \
src/lib/err/torerr.c
src_lib_libtor_err_testing_a_SOURCES = \
$(src_lib_libtor_err_a_SOURCES)
noinst_HEADERS += \
src/lib/err/backtrace.h \
src/lib/err/torerr.h

View File

@ -138,9 +138,9 @@ pub fn main() {
cfg.from_cflags("TOR_LDFLAGS_openssl");
cfg.from_cflags("TOR_LDFLAGS_libevent");
cfg.link_relpath("src/lib");
cfg.link_relpath("src/common");
cfg.link_relpath("src/ext/keccak-tiny");
cfg.link_relpath("src/ext/keccak-tiny");
cfg.link_relpath("src/ext/ed25519/ref10");
cfg.link_relpath("src/ext/ed25519/donna");
cfg.link_relpath("src/trunnel");
@ -152,6 +152,7 @@ pub fn main() {
cfg.component("or-crypto-testing");
cfg.component("or-ctime-testing");
cfg.component("or-testing");
cfg.component("tor-err-testing");
cfg.component("or-event-testing");
cfg.component("or-ctime-testing");
cfg.component("curve25519_donna");