| author | |
| committer | |
| log | 819625d2740838ad10440f4af04200a38b5c65e2 |
| tree | b2fbe9a4c38d7debe0af61d6c6709a8998b8eabe |
| parent | 6af2990549709ec5e2bc1efeb5090a944f1a8bdf |
When building object files or static libraries, link_mode can still be
static even if the OS needs libc for syscalls.2 files changed, 7 insertions(+), 6 deletions(-)
BRANCH_TODO+2-1| ... | ... | @@ -1,4 +1,6 @@ |
| 1 | 1 | * support -fno-emit-bin for godbolt |
| 2 | * restore the legacy -femit-h feature using the stage1 backend | |
| 3 | * figure out why test-translate-c is failing | |
| 2 | 4 | * tests passing with -Dskip-non-native |
| 3 | 5 | * `-ftime-report` |
| 4 | 6 | * -fstack-report print stack size diagnostics\n" |
| ... | ... | @@ -12,7 +14,6 @@ |
| 12 | 14 | * restore error messages for stage2_add_link_lib |
| 13 | 15 | * windows CUSTOMBUILD : error : unable to build compiler_rt: FileNotFound [D:\a\1\s\build\zig_install_lib_files.vcxproj] |
| 14 | 16 | * try building some software with zig cc to make sure it didn't regress |
| 15 | * restore the legacy -femit-h feature using the stage1 backend | |
| 16 | 17 | |
| 17 | 18 | * implement proper parsing of clang stderr/stdout and exposing compile errors with the Compilation API |
| 18 | 19 | * implement proper parsing of LLD stderr/stdout and exposing compile errors with the Compilation API |
src/Compilation.zig+5-5| ... | ... | @@ -454,16 +454,16 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 454 | 454 | break :blk false; |
| 455 | 455 | }; |
| 456 | 456 | |
| 457 | const link_libc = options.link_libc or | |
| 458 | (is_exe_or_dyn_lib and target_util.osRequiresLibC(options.target)); | |
| 457 | const link_libc = options.link_libc or target_util.osRequiresLibC(options.target); | |
| 459 | 458 | |
| 460 | 459 | const must_dynamic_link = dl: { |
| 461 | 460 | if (target_util.cannotDynamicLink(options.target)) |
| 462 | 461 | break :dl false; |
| 463 | if (target_util.osRequiresLibC(options.target)) | |
| 464 | break :dl true; | |
| 465 | if (is_exe_or_dyn_lib and link_libc and options.target.isGnuLibC()) | |
| 462 | if (is_exe_or_dyn_lib and link_libc and | |
| 463 | (options.target.isGnuLibC() or target_util.osRequiresLibC(options.target))) | |
| 464 | { | |
| 466 | 465 | break :dl true; |
| 466 | } | |
| 467 | 467 | if (options.system_libs.len != 0) |
| 468 | 468 | break :dl true; |
| 469 | 469 |