From e9dbb5e395097f4ae38d17cf27408c2688b90d2b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Sep 2020 12:17:02 -0400 Subject: Build one big .a library full of Tor's implementation. This is experimental and probably will break some platforms --- scripts/build/combine_libs | 35 +++++++++++++++++++++++++++++++++++ scripts/codegen/fuzzing_include_am.py | 4 ++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 scripts/build/combine_libs (limited to 'scripts') diff --git a/scripts/build/combine_libs b/scripts/build/combine_libs new file mode 100755 index 0000000000..fb311552fe --- /dev/null +++ b/scripts/build/combine_libs @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +TMPDIR="$(mktemp -d -t tor_lib_combining.XXXXXX)" +ORIGDIR="$(pwd)" + +trap 'cd "$ORIGDIR" && rm -rf "$TMPDIR"' 0 + +abspath() { + echo "$(cd "$(dirname "$1")">/dev/null && pwd)/$(basename "$1")" +} + +TARGET=$(abspath "$1") + +#echo ORIGDIR="$ORIGDIR" +#echo AR="$AR" +#echo ARFLAGS="$AFLAGS" + +shift + +for input in "$@"; do + cd "$ORIGDIR" + abs=$(abspath "$input") + dir="$TMPDIR"/$(basename "$input" .a) + mkdir "$dir" + cd "$dir">/dev/null + ar x "$abs" +done + +cd "$TMPDIR" >/dev/null +#echo "${AR:-ar}" "${ARFLAGS:-cru}" library.tmp.a ./*/** +"${AR:-ar}" "${ARFLAGS:-cru}" library.tmp.a ./*/** +"${RANLIB:-ranlib}" library.tmp.a +mv -f library.tmp.a "$TARGET" diff --git a/scripts/codegen/fuzzing_include_am.py b/scripts/codegen/fuzzing_include_am.py index b3892b6fd3..3f8e51810b 100755 --- a/scripts/codegen/fuzzing_include_am.py +++ b/scripts/codegen/fuzzing_include_am.py @@ -31,7 +31,7 @@ FUZZING_CFLAGS = \ FUZZING_LDFLAG = \ @TOR_LDFLAGS_zlib@ $(TOR_LDFLAGS_CRYPTLIB) @TOR_LDFLAGS_libevent@ FUZZING_LIBS = \ - $(TOR_INTERNAL_TESTING_LIBS) \ + src/test/libtor-testing.a \ $(rust_ldadd) \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \ @TOR_LIBEVENT_LIBS@ $(TOR_LIBS_CRYPTLIB) \ @@ -41,7 +41,7 @@ FUZZING_LIBS = \ @TOR_ZSTD_LIBS@ oss-fuzz-prereqs: \ - $(TOR_INTERNAL_TESTING_LIBS) + src/test/libtor-testing.a noinst_HEADERS += \ src/test/fuzz/fuzzing.h -- cgit v1.2.3-54-g00ecf From 4ae881928b04d4d6fea27460f3379ed79d069336 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Sep 2020 14:30:03 -0400 Subject: Add TOR_TRACE_LIBS to fuzzing_include_am.py (It looks like it was forgotten previously) --- scripts/codegen/fuzzing_include_am.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/codegen/fuzzing_include_am.py b/scripts/codegen/fuzzing_include_am.py index 3f8e51810b..b52b956f81 100755 --- a/scripts/codegen/fuzzing_include_am.py +++ b/scripts/codegen/fuzzing_include_am.py @@ -38,7 +38,8 @@ FUZZING_LIBS = \ @TOR_LIB_WS32@ @TOR_LIB_IPHLPAPI@ @TOR_LIB_SHLWAPI@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ @CURVE25519_LIBS@ \ @TOR_SYSTEMD_LIBS@ \ @TOR_LZMA_LIBS@ \ - @TOR_ZSTD_LIBS@ + @TOR_ZSTD_LIBS@ \ + @TOR_TRACE_LIBS@ oss-fuzz-prereqs: \ src/test/libtor-testing.a -- cgit v1.2.3-54-g00ecf