Commit 02ba0a2d authored by Nick Mathewson's avatar Nick Mathewson
Browse files

Merge branch 'destroy_common'

parents 3d610363 f7eff300
......@@ -132,19 +132,6 @@ uptime-*.json
# /src/trace
/src/trace/libor-trace.a
# /src/common/
/src/common/Makefile
/src/common/Makefile.in
/src/common/libor.a
/src/common/libor-testing.a
/src/common/libor.lib
/src/common/libor-ctime.a
/src/common/libor-ctime-testing.a
/src/common/libor-ctime.lib
/src/common/libor-event.a
/src/common/libor-event-testing.a
/src/common/libor-event.lib
# /src/config/
/src/config/Makefile
/src/config/Makefile.in
......@@ -173,6 +160,8 @@ uptime-*.json
/src/lib/libtor-ctime-testing.a
/src/lib/libtor-encoding.a
/src/lib/libtor-encoding-testing.a
/src/lib/libtor-evloop.a
/src/lib/libtor-evloop-testing.a
/src/lib/libtor-err.a
/src/lib/libtor-err-testing.a
/src/lib/libtor-fdio.a
......
......@@ -40,7 +40,6 @@ endif
# "Common" libraries used to link tor's utility code.
TOR_UTIL_LIBS = \
src/common/libor.a \
src/lib/libtor-process.a \
src/lib/libtor-time.a \
src/lib/libtor-fs.a \
......@@ -68,7 +67,6 @@ TOR_UTIL_LIBS = \
# 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-process-testing.a \
src/lib/libtor-time-testing.a \
src/lib/libtor-fs-testing.a \
......@@ -112,9 +110,9 @@ TOR_CRYPTO_TESTING_LIBS = \
TOR_INTERNAL_LIBS = \
src/or/libtor-app.a \
src/lib/libtor-compress.a \
src/lib/libtor-evloop.a \
$(TOR_CRYPTO_LIBS) \
$(TOR_UTIL_LIBS) \
src/common/libor-event.a \
src/trunnel/libor-trunnel.a \
src/lib/libtor-trace.a
......@@ -123,9 +121,9 @@ TOR_INTERNAL_LIBS = \
TOR_INTERNAL_TESTING_LIBS = \
src/or/libtor-app-testing.a \
src/lib/libtor-compress-testing.a \
src/lib/libtor-evloop-testing.a \
$(TOR_CRYPTO_TESTING_LIBS) \
$(TOR_UTIL_TESTING_LIBS) \
src/common/libor-event-testing.a \
src/trunnel/libor-trunnel-testing.a \
src/lib/libtor-trace.a
......
......@@ -24,32 +24,17 @@ FUZZING_CFLAGS = \
FUZZING_LDFLAG = \
@TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
FUZZING_LIBS = \
src/or/libtor-testing.a \
src/common/libor-crypto-testing.a \
$(LIBKECCAK_TINY) \
$(LIBDONNA) \
src/common/libor-testing.a \
src/common/libor-ctime-testing.a \
src/common/libor-event-testing.a \
src/trunnel/libor-trunnel-testing.a \
$(TOR_INTERNAL_TESTING_LIBS) \
$(rust_ldadd) \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
@TOR_LIBEVENT_LIBS@ \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ \
@CURVE25519_LIBS@ \
@TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_IPHLPAPI@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ @CURVE25519_LIBS@ \
@TOR_SYSTEMD_LIBS@ \
@TOR_LZMA_LIBS@ \
@TOR_ZSTD_LIBS@
oss-fuzz-prereqs: \
src/or/libtor-testing.a \
src/common/libor-crypto-testing.a \
$(LIBKECCAK_TINY) \
$(LIBDONNA) \
src/common/libor-testing.a \
src/common/libor-ctime-testing.a \
src/common/libor-event-testing.a \
src/trunnel/libor-trunnel-testing.a
$(TOR_INTERNAL_TESTING_LIBS)
noinst_HEADERS += \
src/test/fuzz/fuzzing.h
......
all: libor.lib libor-crypto.lib libor-event.lib
CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
/I ..\ext
LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
util_codedigest.obj
LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj compress.obj compress_zlib.obj \
tortls.obj crypto_curve25519.obj curve25519-donna.obj
LIBOR_EVENT_OBJECTS = compat_libevent.obj
curve25519-donna.obj: ..\ext\curve25519_donna\curve25519-donna.c
$(CC) $(CFLAGS) /D inline=_inline /c ..\ext\curve25519_donna\curve25519-donna.c
libor.lib: $(LIBOR_OBJECTS)
lib $(LIBOR_OBJECTS) /out:libor.lib
libor-crypto.lib: $(LIBOR_CRYPTO_OBJECTS)
lib $(LIBOR_CRYPTO_OBJECTS) /out:libor-crypto.lib
libor-event.lib: $(LIBOR_EVENT_OBJECTS)
lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
clean:
del *.obj *.lib libor*.lib
noinst_LIBRARIES += \
src/common/libor.a \
src/common/libor-event.a
if UNITTESTS_ENABLED
noinst_LIBRARIES += \
src/common/libor-testing.a \
src/common/libor-event-testing.a
endif
EXTRA_DIST += src/common/Makefile.nmake
if USE_OPENBSD_MALLOC
libor_extra_source=src/ext/OpenBSD_malloc_Linux.c
else
libor_extra_source=
endif
LIBOR_A_SRC = \
src/common/address_set.c \
src/common/token_bucket.c \
src/common/workqueue.c \
$(libor_extra_source)
src/common/src_common_libor_testing_a-log.$(OBJEXT) \
src/common/log.$(OBJEXT): micro-revision.i
LIBOR_EVENT_A_SRC = \
src/common/compat_libevent.c \
src/common/procmon.c \
src/common/timers.c \
src/ext/timeouts/timeout.c
src_common_libor_a_SOURCES = $(LIBOR_A_SRC)
src_common_libor_event_a_SOURCES = $(LIBOR_EVENT_A_SRC)
if UNITTESTS_ENABLED
src_common_libor_testing_a_SOURCES = $(LIBOR_A_SRC)
src_common_libor_event_testing_a_SOURCES = $(LIBOR_EVENT_A_SRC)
else
src_common_libor_testing_a_SOURCES =
src_common_libor_event_testing_a_SOURCES =
endif
src_common_libor_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_common_libor_event_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_common_libor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_common_libor_event_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
COMMONHEADERS = \
src/common/address_set.h \
src/common/compat_libevent.h \
src/common/handles.h \
src/common/procmon.h \
src/common/socks5_status.h \
src/common/timers.h \
src/common/token_bucket.h \
src/common/util.h \
src/common/workqueue.h
noinst_HEADERS+= $(COMMONHEADERS)
/* Copyright (c) 2003-2004, Roger Dingledine
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file util.h
* \brief Headers for util.c
**/
#ifndef TOR_UTIL_H
#define TOR_UTIL_H
#include "orconfig.h"
#include "lib/arch/bytes.h"
#include "lib/cc/compat_compiler.h"
#include "lib/cc/torint.h"
#include "lib/ctime/di_ops.h"
#include "lib/encoding/cstring.h"
#include "lib/encoding/time_fmt.h"
#include "lib/err/torerr.h"
#include "lib/fs/dir.h"
#include "lib/fs/files.h"
#include "lib/fs/mmap.h"
#include "lib/fs/path.h"
#include "lib/fs/userdb.h"
#include "lib/intmath/addsub.h"
#include "lib/intmath/bits.h"
#include "lib/intmath/cmp.h"
#include "lib/intmath/logic.h"
#include "lib/intmath/muldiv.h"
#include "lib/log/escape.h"
#include "lib/log/ratelim.h"
#include "lib/log/util_bug.h"
#include "lib/malloc/util_malloc.h"
#include "lib/net/ipv4.h"
#include "lib/net/ipv6.h"
#include "lib/net/resolve.h"
#include "lib/net/socket.h"
#include "lib/string/compat_ctype.h"
#include "lib/string/compat_string.h"
#include "lib/string/parse_int.h"
#include "lib/string/printf.h"
#include "lib/string/scanf.h"
#include "lib/string/util_string.h"
#include "lib/testsupport/testsupport.h"
#include "lib/thread/threads.h"
#include "lib/time/compat_time.h"
#include "lib/wallclock/approx_time.h"
#include "lib/wallclock/timeval.h"
#endif /* !defined(TOR_UTIL_H) */
......@@ -8,6 +8,7 @@ include src/lib/container/include.am
include src/lib/crypt_ops/include.am
include src/lib/defs/include.am
include src/lib/encoding/include.am
include src/lib/evloop/include.am
include src/lib/fdio/include.am
include src/lib/fs/include.am
include src/lib/include.libdonna.am
......@@ -31,7 +32,6 @@ include src/lib/time/include.am
include src/lib/tls/include.am
include src/lib/trace/include.am
include src/lib/wallclock/include.am
include src/common/include.am
include src/trunnel/include.am
include src/or/include.am
include src/rust/include.am
......
......@@ -21,6 +21,7 @@ noinst_HEADERS += \
src/lib/container/bitarray.h \
src/lib/container/bloomfilt.h \
src/lib/container/buffers.h \
src/lib/container/handles.h \
src/lib/container/map.h \
src/lib/container/order.h \
src/lib/container/smartlist.h
orconfig.h
lib/cc/*.h
lib/crypt_ops/*.h
lib/evloop/*.h
lib/intmath/*.h
lib/log/*.h
lib/malloc/*.h
lib/net/*.h
lib/string/*.h
lib/testsupport/*.h
lib/thread/*.h
lib/time/*.h
src/ext/timeouts/timeout.c
......@@ -8,7 +8,7 @@
#include "orconfig.h"
#define COMPAT_LIBEVENT_PRIVATE
#include "common/compat_libevent.h"
#include "lib/evloop/compat_libevent.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/log/torlog.h"
......
noinst_LIBRARIES += src/lib/libtor-evloop.a
if UNITTESTS_ENABLED
noinst_LIBRARIES += src/lib/libtor-evloop-testing.a
endif
src_lib_libtor_evloop_a_SOURCES = \
src/lib/evloop/compat_libevent.c \
src/lib/evloop/procmon.c \
src/lib/evloop/timers.c \
src/lib/evloop/token_bucket.c \
src/lib/evloop/workqueue.c
src_lib_libtor_evloop_testing_a_SOURCES = \
$(src_lib_libtor_evloop_a_SOURCES)
src_lib_libtor_evloop_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_lib_libtor_evloop_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
noinst_HEADERS += \
src/lib/evloop/compat_libevent.h \
src/lib/evloop/procmon.h \
src/lib/evloop/timers.h \
src/lib/evloop/token_bucket.h \
src/lib/evloop/workqueue.h
......@@ -6,7 +6,7 @@
* \brief Process-termination monitor functions
**/
#include "common/procmon.h"
#include "lib/evloop/procmon.h"
#include "lib/log/torlog.h"
#include "lib/log/util_bug.h"
......
......@@ -9,7 +9,7 @@
#ifndef TOR_PROCMON_H
#define TOR_PROCMON_H
#include "common/compat_libevent.h"
#include "lib/evloop/compat_libevent.h"
#include "lib/log/torlog.h"
......
......@@ -31,8 +31,8 @@
#define TOR_TIMERS_PRIVATE
#include "common/compat_libevent.h"
#include "common/timers.h"
#include "lib/evloop/compat_libevent.h"
#include "lib/evloop/timers.h"
#include "lib/intmath/muldiv.h"
#include "lib/log/torlog.h"
#include "lib/log/util_bug.h"
......
......@@ -18,7 +18,7 @@
#define TOKEN_BUCKET_PRIVATE
#include "common/token_bucket.h"
#include "lib/evloop/token_bucket.h"
#include "lib/log/util_bug.h"
#include "lib/intmath/cmp.h"
#include "lib/time/compat_time.h"
......
......@@ -24,8 +24,8 @@
*/
#include "orconfig.h"
#include "common/compat_libevent.h"
#include "common/workqueue.h"
#include "lib/evloop/compat_libevent.h"
#include "lib/evloop/workqueue.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/intmath/weakrng.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment