[lld] [LLD][COFF] Handle --start-lib/--end-lib group in the same way as other archives (PR #136496)
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Fri May 2 14:47:34 PDT 2025
================
@@ -259,17 +244,24 @@ MemoryBufferRef LinkerDriver::takeBuffer(std::unique_ptr<MemoryBuffer> mb) {
}
void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
- bool wholeArchive, bool lazy) {
+ bool wholeArchive,
+ CmdLineArchive *inCmdLineArchive) {
StringRef filename = mb->getBufferIdentifier();
MemoryBufferRef mbref = takeBuffer(std::move(mb));
// File type is detected by contents, not by file extension.
switch (identify_magic(mbref.getBuffer())) {
case file_magic::windows_resource:
+ assert(!inCmdLineArchive &&
+ "Cannot specify a RES file inside a --start-lib/--end-lib group.");
resources.push_back(mbref);
break;
case file_magic::archive:
+ // FIXME: We could later support --start-lib/--end-lib groups, to allow for
+ // "extending" an existing archive/LIB.
+ assert(!inCmdLineArchive &&
----------------
aganea wrote:
Changed asserts to warnings.
https://github.com/llvm/llvm-project/pull/136496
More information about the llvm-commits
mailing list