[PATCH] D66848: [lld-link] implement -start-lib and -end-lib
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 20:00:24 PDT 2019
ruiu added inline comments.
================
Comment at: lld/test/COFF/start-lib-cmd-diagnostics.ll:14
+
+; RUN: not lld-link -start-lib %t.obj -wholearchive:%t.obj 2>&1 \
+; RUN: | FileCheck --check-prefix=WHOLEARCHIVE %s
----------------
MaskRay wrote:
> What made you decide -start-lib and -wholearchive: cannot be used together?
>
> I noticed that -wholearchive: can apply on both archives and regular object files. However, there is no test before this patch that test -wholearchive: can apply on object files.
>
> In ELF, the -wholearchive: counterpart is a pair of --whole-archive and --no-whole-archive. --start-lib is allowed to be used together because
>
> * --start-lib applies on object files
> * --whole-archive applies on archives
>
> Their use cases don't overlap so their combination is not rejected.
I agree with MaskRay. Giving static libraries object file semantics and object files library file semantics at the same time seems odd but they don't technically conflict. I can't think of a sane use case of the combination of the features, but I don't think we should ban the combination.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66848/new/
https://reviews.llvm.org/D66848
More information about the llvm-commits
mailing list