[PATCH] D53913: [llvm-objcopy] Support --{enable, disable}-deterministic-archives

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 10:52:53 PDT 2018


rupprecht marked an inline comment as done.
rupprecht added a comment.

In https://reviews.llvm.org/D53913#1281963, @jhenderson wrote:

> In https://reviews.llvm.org/D53913#1281632, @ruiu wrote:
>
> > I do not see any problem of adding these flags for the sake of compatibility with GNU. What I wondered is whether or not you really have a need to make it nondeterministic. I thought that we might be able to just ignore these flags.
>
>
> Personally, I think that if the default is to make them deterministic, then I don't see any reason not to allow overriding this default, as the code does not become significantly more complex with this change. However, I could be persuaded that nobody has this use case.


Ditto -- sorry for not understanding the comment earlier.

I only have a use case for explicitly setting deterministic archives. I don't have a use case for non-deterministic archives, although I could imagine some build systems maybe want it (for preserving timestamps). At any rate, it's trivial to provide. I think the onus is on someone providing evidence that exposing this option is *harmful*.



================
Comment at: tools/llvm-objcopy/CopyConfig.cpp:348-349
+      InputArgs.hasArg(OBJCOPY_disable_deterministic_archives))
+    error("Specifying both --enable-deterministic-archives and "
+          "--disable-deterministic-archives is ambiguous");
+  if (InputArgs.hasArg(OBJCOPY_enable_deterministic_archives))
----------------
jhenderson wrote:
> Is this what GNU objcopy does? I'd actually expect this to be a "last one wins" scenario (similar to various --[no-]some-option in LLD etc.
I thought it was simpler to just error instead of match objcopy, but it actually comes to fewer lines implementing last-one-wins. Done.


Repository:
  rL LLVM

https://reviews.llvm.org/D53913





More information about the llvm-commits mailing list