[PATCH] D23349: [ELF] Support for --build-id=uuid

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 11:22:07 PDT 2016


ruiu added a comment.

I asked the question because we do not usually create features just because other linkers have them, so I wanted to confirm that you actually needed it. So there's no problem to add this feature to LLD.


================
Comment at: ELF/OutputSections.cpp:1687
@@ -1678,1 +1686,3 @@
 template <class ELFT>
+void BuildIdUuid<ELFT>::writeBuildId(ArrayRef<ArrayRef<uint8_t>> Bufs) {
+#ifdef LLVM_ON_WIN32
----------------
evgeny777 wrote:
> ruiu wrote:
> > I'd add code to generate a RNG to LLVM rather than to LLD because it seems generic and should be useful in other places.
> You mean creating random GUID, don't you?
GUID is actually jus random 16 bytes, so maybe adding a function to create a GUID is too narrowly scoped. How about defining a function that returns truely random bytes of any length? Like

  std::vector<uint8_t> getRandomBytes(size_t Length);


Repository:
  rL LLVM

https://reviews.llvm.org/D23349





More information about the llvm-commits mailing list