diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index 6dec81493..533451b5e 100644 --- a/src-self-hosted/clang_options_data.zig +++ b/src-self-hosted/clang_options_data.zig @@ -1658,7 +1658,7 @@ sepd1("Zlinker-input"), .{ .name = "library-directory", .syntax = .separate, - .zig_equivalent = .other, + .zig_equivalent = .linker_input_l, .pd1 = false, .pd2 = true, .psl = false, @@ -4534,7 +4534,7 @@ joinpd1("target-sdk-version="), .{ .name = "library-directory=", .syntax = .joined, - .zig_equivalent = .other, + .zig_equivalent = .linker_input_l, .pd1 = false, .pd2 = true, .psl = false, @@ -5632,7 +5632,14 @@ jspd1("F"), jspd1("G"), jspd1("I"), jspd1("J"), -jspd1("L"), +.{ + .name = "L", + .syntax = .joined_or_separate, + .zig_equivalent = .linker_input_l, + .pd1 = true, + .pd2 = false, + .psl = false, +}, .{ .name = "O", .syntax = .joined, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index 56f608c28..d4503a3a5 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1288,6 +1288,7 @@ pub const ClangArgIterator = extern struct { verbose_cmds, for_linker, linker_input_z, + linker_input_l, }; const Args = struct { diff --git a/src/main.cpp b/src/main.cpp index e9babe562..3bfb15440 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -735,6 +735,9 @@ static int main0(int argc, char **argv) { linker_args.append(buf_create_from_str("-z")); linker_args.append(buf_create_from_str(it.only_arg)); break; + case Stage2ClangArgLinkerInputL: + lib_dirs.append(it.only_arg); + break; } } // Parse linker args diff --git a/src/stage2.h b/src/stage2.h index 49e0dcc28..449635f2f 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -347,6 +347,7 @@ enum Stage2ClangArg { Stage2ClangArgVerboseCmds, Stage2ClangArgForLinker, Stage2ClangArgLinkerInputZ, + Stage2ClangArgLinkerInputL, }; // ABI warning diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index d2ad8cad3..24e822352 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -174,6 +174,14 @@ const known_options = [_]KnownOpt{ .name = "###", .ident = "verbose_cmds", }, + .{ + .name = "L", + .ident = "linker_input_l", + }, + .{ + .name = "library-directory", + .ident = "linker_input_l", + }, }; const blacklisted_options = [_][]const u8{};