This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[GOLD] add new method for computing a build ID (take 2)


Sorry for the slow response.  Here is a second attempt that tries to
respond to Ian's comment: it uses a multi-threading style similar to that
of the rest of the program.

	* layout.cc (Hash_task): New class.
	(Layout::create_build_id): Allow --build-id=tree.
	(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::must_use_chunked_build_id_computation): New function.
	(Layout::start_asynchronous_build_id_if_needed): New function.
	(Close_task_runner::run): invoke start_asynchronous_build_id_if_needed.
	* layout.h (Layout::must_use_chunked_build_id_computation): New
	function declaration.
	(Layout::start_asynchronous_build_id_if_needed): New function
	declaration.
	* Makefile.am: add testing of --build-id=tree and related new options
	(these tests will be invoked by "make check")
	* Makefile.in: regenerate
	* 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.

Index: gold/layout.h
===================================================================
RCS file: /cvs/src/src/gold/layout.h,v
retrieving revision 1.105
diff -u -r1.105 layout.h
--- gold/layout.h	24 Aug 2012 18:35:34 -0000	1.105
+++ gold/layout.h	30 Oct 2012 23:45:39 -0000
@@ -884,6 +884,16 @@
 			  const Output_data_reloc_generic* dyn_rel,
 			  bool add_debug, bool dynrel_includes_plt);
 
+  bool
+  must_use_chunked_build_id_computation() const;
+
+  // If an asynchronous build ID computation hasn't been started and one
+  // would be useful, start it and return true.  Return false otherwise.
+  bool
+  start_asynchronous_build_id_if_needed(Workqueue* workqueue,
+                                        const General_options* options,
+                                        Output_file* of) const;
+
   // Compute and write out the build ID if needed.
   void
   write_build_id(Output_file*) const;
@@ -1342,6 +1352,12 @@
   Gdb_index* gdb_index_data_;
   // The space for the build ID checksum if there is one.
   Output_section_data* build_id_note_;
+  // Temporary storage for tree hash of build ID.
+  mutable unsigned char* array_of_hashes_;
+  // Size of array_of_hashes_ (in bytes).
+  mutable size_t size_of_array_of_hashes_;
+  // Input view for computing tree hash of build ID.  Freed in write_build_id().
+  mutable const unsigned char* input_view_;
   // The output section containing dwarf abbreviations
   Output_reduced_debug_abbrev_section* debug_abbrev_;
   // The output section containing the dwarf debug info tree
Index: gold/options.h
===================================================================
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.177
diff -u -r1.177 options.h
--- gold/options.h	7 Jun 2012 05:14:44 -0000	1.177
+++ gold/options.h	30 Oct 2012 23:45:39 -0000
@@ -652,10 +652,19 @@
   DEFINE_bool(Bsymbolic_functions, options::ONE_DASH, '\0', false,
 	      N_("Bind defined function symbols locally"), NULL);
 
-  DEFINE_optional_string(build_id, options::TWO_DASHES, '\0', "sha1",
+  DEFINE_optional_string(build_id, options::TWO_DASHES, '\0', "tree",
 			 N_("Generate build ID note"),
 			 N_("[=STYLE]"));
 
+  DEFINE_uint64(build_id_chunk_size_for_treehash,
+                options::TWO_DASHES, '\0', 2 << 20,
+                N_("Chunk size for '--build-id=tree'"), N_("SIZE"));
+
+  DEFINE_uint64(build_id_min_file_size_for_treehash, options::TWO_DASHES,
+                '\0', 200 << 20,
+                N_("Minimum output file size for '--build-id=tree' to work"
+                   " differently than '--build-id=sha1'"), N_("SIZE"));
+
   DEFINE_bool(check_sections, options::TWO_DASHES, '\0', true,
 	      N_("Check segment addresses for overlaps (default)"),
 	      N_("Do not check segment addresses for overlaps"));
Index: gold/layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.239
diff -u -r1.239 layout.cc
--- gold/layout.cc	16 Oct 2012 16:50:32 -0000	1.239
+++ gold/layout.cc	30 Oct 2012 23:45:39 -0000
@@ -236,6 +236,41 @@
 	  program_name, Free_list::num_allocate_visits);
 }
 
+// A Hash_task computes the MD5 checksum of an array of char.
+
+class Hash_task : public Task
+{
+ public:
+  Hash_task(const unsigned char* src,
+            size_t size,
+            unsigned char* dst,
+            Task_token* blocker)
+    : src_(src), size_(size), dst_(dst), blocker_(blocker)
+  { }
+
+  void
+  run(Workqueue*)
+  { md5_buffer(reinterpret_cast<const char*>(src_), size_, dst_); }
+
+  Task_token*
+  is_runnable()
+  { return NULL; }
+
+  void
+  locks(Task_locker* tl)
+  { tl->add(this, this->blocker_); }
+
+  std::string
+  get_name() const
+  { return "Hash_task"; }
+
+ private:
+  const unsigned char* const src_;
+  const size_t size_;
+  unsigned char* const dst_;
+  Task_token* const blocker_;
+};
+
 // Layout::Relaxation_debug_check methods.
 
 // Check that sections and special data are in reset states.
@@ -394,6 +429,9 @@
     eh_frame_hdr_section_(NULL),
     gdb_index_data_(NULL),
     build_id_note_(NULL),
+    array_of_hashes_(NULL),
+    size_of_array_of_hashes_(0),
+    input_view_(NULL),
     debug_abbrev_(NULL),
     debug_info_(NULL),
     group_signatures_(),
@@ -2873,7 +2911,7 @@
   std::string desc;
   if (strcmp(style, "md5") == 0)
     descsz = 128 / 8;
-  else if (strcmp(style, "sha1") == 0)
+  else if ((strcmp(style, "sha1") == 0) || (strcmp(style, "tree") == 0))
     descsz = 160 / 8;
   else if (strcmp(style, "uuid") == 0)
     {
@@ -5145,9 +5183,49 @@
   this->section_headers_->write(of);
 }
 
-// If the build ID requires computing a checksum, do so here, and
-// write it out.  We compute a checksum over the entire file because
-// that is simplest.
+bool
+Layout::start_asynchronous_build_id_if_needed(Workqueue* workqueue,
+                                              const General_options* options,
+                                              Output_file* of) const
+{
+  if (this->array_of_hashes_ == NULL
+      && this->must_use_chunked_build_id_computation())
+    {
+      static const size_t MD5_OUTPUT_SIZE_IN_BYTES = 16;
+      const char* style = parameters->options().build_id();
+      gold_assert(strcmp(style, "tree") == 0);
+      const size_t output_file_size = this->output_file_size();
+      size_t chunk_size =
+          parameters->options().build_id_chunk_size_for_treehash();
+      const size_t num_hashes = ((output_file_size - 1) / chunk_size) + 1;
+      this->size_of_array_of_hashes_ = num_hashes * MD5_OUTPUT_SIZE_IN_BYTES;
+      this->array_of_hashes_ =
+          new unsigned char[this->size_of_array_of_hashes_];
+      Task_token* blocker = new Task_token(true);
+      blocker->add_blockers(num_hashes);
+      const unsigned char* src = of->get_input_view(0, output_file_size);
+      this->input_view_ = src;
+      unsigned char *dst = this->array_of_hashes_;
+      for (size_t i = 0, src_offset = 0; i < num_hashes;
+           i++, dst += MD5_OUTPUT_SIZE_IN_BYTES, src_offset += chunk_size) {
+        chunk_size = std::min(chunk_size, output_file_size - src_offset);
+        workqueue->queue(new Hash_task(src + src_offset, chunk_size, dst,
+                                       blocker));
+      }
+      workqueue->queue(new Task_function(new Close_task_runner(options, this,
+                                                               of),
+                                         blocker,
+                                         "Task_function Close_task_runner"));
+      return true;
+    }
+
+  return false;
+}
+
+// Build IDs can be computed as a "flat" sha1 or md5 of a string of bytes,
+// or as a "tree" where each chunk of the string is hashed and then those
+// hashes are put into a (much smaller) string which is hashed with sha1.
+// We compute a checksum over the entire file because that is simplest.
 
 void
 Layout::write_build_id(Output_file* of) const
@@ -5155,34 +5233,51 @@
   if (this->build_id_note_ == NULL)
     return;
 
-  const unsigned char* iv = of->get_input_view(0, this->output_file_size_);
-
   unsigned char* ov = of->get_output_view(this->build_id_note_->offset(),
-					  this->build_id_note_->data_size());
+                                          this->build_id_note_->data_size());
 
-  const char* style = parameters->options().build_id();
-  if (strcmp(style, "sha1") == 0)
+  if (this->array_of_hashes_ == NULL)
     {
-      sha1_ctx ctx;
-      sha1_init_ctx(&ctx);
-      sha1_process_bytes(iv, this->output_file_size_, &ctx);
-      sha1_finish_ctx(&ctx, ov);
-    }
-  else if (strcmp(style, "md5") == 0)
-    {
-      md5_ctx ctx;
-      md5_init_ctx(&ctx);
-      md5_process_bytes(iv, this->output_file_size_, &ctx);
-      md5_finish_ctx(&ctx, ov);
+      const size_t output_file_size = this->output_file_size();
+      const unsigned char* iv = of->get_input_view(0, output_file_size);
+      const char* style = parameters->options().build_id();
+
+      // If we get here with style == "tree" then the output must be
+      // too small for chunking, and we use SHA-1 in that case.
+      if ((strcmp(style, "sha1") == 0) || (strcmp(style, "tree") == 0))
+        sha1_buffer(reinterpret_cast<const char*>(iv), output_file_size, ov);
+      else if (strcmp(style, "md5") == 0)
+        md5_buffer(reinterpret_cast<const char*>(iv), output_file_size, ov);
+      else
+        gold_unreachable();
+
+      of->free_input_view(0, output_file_size, iv);
     }
   else
-    gold_unreachable();
+    {
+      // Parallel computation of build ID is mostly done: all substrings
+      // of the output file have been hashed.  Compute SHA-1 hash of the hashes.
+      sha1_buffer(reinterpret_cast<const char*>(this->array_of_hashes_),
+                  this->size_of_array_of_hashes_, ov);
+      delete[] this->array_of_hashes_;
+      of->free_input_view(0, this->output_file_size(), this->input_view_);
+    }
 
   of->write_output_view(this->build_id_note_->offset(),
 			this->build_id_note_->data_size(),
 			ov);
+}
 
-  of->free_input_view(0, this->output_file_size_, iv);
+bool
+Layout::must_use_chunked_build_id_computation() const
+{
+  uint64_t filesize = (this->output_file_size_ <= 0 ? 0
+                       : static_cast<uint64_t>(this->output_file_size_));
+  return this->build_id_note_ != NULL
+      && (strcmp(parameters->options().build_id(), "tree") == 0)
+      && (parameters->options().build_id_chunk_size_for_treehash() > 0)
+      && (filesize >=
+          parameters->options().build_id_min_file_size_for_treehash());
 }
 
 // Write out a binary file.  This is called after the link is
@@ -5372,12 +5467,21 @@
 
 // Close_task_runner methods.
 
-// Run the task--close the file.
+// If a build ID is necessary, it is computed either with one
+// Close_rask_runner or with two.  The latter case is for the "tree" build ID
+// whose computation is parallelizable:  the first Close_task_runner in that
+// case starts the multi-threaded computation and returns, and the second is
+// invoked after the multi-threaded computation is done.
+void
+Close_task_runner::run(Workqueue* workqueue, const Task*)
+{
+  if (this->layout_->start_asynchronous_build_id_if_needed(workqueue,
+                                                           this->options_,
+                                                           this->of_))
+    return;
 
-void
-Close_task_runner::run(Workqueue*, const Task*)
-{
-  // If we need to compute a checksum for the BUILD if, we do so here.
+  // At this point the multi-threaded part of the build ID computation,
+  // if any, is done.
   this->layout_->write_build_id(this->of_);
 
   // If we've been asked to create a binary file, we do so here.
Index: gold/Makefile.am
===================================================================
RCS file: /cvs/src/src/gold/Makefile.am,v
retrieving revision 1.68
diff -u -r1.68 Makefile.am
--- gold/Makefile.am	24 Oct 2012 02:26:39 -0000	1.68
+++ gold/Makefile.am	30 Oct 2012 23:45:39 -0000
@@ -284,5 +284,52 @@
 check_PROGRAMS = ld1 ld2 ld1-r ld2-r
 TESTS = bootstrap-test bootstrap-test-r
 
+# If THREADS then we 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.
+if THREADS
+check_PROGRAMS += ld3 ld4
+TESTS += bootstrap-test-treehash 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 -Wl,--thread-count=3
+ld2_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 -Wl,--thread-count=3
+ld3_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 -Wl,--thread-count=13
+ld4_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12346 -Wl,--build-id-min-file-size-for-treehash=0 -Wl,--thread-count=3
+
+bootstrap-test-treehash: ld1 ld3
+	rm -f $@
+	echo "#!/bin/sh" > $@
+	echo "cmp ld1 ld3" > $@
+	chmod +x $@
+
+bootstrap-test-treehash-chunksize: ld1 ld4
+	rm -f $@
+	echo "#!/bin/sh" > $@
+	echo "cmp ld1 ld4 | grep ." > $@
+	chmod +x $@
+
+endif
+
 endif
 endif
Index: gold/Makefile.in
===================================================================
RCS file: /cvs/src/src/gold/Makefile.in,v
retrieving revision 1.95
diff -u -r1.95 Makefile.in
--- gold/Makefile.in	24 Oct 2012 02:26:39 -0000	1.95
+++ gold/Makefile.in	30 Oct 2012 23:45:39 -0000
@@ -42,7 +42,16 @@
 noinst_PROGRAMS = ld-new$(EXEEXT) incremental-dump$(EXEEXT)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@check_PROGRAMS = ld1$(EXEEXT) \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	ld2$(EXEEXT) ld1-r$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	ld2-r$(EXEEXT)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	ld2-r$(EXEEXT) $(am__EXEEXT_1)
+
+# If THREADS then we 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.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__append_1 = ld3 ld4
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__append_2 = bootstrap-test-treehash bootstrap-test-treehash-chunksize
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__append_3 = -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 -Wl,--thread-count=3
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__append_4 = -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 -Wl,--thread-count=3
 subdir = .
 DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
 	$(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -96,6 +105,9 @@
 	$(am__objects_3) $(am__objects_2)
 libgold_a_OBJECTS = $(am_libgold_a_OBJECTS)
 am__installdirs = "$(DESTDIR)$(bindir)"
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__EXEEXT_1 =  \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	ld3$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	ld4$(EXEEXT)
 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am_dwp_OBJECTS = dwp.$(OBJEXT)
 dwp_OBJECTS = $(am_dwp_OBJECTS)
@@ -128,6 +140,16 @@
 ld2_r_OBJECTS = $(am_ld2_r_OBJECTS)
 ld2_r_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ld2_r_LDFLAGS) \
 	$(LDFLAGS) -o $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am_ld3_OBJECTS =  \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	$(am__objects_4)
+ld3_OBJECTS = $(am_ld3_OBJECTS)
+ld3_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ld3_LDFLAGS) \
+	$(LDFLAGS) -o $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am_ld4_OBJECTS =  \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	$(am__objects_4)
+ld4_OBJECTS = $(am_ld4_OBJECTS)
+ld4_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ld4_LDFLAGS) \
+	$(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
 am__depfiles_maybe = depfiles
@@ -147,7 +169,7 @@
 SOURCES = $(libgold_a_SOURCES) $(dwp_SOURCES) \
 	$(incremental_dump_SOURCES) $(ld_new_SOURCES) \
 	$(EXTRA_ld_new_SOURCES) $(ld1_SOURCES) $(ld1_r_SOURCES) \
-	$(ld2_SOURCES) $(ld2_r_SOURCES)
+	$(ld2_SOURCES) $(ld2_r_SOURCES) $(ld3_SOURCES) $(ld4_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
 	install-dvi-recursive install-exec-recursive \
@@ -531,11 +553,13 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_SOURCES = $(sources_var)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDADD = $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDFLAGS = -Bgcctestdir1/
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDFLAGS = -Bgcctestdir1/ \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(am__append_3)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_SOURCES = $(sources_var)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDADD = $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDFLAGS = -Bgcctestdir2/
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDFLAGS = -Bgcctestdir2/ \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(am__append_4)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_SOURCES = $(sources_var)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
@@ -544,7 +568,26 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
 @GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_LDFLAGS = -Bgcctestdir2-r/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@TESTS = bootstrap-test bootstrap-test-r
+@GCC_TRUE@@NATIVE_LINKER_TRUE@TESTS = bootstrap-test bootstrap-test-r \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(am__append_2)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld3_SOURCES = $(sources_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld3_DEPENDENCIES = $(deps_var) gcctestdir3/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld3_LDADD = $(ldadd_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld3_LDFLAGS =  \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Bgcctestdir3/ \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id=tree \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id-chunk-size-for-treehash=12345 \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id-min-file-size-for-treehash=0 \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--thread-count=13
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld4_SOURCES = $(sources_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld4_DEPENDENCIES = $(deps_var) gcctestdir4/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld4_LDADD = $(ldadd_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ld4_LDFLAGS =  \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Bgcctestdir4/ \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id=tree \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id-chunk-size-for-treehash=12346 \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--build-id-min-file-size-for-treehash=0 \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	-Wl,--thread-count=3
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -679,6 +722,12 @@
 ld2-r$(EXEEXT): $(ld2_r_OBJECTS) $(ld2_r_DEPENDENCIES) 
 	@rm -f ld2-r$(EXEEXT)
 	$(ld2_r_LINK) $(ld2_r_OBJECTS) $(ld2_r_LDADD) $(LIBS)
+ld3$(EXEEXT): $(ld3_OBJECTS) $(ld3_DEPENDENCIES) 
+	@rm -f ld3$(EXEEXT)
+	$(ld3_LINK) $(ld3_OBJECTS) $(ld3_LDADD) $(LIBS)
+ld4$(EXEEXT): $(ld4_OBJECTS) $(ld4_DEPENDENCIES) 
+	@rm -f ld4$(EXEEXT)
+	$(ld4_LINK) $(ld4_OBJECTS) $(ld4_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -1070,6 +1119,10 @@
 	@p='bootstrap-test'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 bootstrap-test-r.log: bootstrap-test-r
 	@p='bootstrap-test-r'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+bootstrap-test-treehash.log: bootstrap-test-treehash
+	@p='bootstrap-test-treehash'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+bootstrap-test-treehash-chunksize.log: bootstrap-test-treehash-chunksize
+	@p='bootstrap-test-treehash-chunksize'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
 .test.log:
 	@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
 @am__EXEEXT_TRUE@.test$(EXEEXT).log:
@@ -1286,6 +1339,28 @@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	echo "cmp ld1-r ld2-r" > $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	chmod +x $@
 
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@gcctestdir3/ld: ld-new
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	test -d gcctestdir3 || mkdir -p gcctestdir3
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	rm -f gcctestdir3/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	(cd gcctestdir3 && $(LN_S) ../ld-new ld)
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@gcctestdir4/ld: ld-new
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	test -d gcctestdir4 || mkdir -p gcctestdir4
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	rm -f gcctestdir4/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	(cd gcctestdir4 && $(LN_S) ../ld-new ld)
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@bootstrap-test-treehash: ld1 ld3
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	rm -f $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	echo "#!/bin/sh" > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	echo "cmp ld1 ld3" > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	chmod +x $@
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@bootstrap-test-treehash-chunksize: ld1 ld4
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	rm -f $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	echo "#!/bin/sh" > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	echo "cmp ld1 ld4 | grep ." > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@	chmod +x $@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]