[lld] [lld][MachO] Fix --reproduce paths for non-global symbol lists and SDK libraries/frameworks (PR #223687)
Xiaoyang Gong via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 15 20:47:04 PDT 2026
================
@@ -170,23 +170,10 @@ getSearchPaths(unsigned optionCode, InputArgList &args,
const SmallVector<StringRef, 2> &systemPaths) {
std::vector<StringRef> paths;
StringRef optionLetter{optionCode == OPT_F ? "F" : "L"};
- for (StringRef path : args::getStrings(args, optionCode)) {
- // NOTE: only absolute paths are re-rooted to syslibroot(s)
- bool found = false;
- if (path::is_absolute(path, path::Style::posix)) {
- for (StringRef root : roots) {
- SmallString<261> buffer(root);
- path::append(buffer, path);
- // Do not warn about paths that are computed via the syslib roots
- if (fs::is_directory(buffer)) {
- paths.push_back(saver().save(buffer.str()));
- found = true;
- }
- }
- }
- if (!found && warnIfNotDirectory(optionLetter, path))
- paths.push_back(path);
- }
+ for (StringRef path : args::getStrings(args, optionCode))
+ for (StringRef searchPath : getRerootedSearchPaths(path, roots))
+ if (warnIfNotDirectory(optionLetter, searchPath))
----------------
KotoriAster wrote:
`llvm::SmallVector` would be a better fit here :)
https://github.com/llvm/llvm-project/pull/223687
More information about the llvm-commits
mailing list