Skip to content

Commit e9e804e

Browse files
committed
Add missing clang opts: -install_name and -undefined
1 parent 11a81e1 commit e9e804e

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

src/clang_options_data.zig

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3932,7 +3932,14 @@ sepd1("include-pch"),
39323932
flagpd1("index-header-map"),
39333933
sepd1("init"),
39343934
flagpd1("init-only"),
3935-
sepd1("install_name"),
3935+
.{
3936+
.name = "install_name",
3937+
.syntax = .separate,
3938+
.zig_equivalent = .install_name,
3939+
.pd1 = true,
3940+
.pd2 = false,
3941+
.psl = false,
3942+
},
39363943
flagpd1("keep_private_externs"),
39373944
sepd1("lazy_framework"),
39383945
sepd1("lazy_library"),
@@ -6326,7 +6333,14 @@ joinpd1("ftabstop="),
63266333
jspd1("idirafter"),
63276334
joinpd1("mregparm="),
63286335
joinpd1("sycl-std="),
6329-
jspd1("undefined"),
6336+
.{
6337+
.name = "undefined",
6338+
.syntax = .joined_or_separate,
6339+
.zig_equivalent = .undefined,
6340+
.pd1 = true,
6341+
.pd2 = false,
6342+
.psl = false,
6343+
},
63306344
.{
63316345
.name = "extdirs=",
63326346
.syntax = .joined,

src/main.zig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,16 @@ fn buildOutputType(
16971697
};
16981698
}
16991699
},
1700+
.install_name => {
1701+
install_name = it.only_arg;
1702+
},
1703+
.undefined => {
1704+
if (mem.eql(u8, "dynamic_lookup", it.only_arg)) {
1705+
linker_allow_shlib_undefined = true;
1706+
} else {
1707+
fatal("unsupported -undefined option '{s}'", .{it.only_arg});
1708+
}
1709+
},
17001710
}
17011711
}
17021712
// Parse linker args.
@@ -4791,6 +4801,8 @@ pub const ClangArgIterator = struct {
47914801
weak_framework,
47924802
headerpad_max_install_names,
47934803
compress_debug_sections,
4804+
install_name,
4805+
undefined,
47944806
};
47954807

47964808
const Args = struct {

tools/update_clang_options.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ const known_options = [_]KnownOpt{
492492
.name = "compress-debug-sections=",
493493
.ident = "compress_debug_sections",
494494
},
495+
.{
496+
.name = "install_name",
497+
.ident = "install_name",
498+
},
499+
.{
500+
.name = "undefined",
501+
.ident = "undefined",
502+
},
495503
};
496504

497505
const blacklisted_options = [_][]const u8{};

0 commit comments

Comments
 (0)