aboutsummaryrefslogtreecommitdiff
path: root/gold/Makefile.am
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2013-04-26 21:38:57 +0000
committerCary Coutant <ccoutant@google.com>2013-04-26 21:38:57 +0000
commite7c5ea405fd863a9fcf85d49694e0f69fd5511ec (patch)
treeb0f6073044c3fcf77b5cfba088ef59bc3ccf052c /gold/Makefile.am
parentee441d9a9a2df27e795cfdbf80048f42bb1504cc (diff)
downloadgdb-e7c5ea405fd863a9fcf85d49694e0f69fd5511ec.zip
gdb-e7c5ea405fd863a9fcf85d49694e0f69fd5511ec.tar.gz
gdb-e7c5ea405fd863a9fcf85d49694e0f69fd5511ec.tar.bz2
2013-04-26 Geoff Pike <gpike@chromium.org>
gold/ * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks(). * layout.cc (Hash_task): New class. (Layout::queue_build_id_tasks): New function. (Layout::write_build_id): Handle single-thread portion of build ID computation. (In some cases, all of it is single-threaded.) Replace {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same functionality in fewer lines of code. * layout.h (Layout::queue_build_id_tasks): New function declaration. * options.h (General_options): make "--build-id" default to tree rather than sha1. Add two new options related to --build-id=tree: --build-id-chunk-size-for-treehash and --build-id-min-file-size-for-treehash. * Makefile.am: add testing of --build-id=tree and related new options (these tests will be invoked by "make check"). * Makefile.in: Regenerate.
Diffstat (limited to 'gold/Makefile.am')
-rw-r--r--gold/Makefile.am61
1 files changed, 59 insertions, 2 deletions
diff --git a/gold/Makefile.am b/gold/Makefile.am
index f6ced44..8e2fff1 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -269,7 +269,7 @@ ld2_LDFLAGS = -Bgcctestdir2/
bootstrap-test: ld2
rm -f $@
echo "#!/bin/sh" > $@
- echo "cmp ld1 ld2" > $@
+ echo "cmp ld1 ld2" >> $@
chmod +x $@
libgold-1-r.o: gcctestdir1/ld libgold.a
@@ -296,11 +296,68 @@ ld2_r_LDFLAGS = -Bgcctestdir2-r/
bootstrap-test-r: ld2-r
rm -f $@
echo "#!/bin/sh" > $@
- echo "cmp ld1-r ld2-r" > $@
+ echo "cmp ld1-r ld2-r" >> $@
chmod +x $@
check_PROGRAMS = ld1 ld2 ld1-r ld2-r
TESTS = bootstrap-test bootstrap-test-r
+# Verify that changing the number of threads doesn't change the
+# treehash computation, by building ld1 and ld3 the same way except
+# for the number of threads. However, the build ID should change if
+# we change the chunk size for --build-id=tree, so ld4 should be
+# different. We run the latter test even if multithreading is unavailable,
+# because the treehash can still operate in that mode.
+check_PROGRAMS += ld4
+TESTS += bootstrap-test-treehash-chunksize
+
+gcctestdir3/ld: ld-new
+ test -d gcctestdir3 || mkdir -p gcctestdir3
+ rm -f gcctestdir3/ld
+ (cd gcctestdir3 && $(LN_S) ../ld-new ld)
+
+ld3_SOURCES = $(sources_var)
+ld3_DEPENDENCIES = $(deps_var) gcctestdir3/ld
+ld3_LDADD = $(ldadd_var)
+ld3_LDFLAGS = -Bgcctestdir3/
+
+gcctestdir4/ld: ld-new
+ test -d gcctestdir4 || mkdir -p gcctestdir4
+ rm -f gcctestdir4/ld
+ (cd gcctestdir4 && $(LN_S) ../ld-new ld)
+
+ld4_SOURCES = $(sources_var)
+ld4_DEPENDENCIES = $(deps_var) gcctestdir4/ld
+ld4_LDADD = $(ldadd_var)
+ld4_LDFLAGS = -Bgcctestdir4/
+
+ld1_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
+ld2_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
+ld3_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0
+ld4_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12346 -Wl,--build-id-min-file-size-for-treehash=0
+
+if THREADS
+
+ld1_LDFLAGS += -Wl,--thread-count=3
+ld2_LDFLAGS += -Wl,--thread-count=3
+ld3_LDFLAGS += -Wl,--thread-count=13
+ld4_LDFLAGS += -Wl,--thread-count=3
+check_PROGRAMS += ld3
+TESTS += bootstrap-test-treehash-chunksize
+
+bootstrap-test-treehash: ld1 ld3
+ rm -f $@
+ echo "#!/bin/sh" > $@
+ echo "cmp ld1 ld3" >> $@
+ chmod +x $@
+
+endif
+
+bootstrap-test-treehash-chunksize: ld1 ld4
+ rm -f $@
+ echo "#!/bin/sh" > $@
+ echo "cmp ld1 ld4 | grep ." >> $@
+ chmod +x $@
+
endif
endif