aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-04-01 11:51:05 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-04-01 14:22:44 +0200
commita88c0b4d089d286e36351cf476c8d982fb730541 (patch)
treea4d985e8a6bd7f7b36b66f24e21e1ff53ff5303a /tools
parent2dd178443abcbd91a923c64a4fd066caef974a82 (diff)
downloadzig-a88c0b4d089d286e36351cf476c8d982fb730541.tar.gz
zig-a88c0b4d089d286e36351cf476c8d982fb730541.zip
link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`. In MachO, ensure we add every symbol marked with `-u` as undefined before proceeding with symbol resolution. Additionally, ensure those symbols are never garbage collected. MachO entry_in_dylib test: pass `-u _my_main` when linking executable so that it is not incorrectly garbage collected by the linker.
Diffstat (limited to 'tools')
-rw-r--r--tools/update_clang_options.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig
index a1719c5ab6..fee877add0 100644
--- a/tools/update_clang_options.zig
+++ b/tools/update_clang_options.zig
@@ -469,6 +469,10 @@ const known_options = [_]KnownOpt{
.ident = "entry",
},
.{
+ .name = "u",
+ .ident = "force_undefined_symbol",
+ },
+ .{
.name = "weak-l",
.ident = "weak_library",
},