The -bcdtors:mbr option causes processing for constructors and destructors to omit otherwise-unreferenced members of static libraries, matching the processing done on Linux, where --whole-archive is not the default. Applying this option is desirable for reducing the footprint of an installation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
203 | This seems more generally applicable on AIX. Could we promote this out of the XL specific block and just pass it as a general linker option? |
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
203 | I don't think we should move this out of the XL-specific block at this time. GCC does not use the same mechanism for static initialization on AIX. |
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
201 | --whole-archive is used on Linux for building the shared libraries when -DLLVM_BUILD_LLVM_DYLIB=yes. Do we need to be concerned about this case? |
LGTM
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
201 | Summary of offline discussion: AIX would use the export list mechanism in place of --whole-archive, and the export list would make those symbols referenced so we’d pull in the initialization even with -bcdtors:mbr |
--whole-archive is used on Linux for building the shared libraries when -DLLVM_BUILD_LLVM_DYLIB=yes. Do we need to be concerned about this case?