diff --git a/src-self-hosted/clang_options_data.zig b/src-self-hosted/clang_options_data.zig index 533451b5e..f24039ba3 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 = .linker_input_l, + .zig_equivalent = .lib_dir, .pd1 = false, .pd2 = true, .psl = false, @@ -4534,7 +4534,7 @@ joinpd1("target-sdk-version="), .{ .name = "library-directory=", .syntax = .joined, - .zig_equivalent = .linker_input_l, + .zig_equivalent = .lib_dir, .pd1 = false, .pd2 = true, .psl = false, @@ -5254,8 +5254,22 @@ joinpd1("fixit="), joinpd1("gstabs"), joinpd1("gxcoff"), jspd1("iquote"), -joinpd1("march="), -joinpd1("mtune="), +.{ + .name = "march=", + .syntax = .joined, + .zig_equivalent = .mcpu, + .pd1 = true, + .pd2 = false, + .psl = false, +}, +.{ + .name = "mtune=", + .syntax = .joined, + .zig_equivalent = .mcpu, + .pd1 = true, + .pd2 = false, + .psl = false, +}, .{ .name = "rtlib=", .syntax = .joined, @@ -5320,7 +5334,14 @@ joinpd1("gcoff"), joinpd1("mabi="), joinpd1("mabs="), joinpd1("masm="), -joinpd1("mcpu="), +.{ + .name = "mcpu=", + .syntax = .joined, + .zig_equivalent = .mcpu, + .pd1 = true, + .pd2 = false, + .psl = false, +}, joinpd1("mfpu="), joinpd1("mhvx="), joinpd1("mmcu="), @@ -5635,7 +5656,7 @@ jspd1("J"), .{ .name = "L", .syntax = .joined_or_separate, - .zig_equivalent = .linker_input_l, + .zig_equivalent = .lib_dir, .pd1 = true, .pd2 = false, .psl = false, diff --git a/src-self-hosted/stage2.zig b/src-self-hosted/stage2.zig index d4503a3a5..798fb552c 100644 --- a/src-self-hosted/stage2.zig +++ b/src-self-hosted/stage2.zig @@ -1288,7 +1288,8 @@ pub const ClangArgIterator = extern struct { verbose_cmds, for_linker, linker_input_z, - linker_input_l, + lib_dir, + mcpu, }; const Args = struct { diff --git a/src/main.cpp b/src/main.cpp index 3bfb15440..206b73332 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -735,9 +735,12 @@ 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: + case Stage2ClangArgLibDir: lib_dirs.append(it.only_arg); break; + case Stage2ClangArgMCpu: + mcpu = it.only_arg; + break; } } // Parse linker args diff --git a/src/stage2.h b/src/stage2.h index 449635f2f..8bb269dd2 100644 --- a/src/stage2.h +++ b/src/stage2.h @@ -347,7 +347,8 @@ enum Stage2ClangArg { Stage2ClangArgVerboseCmds, Stage2ClangArgForLinker, Stage2ClangArgLinkerInputZ, - Stage2ClangArgLinkerInputL, + Stage2ClangArgLibDir, + Stage2ClangArgMCpu, }; // ABI warning diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index 24e822352..b85d70847 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -176,11 +176,23 @@ const known_options = [_]KnownOpt{ }, .{ .name = "L", - .ident = "linker_input_l", + .ident = "lib_dir", }, .{ .name = "library-directory", - .ident = "linker_input_l", + .ident = "lib_dir", + }, + .{ + .name = "mcpu", + .ident = "mcpu", + }, + .{ + .name = "march", + .ident = "mcpu", + }, + .{ + .name = "mtune", + .ident = "mcpu", }, };