| ... | @@ -1295,6 +1295,7 @@ fn buildOutputType( | ... | @@ -1295,6 +1295,7 @@ fn buildOutputType( |
| 1295 | var it = ClangArgIterator.init(arena, all_args); | 1295 | var it = ClangArgIterator.init(arena, all_args); |
| 1296 | var emit_llvm = false; | 1296 | var emit_llvm = false; |
| 1297 | var needed = false; | 1297 | var needed = false; |
| | 1298 | var must_link = false; |
| 1298 | var force_static_libs = false; | 1299 | var force_static_libs = false; |
| 1299 | while (it.has_next) { | 1300 | while (it.has_next) { |
| 1300 | it.next() catch |err| { | 1301 | it.next() catch |err| { |
| ... | @@ -1315,7 +1316,10 @@ fn buildOutputType( | ... | @@ -1315,7 +1316,10 @@ fn buildOutputType( |
| 1315 | switch (file_ext) { | 1316 | switch (file_ext) { |
| 1316 | .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }), | 1317 | .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }), |
| 1317 | .unknown, .shared_library, .object, .static_library => { | 1318 | .unknown, .shared_library, .object, .static_library => { |
| 1318 | try link_objects.append(.{ .path = it.only_arg }); | 1319 | try link_objects.append(.{ |
| | 1320 | .path = it.only_arg, |
| | 1321 | .must_link = must_link, |
| | 1322 | }); |
| 1319 | }, | 1323 | }, |
| 1320 | .zig => { | 1324 | .zig => { |
| 1321 | if (root_src_file) |other| { | 1325 | if (root_src_file) |other| { |
| ... | @@ -1380,6 +1384,14 @@ fn buildOutputType( | ... | @@ -1380,6 +1384,14 @@ fn buildOutputType( |
| 1380 | needed = false; | 1384 | needed = false; |
| 1381 | } else if (mem.eql(u8, linker_arg, "--no-as-needed")) { | 1385 | } else if (mem.eql(u8, linker_arg, "--no-as-needed")) { |
| 1382 | needed = true; | 1386 | needed = true; |
| | 1387 | } else if (mem.eql(u8, linker_arg, "--whole-archive") or |
| | 1388 | mem.eql(u8, linker_arg, "-whole-archive")) |
| | 1389 | { |
| | 1390 | must_link = true; |
| | 1391 | } else if (mem.eql(u8, linker_arg, "--no-whole-archive") or |
| | 1392 | mem.eql(u8, linker_arg, "-no-whole-archive")) |
| | 1393 | { |
| | 1394 | must_link = false; |
| 1383 | } else if (mem.eql(u8, linker_arg, "-Bdynamic") or | 1395 | } else if (mem.eql(u8, linker_arg, "-Bdynamic") or |
| 1384 | mem.eql(u8, linker_arg, "-dy") or | 1396 | mem.eql(u8, linker_arg, "-dy") or |
| 1385 | mem.eql(u8, linker_arg, "-call_shared")) | 1397 | mem.eql(u8, linker_arg, "-call_shared")) |
| ... | @@ -1675,6 +1687,12 @@ fn buildOutputType( | ... | @@ -1675,6 +1687,12 @@ fn buildOutputType( |
| 1675 | // This option does not do anything. | 1687 | // This option does not do anything. |
| 1676 | } else if (mem.eql(u8, arg, "--export-all-symbols")) { | 1688 | } else if (mem.eql(u8, arg, "--export-all-symbols")) { |
| 1677 | rdynamic = true; | 1689 | rdynamic = true; |
| | 1690 | } else if (mem.eql(u8, arg, "-s") or mem.eql(u8, arg, "--strip-all") or |
| | 1691 | mem.eql(u8, arg, "-S") or mem.eql(u8, arg, "--strip-debug")) |
| | 1692 | { |
| | 1693 | // -s, --strip-all Strip all symbols |
| | 1694 | // -S, --strip-debug Strip debugging symbols |
| | 1695 | strip = true; |
| 1678 | } else if (mem.eql(u8, arg, "--start-group") or | 1696 | } else if (mem.eql(u8, arg, "--start-group") or |
| 1679 | mem.eql(u8, arg, "--end-group")) | 1697 | mem.eql(u8, arg, "--end-group")) |
| 1680 | { | 1698 | { |