diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-09-18 12:17:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-09-18 16:08:24 -0400 |
commit | e9dbb5e395097f4ae38d17cf27408c2688b90d2b (patch) | |
tree | ee052c101eb87d11ba3c692db1b90dffc4642dc5 /scripts | |
parent | e8a4482335a1ed6b8238fc7114e3fdd3d7fa9028 (diff) | |
download | tor-e9dbb5e395097f4ae38d17cf27408c2688b90d2b.tar.gz tor-e9dbb5e395097f4ae38d17cf27408c2688b90d2b.zip |
Build one big .a library full of Tor's implementation.
This is experimental and probably will break some platforms
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/combine_libs | 35 | ||||
-rwxr-xr-x | scripts/codegen/fuzzing_include_am.py | 4 |
2 files changed, 37 insertions, 2 deletions
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 |