zturner requested changes to this revision. zturner added inline comments. This revision now requires changes to proceed.
================ Comment at: lib/Driver/ToolChains/MSVC.cpp:48-50 + // Undefine this macro so we can call the ANSI version of the function. + #undef GetEnvironmentStrings + #define GetEnvironmentStringsA GetEnvironmentStrings ---------------- I think you will need to delete this part (see comment below). ================ Comment at: lib/Driver/ToolChains/MSVC.cpp:474 + + char *EnvBlock = GetEnvironmentStringsA(); + if (EnvBlock == nullptr) goto SkipSettingEnvironment; ---------------- This is all wrong. In the implementation of `ExecuteAndWait`, we construct a wide environment by calling `UTF8toUTF16` on each string. `GetEnvironmentStringsA` not only doesn't return UTF8, it doesn't even return ANSI characters. I think you need to do the work to call `GetEnvironmentStringsW`, then do the reverse of the operation performed in `llvm/lib/Support/Windows/Program.inc` in the `static bool Execute` function. It's unfortunate that there's not a version that already takes a wide character array, though. https://reviews.llvm.org/D30991 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits