diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h --- a/lld/ELF/Config.h +++ b/lld/ELF/Config.h @@ -127,6 +127,7 @@ bool ARMHasMovtMovw = false; bool ARMJ1J2BranchEncoding = false; bool AsNeeded = false; + bool Bstatic = false; bool Bsymbolic; bool BsymbolicFunctions; bool CallGraphProfileSort; @@ -171,7 +172,6 @@ bool SaveTemps; bool SingleRoRx; bool Shared; - bool Static = false; bool SysvHash = false; bool Target1Rel; bool Trace; diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -223,7 +223,7 @@ return; } case file_magic::elf_shared_object: - if (Config->Static || Config->Relocatable) { + if (Config->Bstatic || Config->Relocatable) { error("attempted static link of dynamic object " + Path); return; } @@ -1095,10 +1095,10 @@ Config->AsNeeded = false; break; case OPT_Bstatic: - Config->Static = true; + Config->Bstatic = true; break; case OPT_Bdynamic: - Config->Static = false; + Config->Bstatic = false; break; case OPT_whole_archive: InWholeArchive = true; @@ -1139,14 +1139,14 @@ ++InputFile::NextGroupId; break; case OPT_push_state: - Stack.emplace_back(Config->AsNeeded, Config->Static, InWholeArchive); + Stack.emplace_back(Config->AsNeeded, Config->Bstatic, InWholeArchive); break; case OPT_pop_state: if (Stack.empty()) { error("unbalanced --push-state/--pop-state"); break; } - std::tie(Config->AsNeeded, Config->Static, InWholeArchive) = Stack.back(); + std::tie(Config->AsNeeded, Config->Bstatic, InWholeArchive) = Stack.back(); Stack.pop_back(); break; } diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -224,7 +224,7 @@ return findFromSearchPaths(Name.substr(1)); for (StringRef Dir : Config->SearchPaths) { - if (!Config->Static) + if (!Config->Bstatic) if (Optional S = findFile(Dir, "lib" + Name + ".so")) return S; if (Optional S = findFile(Dir, "lib" + Name + ".a"))