zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 2b6dfdd3d403fb33e226aa2566eacfad4b251379 (tree)
parent 783f73c7e3590f05825d66f1f0ccb108be74b5c4
Author: Rejean Loyer <rejean.loyer@gmail.com>
Date:   Wed,  1 Apr 2020 05:22:19 -0400

zig cc: add support for -L linker arguments

Diffstat:
Msrc-self-hosted/clang_options_data.zig | 13++++++++++---
Msrc-self-hosted/stage2.zig | 1+
Msrc/main.cpp | 3+++
Msrc/stage2.h | 1+
Mtools/update_clang_options.zig | 8++++++++
5 files changed, 23 insertions(+), 3 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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{};