| ... | @@ -1287,6 +1287,7 @@ fn buildOutputType( | ... | @@ -1287,6 +1287,7 @@ fn buildOutputType( |
| 1287 | var it = ClangArgIterator.init(arena, all_args); | 1287 | var it = ClangArgIterator.init(arena, all_args); |
| 1288 | var emit_llvm = false; | 1288 | var emit_llvm = false; |
| 1289 | var needed = false; | 1289 | var needed = false; |
| | 1290 | var must_link = false; |
| 1290 | var force_static_libs = false; | 1291 | var force_static_libs = false; |
| 1291 | while (it.has_next) { | 1292 | while (it.has_next) { |
| 1292 | it.next() catch |err| { | 1293 | it.next() catch |err| { |
| ... | @@ -1307,7 +1308,10 @@ fn buildOutputType( | ... | @@ -1307,7 +1308,10 @@ fn buildOutputType( |
| 1307 | switch (file_ext) { | 1308 | switch (file_ext) { |
| 1308 | .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }), | 1309 | .assembly, .c, .cpp, .ll, .bc, .h, .m, .mm => try c_source_files.append(.{ .src_path = it.only_arg }), |
| 1309 | .unknown, .shared_library, .object, .static_library => { | 1310 | .unknown, .shared_library, .object, .static_library => { |
| 1310 | try link_objects.append(.{ .path = it.only_arg }); | 1311 | try link_objects.append(.{ |
| | 1312 | .path = it.only_arg, |
| | 1313 | .must_link = must_link, |
| | 1314 | }); |
| 1311 | }, | 1315 | }, |
| 1312 | .zig => { | 1316 | .zig => { |
| 1313 | if (root_src_file) |other| { | 1317 | if (root_src_file) |other| { |
| ... | @@ -1372,6 +1376,14 @@ fn buildOutputType( | ... | @@ -1372,6 +1376,14 @@ fn buildOutputType( |
| 1372 | needed = false; | 1376 | needed = false; |
| 1373 | } else if (mem.eql(u8, linker_arg, "--no-as-needed")) { | 1377 | } else if (mem.eql(u8, linker_arg, "--no-as-needed")) { |
| 1374 | needed = true; | 1378 | needed = true; |
| | 1379 | } else if (mem.eql(u8, linker_arg, "--whole-archive") or |
| | 1380 | mem.eql(u8, linker_arg, "-whole-archive")) |
| | 1381 | { |
| | 1382 | must_link = true; |
| | 1383 | } else if (mem.eql(u8, linker_arg, "--no-whole-archive") or |
| | 1384 | mem.eql(u8, linker_arg, "-no-whole-archive")) |
| | 1385 | { |
| | 1386 | must_link = false; |
| 1375 | } else if (mem.eql(u8, linker_arg, "-Bdynamic") or | 1387 | } else if (mem.eql(u8, linker_arg, "-Bdynamic") or |
| 1376 | mem.eql(u8, linker_arg, "-dy") or | 1388 | mem.eql(u8, linker_arg, "-dy") or |
| 1377 | mem.eql(u8, linker_arg, "-call_shared")) | 1389 | mem.eql(u8, linker_arg, "-call_shared")) |
| ... | @@ -1663,6 +1675,12 @@ fn buildOutputType( | ... | @@ -1663,6 +1675,12 @@ fn buildOutputType( |
| 1663 | // This option does not do anything. | 1675 | // This option does not do anything. |
| 1664 | } else if (mem.eql(u8, arg, "--export-all-symbols")) { | 1676 | } else if (mem.eql(u8, arg, "--export-all-symbols")) { |
| 1665 | rdynamic = true; | 1677 | rdynamic = true; |
| | 1678 | } else if (mem.eql(u8, arg, "-s") or mem.eql(u8, arg, "--strip-all") or |
| | 1679 | mem.eql(u8, arg, "-S") or mem.eql(u8, arg, "--strip-debug")) |
| | 1680 | { |
| | 1681 | // -s, --strip-all Strip all symbols |
| | 1682 | // -S, --strip-debug Strip debugging symbols |
| | 1683 | strip = true; |
| 1666 | } else if (mem.eql(u8, arg, "--start-group") or | 1684 | } else if (mem.eql(u8, arg, "--start-group") or |
| 1667 | mem.eql(u8, arg, "--end-group")) | 1685 | mem.eql(u8, arg, "--end-group")) |
| 1668 | { | 1686 | { |