[PATCH] D88877: [ELF] Drop --whole-archive before processing dependent libraries.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 09:23:57 PDT 2020


MaskRay added a comment.

I am still concerned that we go down this route. Among --push-state pushed states, --as-needed and -Bstatic may be states users want to keep for the dependent libraries.

>> Regarding the build system, --whole-archive --no-whole-archive pairs are usually used together and localized. I'd still want to understand why there may be an unclosed --whole-archive. If there is an unclosed --whole-archive, with -static-libgcc, libgcc.a and libgcc_eh.a will be linked in --whole-archive mode. Usually there will be multiple definition issues in libgcc.a. Similarly, with -static-libstdc++, libstdc++/libc++ will be linked in --whole-archive mode.
>
> We are targeting a platform, which is not public. It has lots of its own specifics, and it does not use libgcc and friends.

I am on the fence whether this is a good argument for adding the additional logic. If you do have libraries with duplicate definitions, this will become very clear hard errors in --whole-archive mode. I am not sure "resetting to --no-whole-archive" is still needed. The argument is that this added inconsistency to the saved --push-state states.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88877/new/

https://reviews.llvm.org/D88877



More information about the llvm-commits mailing list