diff options
| author | Martin Wickham <spexguy070@gmail.com> | 2021-07-09 17:53:08 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-07-10 15:58:38 -0400 |
| commit | 84a544f96c4ece6b6e4eba4bd40c9d29dd74ec49 (patch) | |
| tree | 89ad0559f0a0724622cf108667efb1b4a58e4416 /src/zig_llvm-ar.cpp | |
| parent | 7b5d139fd30a7225f073125b8a53e51a2454d223 (diff) | |
| download | zig-84a544f96c4ece6b6e4eba4bd40c9d29dd74ec49.tar.gz zig-84a544f96c4ece6b6e4eba4bd40c9d29dd74ec49.zip | |
Fix argument forwarding to LLVM on Windows
Diffstat (limited to 'src/zig_llvm-ar.cpp')
| -rw-r--r-- | src/zig_llvm-ar.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zig_llvm-ar.cpp b/src/zig_llvm-ar.cpp index 158a0a6836..e4c376adbc 100644 --- a/src/zig_llvm-ar.cpp +++ b/src/zig_llvm-ar.cpp @@ -1522,7 +1522,14 @@ static int ranlib_main(int argc, char **argv) { extern "C" int ZigLlvmAr_main(int argc, char **argv); int ZigLlvmAr_main(int argc, char **argv) { - InitLLVM X(argc, argv); + // ZIG MOD: On windows, InitLLVM calls GetCommandLineW(), + // and overwrites the args. We don't want it to do that, + // and we also don't need the signal handlers it installs + // (we have our own already), so we just use llvm_shutdown_obj + // instead. + // InitLLVM X(argc, argv); + llvm::llvm_shutdown_obj X; + ToolName = argv[0]; llvm::InitializeAllTargetInfos(); |
