aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcod1r <jasonho353@gmail.com>2022-09-18 09:47:24 -0500
committerVeikka Tuominen <git@vexu.eu>2022-10-13 13:12:17 +0200
commit6af0eeb58d1d220d407ce4c463eaeb25b35f2761 (patch)
treeccf73504ea6c7aa29c89938df36742c279a00b9a /src
parentd987bf859e6d8511abb49b258c4d764bd32acc8e (diff)
downloadzig-6af0eeb58d1d220d407ce4c463eaeb25b35f2761.tar.gz
zig-6af0eeb58d1d220d407ce4c463eaeb25b35f2761.zip
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`.
Diffstat (limited to 'src')
-rw-r--r--src/clang_options_data.zig23
-rw-r--r--src/main.zig4
2 files changed, 19 insertions, 8 deletions
diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig
index edabac2da6..469b8fbded 100644
--- a/src/clang_options_data.zig
+++ b/src/clang_options_data.zig
@@ -2480,7 +2480,14 @@ flagpd1("dwarf-ext-refs"),
},
sepd1("dylib_file"),
flagpd1("dylinker"),
-flagpd1("dynamic"),
+.{
+ .name = "dynamic",
+ .syntax = .flag,
+ .zig_equivalent = .dynamic,
+ .pd1 = true,
+ .pd2 = false,
+ .psl = false,
+},
.{
.name = "dynamiclib",
.syntax = .flag,
@@ -4028,7 +4035,7 @@ flagpd1("menable-unsafe-fp-math"),
m("menqcmd"),
m("mexception-handling"),
m("mexecute-only"),
-flagpd1("mextended-const"),
+m("mextended-const"),
flagpd1("mextern-sdata"),
m("mf16c"),
flagpd1("mfancy-math-387"),
@@ -4037,7 +4044,7 @@ flagpd1("mfix4300"),
flagpd1("mfix-and-continue"),
m("mfix-cmse-cve-2021-35465"),
m("mfix-cortex-a53-835769"),
-flagpd1("mfix-cortex-a57-aes-1742098"),
+m("mfix-cortex-a57-aes-1742098"),
flagpd1("mfix-cortex-a72-aes-1655431"),
m("mfloat128"),
sepd1("mfloat-abi"),
@@ -4188,12 +4195,12 @@ m("mno-enqcmd"),
m("mno-exception-handling"),
flagpd1("mnoexecstack"),
m("mno-execute-only"),
-flagpd1("mno-extended-const"),
+m("mno-extended-const"),
flagpd1("mno-extern-sdata"),
m("mno-f16c"),
m("mno-fix-cmse-cve-2021-35465"),
m("mno-fix-cortex-a53-835769"),
-flagpd1("mno-fix-cortex-a57-aes-1742098"),
+m("mno-fix-cortex-a57-aes-1742098"),
flagpd1("mno-fix-cortex-a72-aes-1655431"),
m("mno-float128"),
m("mno-fma"),
@@ -4272,7 +4279,7 @@ m("mno-prfchw"),
m("mno-ptwrite"),
flagpd1("mno-pure-code"),
m("mno-rdpid"),
-flagpd1("mno-rdpru"),
+m("mno-rdpru"),
m("mno-rdrnd"),
m("mno-rdseed"),
.{
@@ -4382,7 +4389,7 @@ m("mptwrite"),
flagpd1("mpure-code"),
flagpd1("mqdsp6-compat"),
m("mrdpid"),
-flagpd1("mrdpru"),
+m("mrdpru"),
m("mrdrnd"),
m("mrdseed"),
flagpd1("mreassociate"),
@@ -5034,7 +5041,7 @@ sepd1("stack-usage-file"),
.{
.name = "static",
.syntax = .flag,
- .zig_equivalent = .other,
+ .zig_equivalent = .static,
.pd1 = true,
.pd2 = true,
.psl = false,
diff --git a/src/main.zig b/src/main.zig
index 00fe9a3df6..056b5826e3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1649,6 +1649,8 @@ fn buildOutputType(
};
}
},
+ .dynamic => link_mode = .Dynamic,
+ .static => link_mode = .Static,
}
}
// Parse linker args.
@@ -4678,6 +4680,8 @@ pub const ClangArgIterator = struct {
weak_framework,
headerpad_max_install_names,
compress_debug_sections,
+ dynamic,
+ static,
};
const Args = struct {