diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -229,6 +229,7 @@ path::replace_extension(importFile, ".imports"); if (fs::exists(importFile)) readImportFile(importFile.str()); + dbgs() << "new archive: " << mbref.getBufferIdentifier() << "\n"; // Handle -whole-archive. if (inWholeArchive) { @@ -245,7 +246,9 @@ ": archive has no index; run ranlib to add one"); } - files.push_back(make(mbref)); + auto* F = make(mbref); + dbgs() << "new archive: " << F->getName() << "\n"; + files.push_back(F); return; } case file_magic::bitcode: @@ -259,6 +262,7 @@ // Add a given library by searching it from input search paths. void LinkerDriver::addLibrary(StringRef name) { + dbgs() << "XXX\n"; for (StringRef dir : config->searchPaths) { if (Optional s = findFile(dir, "lib" + name + ".a")) { addFile(*s); diff --git a/lld/wasm/InputFiles.h b/lld/wasm/InputFiles.h --- a/lld/wasm/InputFiles.h +++ b/lld/wasm/InputFiles.h @@ -54,7 +54,7 @@ Kind kind() const { return fileKind; } // An archive file name if this file is created from an archive. - StringRef archiveName; + std::string archiveName; ArrayRef getSymbols() const { return symbols; }