diff options
author | Alexandre Ganea <37383324+aganea@users.noreply.github.com> | 2024-01-11 19:08:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 19:08:28 -0500 |
commit | 3c6f47d6b879ddd2842925d2e5da54657d9e5631 (patch) | |
tree | 4ca26d8dba3b6e39532a99199fdadd792f1c5097 /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | |
parent | 4cee0e3c88d4e5c96cda0a4c3e2e91d4d4b1df69 (diff) | |
download | llvm-3c6f47d6b879ddd2842925d2e5da54657d9e5631.zip llvm-3c6f47d6b879ddd2842925d2e5da54657d9e5631.tar.gz llvm-3c6f47d6b879ddd2842925d2e5da54657d9e5631.tar.bz2 |
[llvm-driver] Fix usage of `InitLLVM` on Windows (#76306)
Previously, some tools such as `clang` or `lld` which require strict
order for certain command-line options, such as `clang -cc1` or `lld
-flavor`, would not longer work on Windows, when these tools were linked
as part of `llvm-driver`. This was caused by `InitLLVM` which was part
of the `*_main()` function of these tools, which in turn calls
`windows::GetCommandLineArguments`. That function completly replaces
argc/argv by new UTF-8 contents, so any ajustements to argc/argv made by
`llvm-driver` prior to calling these tools was reset.
`InitLLVM` is now called by the `llvm-driver`. Any tool that
participates in (or is part of) the `llvm-driver` doesn't call
`InitLLVM` anymore.
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r-- | llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp index 45e04d8..77ae9b4 100644 --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -23,7 +23,6 @@ #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/InitLLVM.h" #include "llvm/Support/LLVMDriver.h" #include "llvm/Support/LineIterator.h" #include "llvm/Support/TargetSelect.h" @@ -727,7 +726,6 @@ static Expected<Config> parseCommandLine(int Argc, char **Argv) { } int llvm_libtool_darwin_main(int Argc, char **Argv, const llvm::ToolContext &) { - InitLLVM X(Argc, Argv); Expected<Config> ConfigOrErr = parseCommandLine(Argc, Argv); if (!ConfigOrErr) { WithColor::defaultErrorHandler(ConfigOrErr.takeError()); |