Commit 0420ad0292

Jakub Konka <kubkon@jakubkonka.com>
2022-12-18 00:33:00
Add missing clang opts: -install_name and -undefined
1 parent 23c0959
src/clang_options_data.zig
@@ -3932,7 +3932,14 @@ sepd1("include-pch"),
 flagpd1("index-header-map"),
 sepd1("init"),
 flagpd1("init-only"),
-sepd1("install_name"),
+.{
+    .name = "install_name",
+    .syntax = .separate,
+    .zig_equivalent = .install_name,
+    .pd1 = true,
+    .pd2 = false,
+    .psl = false,
+},
 flagpd1("keep_private_externs"),
 sepd1("lazy_framework"),
 sepd1("lazy_library"),
@@ -6326,7 +6333,14 @@ joinpd1("ftabstop="),
 jspd1("idirafter"),
 joinpd1("mregparm="),
 joinpd1("sycl-std="),
-jspd1("undefined"),
+.{
+    .name = "undefined",
+    .syntax = .joined_or_separate,
+    .zig_equivalent = .undefined,
+    .pd1 = true,
+    .pd2 = false,
+    .psl = false,
+},
 .{
     .name = "extdirs=",
     .syntax = .joined,
src/main.zig
@@ -1658,6 +1658,16 @@ fn buildOutputType(
                             };
                         }
                     },
+                    .install_name => {
+                        install_name = it.only_arg;
+                    },
+                    .undefined => {
+                        if (mem.eql(u8, "dynamic_lookup", it.only_arg)) {
+                            linker_allow_shlib_undefined = true;
+                        } else {
+                            fatal("unsupported -undefined option '{s}'", .{it.only_arg});
+                        }
+                    },
                 }
             }
             // Parse linker args.
@@ -4719,6 +4729,8 @@ pub const ClangArgIterator = struct {
         weak_framework,
         headerpad_max_install_names,
         compress_debug_sections,
+        install_name,
+        undefined,
     };
 
     const Args = struct {
tools/update_clang_options.zig
@@ -492,6 +492,14 @@ const known_options = [_]KnownOpt{
         .name = "compress-debug-sections=",
         .ident = "compress_debug_sections",
     },
+    .{
+        .name = "install_name",
+        .ident = "install_name",
+    },
+    .{
+        .name = "undefined",
+        .ident = "undefined",
+    },
 };
 
 const blacklisted_options = [_][]const u8{};