From ebf9ffd342a30c7c79657f5dbfc83fde0647e630 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Tue, 1 Nov 2022 11:56:25 +0100 Subject: [PATCH] cli: set sysroot when --sysroot option was passed Fixes regression introduced in https://github.com/ziglang/zig/commit/0b47e69b7c0aedbc142400305cda86ef58b41656 --- src/main.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 762735dd8b..d0edbbed6d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1034,8 +1034,9 @@ fn buildOutputType( } else if (mem.eql(u8, arg, "--dynamic-linker")) { target_dynamic_linker = args_iter.nextOrFatal(); } else if (mem.eql(u8, arg, "--sysroot")) { + sysroot = args_iter.nextOrFatal(); try clang_argv.append("-isysroot"); - try clang_argv.append(args_iter.nextOrFatal()); + try clang_argv.append(sysroot.?); } else if (mem.eql(u8, arg, "--libc")) { libc_paths_file = args_iter.nextOrFatal(); } else if (mem.eql(u8, arg, "--test-filter")) {