authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-18 14:08:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-18 14:16:07-07:00
log4f9345d20b3b95a1ccfe894bddd8ba5879c10c31
tree65922fdc968b359fa73cce0a1ae1aa2cef3a18eb
parentb120c819dbd15b23cf5392a5d5bdd8d8af18ead0

Revert "adding `static` and `dynamic` ZigEquivalent

enums so that we can branch to set `link_mode` properly when we iterate over the clang arguments. also replaced `dynamic` flag in clang_options_data.zig with proper definition similarly to `static`." This reverts commit 6af0eeb58d1d220d407ce4c463eaeb25b35f2761. This change needs more careful consideration. It regressed zig-bootstrap due to cmake passing `-static -lkernel32` and zig failing with error.UnableToStaticLink. See https://github.com/ziglang/zig-bootstrap/issues/134

3 files changed, 3 insertions(+), 22 deletions(-)

src/clang_options_data.zig+2-9
...@@ -2480,14 +2480,7 @@ flagpd1("dwarf-ext-refs"),...@@ -2480,14 +2480,7 @@ flagpd1("dwarf-ext-refs"),
2480},2480},
2481sepd1("dylib_file"),2481sepd1("dylib_file"),
2482flagpd1("dylinker"),2482flagpd1("dylinker"),
2483.{2483flagpd1("dynamic"),
2484 .name = "dynamic",
2485 .syntax = .flag,
2486 .zig_equivalent = .dynamic,
2487 .pd1 = true,
2488 .pd2 = false,
2489 .psl = false,
2490},
2491.{2484.{
2492 .name = "dynamiclib",2485 .name = "dynamiclib",
2493 .syntax = .flag,2486 .syntax = .flag,
...@@ -5041,7 +5034,7 @@ sepd1("stack-usage-file"),...@@ -5041,7 +5034,7 @@ sepd1("stack-usage-file"),
5041.{5034.{
5042 .name = "static",5035 .name = "static",
5043 .syntax = .flag,5036 .syntax = .flag,
5044 .zig_equivalent = .static,5037 .zig_equivalent = .other,
5045 .pd1 = true,5038 .pd1 = true,
5046 .pd2 = true,5039 .pd2 = true,
5047 .psl = false,5040 .psl = false,
src/main.zig-4
...@@ -1653,8 +1653,6 @@ fn buildOutputType(...@@ -1653,8 +1653,6 @@ fn buildOutputType(
1653 };1653 };
1654 }1654 }
1655 },1655 },
1656 .dynamic => link_mode = .Dynamic,
1657 .static => link_mode = .Static,
1658 }1656 }
1659 }1657 }
1660 // Parse linker args.1658 // Parse linker args.
...@@ -4687,8 +4685,6 @@ pub const ClangArgIterator = struct {...@@ -4687,8 +4685,6 @@ pub const ClangArgIterator = struct {
4687 weak_framework,4685 weak_framework,
4688 headerpad_max_install_names,4686 headerpad_max_install_names,
4689 compress_debug_sections,4687 compress_debug_sections,
4690 dynamic,
4691 static,
4692 };4688 };
46934689
4694 const Args = struct {4690 const Args = struct {
tools/update_clang_options.zig+1-9
...@@ -492,14 +492,6 @@ const known_options = [_]KnownOpt{...@@ -492,14 +492,6 @@ const known_options = [_]KnownOpt{
492 .name = "compress-debug-sections=",492 .name = "compress-debug-sections=",
493 .ident = "compress_debug_sections",493 .ident = "compress_debug_sections",
494 },494 },
495 .{
496 .name = "dynamic",
497 .ident = "dynamic",
498 },
499 .{
500 .name = "static",
501 .ident = "static",
502 },
503};495};
504496
505const blacklisted_options = [_][]const u8{};497const blacklisted_options = [_][]const u8{};
...@@ -806,7 +798,7 @@ fn objSyntax(obj: *json.ObjectMap) ?Syntax {...@@ -806,7 +798,7 @@ fn objSyntax(obj: *json.ObjectMap) ?Syntax {
806 } else if (std.mem.eql(u8, superclass, "CLRemainingArgsJoined")) {798 } else if (std.mem.eql(u8, superclass, "CLRemainingArgsJoined")) {
807 return .remaining_args_joined;799 return .remaining_args_joined;
808 } else if (std.mem.eql(u8, superclass, "MultiArg")) {800 } else if (std.mem.eql(u8, superclass, "MultiArg")) {
809 return Syntax{ .multi_arg = num_args };801 return .{ .multi_arg = num_args };
810 }802 }
811 }803 }
812 const name = obj.get("Name").?.String;804 const name = obj.get("Name").?.String;