forked from OSchip/llvm-project
[COFF] Fix /wholearchive: to do libpath search again
Fixes https://crbug.com/852882 llvm-svn: 334761
This commit is contained in:
parent
aa283d80fe
commit
3408568392
|
@ -1247,8 +1247,9 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
|||
|
||||
std::set<sys::fs::UniqueID> WholeArchives;
|
||||
for (auto *Arg : Args.filtered(OPT_wholearchive_file))
|
||||
if (Optional<sys::fs::UniqueID> ID = getUniqueID(Arg->getValue()))
|
||||
WholeArchives.insert(*ID);
|
||||
if (Optional<StringRef> Path = doFindFile(Arg->getValue()))
|
||||
if (Optional<sys::fs::UniqueID> ID = getUniqueID(*Path))
|
||||
WholeArchives.insert(*ID);
|
||||
|
||||
// A predicate returning true if a given path is an argument for
|
||||
// /wholearchive:, or /wholearchive is enabled globally.
|
||||
|
@ -1266,7 +1267,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
|||
// for /defaultlib option.
|
||||
for (auto *Arg : Args.filtered(OPT_INPUT, OPT_wholearchive_file))
|
||||
if (Optional<StringRef> Path = findFile(Arg->getValue()))
|
||||
enqueuePath(*Path, IsWholeArchive(Arg->getValue()));
|
||||
enqueuePath(*Path, IsWholeArchive(*Path));
|
||||
|
||||
for (auto *Arg : Args.filtered(OPT_defaultlib))
|
||||
if (Optional<StringRef> Path = findLib(Arg->getValue()))
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
# RUN: mkdir -p %t.dir
|
||||
# RUN: cp %t.archive.lib %t.dir/foo.lib
|
||||
# RUN: lld-link -dll -out:%t.dll -entry:main %t.main.obj %t.dir/./foo.lib -wholearchive:%t.dir/foo.lib -implib:%t.lib
|
||||
# RUN: lld-link -dll -out:%t.dll -entry:main -libpath:%t.dir %t.main.obj %t.dir/./foo.lib -wholearchive:foo.lib -implib:%t.lib
|
||||
# RUN: llvm-readobj %t.lib | FileCheck %s -check-prefix CHECK-IMPLIB
|
||||
|
||||
# CHECK-IMPLIB: Symbol: __imp_exportfn3
|
||||
|
|
Loading…
Reference in New Issue