authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-06 19:50:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-06 19:50:53-07:00
logf253822415304fc069f68452f7f4abbded58a24e
tree2333e64c7d81b2948ec30b29c659f90b066e5c45
parentec212c82bef3cbf01517eece67a8599348c7ac86

stage2: do not set clang_passthrough_mode for `zig run`

Thanks to @g-w1 for discovering this bug. closes #8450

1 files changed, 6 insertions(+), 1 deletions(-)

src/main.zig+6-1
...@@ -1815,6 +1815,11 @@ fn buildOutputType(...@@ -1815,6 +1815,11 @@ fn buildOutputType(
1815 @import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv);1815 @import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv);
1816 }1816 }
18171817
1818 const clang_passthrough_mode = switch (arg_mode) {
1819 .cc, .cpp, .translate_c => true,
1820 else => false,
1821 };
1822
1818 gimmeMoreOfThoseSweetSweetFileDescriptors();1823 gimmeMoreOfThoseSweetSweetFileDescriptors();
18191824
1820 const comp = Compilation.create(gpa, .{1825 const comp = Compilation.create(gpa, .{
...@@ -1886,7 +1891,7 @@ fn buildOutputType(...@@ -1886,7 +1891,7 @@ fn buildOutputType(
1886 .function_sections = function_sections,1891 .function_sections = function_sections,
1887 .self_exe_path = self_exe_path,1892 .self_exe_path = self_exe_path,
1888 .thread_pool = &thread_pool,1893 .thread_pool = &thread_pool,
1889 .clang_passthrough_mode = arg_mode != .build,1894 .clang_passthrough_mode = clang_passthrough_mode,
1890 .clang_preprocessor_mode = clang_preprocessor_mode,1895 .clang_preprocessor_mode = clang_preprocessor_mode,
1891 .version = optional_version,1896 .version = optional_version,
1892 .libc_installation = if (libc_installation) |*lci| lci else null,1897 .libc_installation = if (libc_installation) |*lci| lci else null,