| 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,4 +1,6 @@ |
| 1 | * support -fno-emit-bin for godbolt | 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 | * tests passing with -Dskip-non-native | 4 | * tests passing with -Dskip-non-native |
| 3 | * `-ftime-report` | 5 | * `-ftime-report` |
| 4 | * -fstack-report print stack size diagnostics\n" | 6 | * -fstack-report print stack size diagnostics\n" |
| ... | @@ -12,7 +14,6 @@ | ... | @@ -12,7 +14,6 @@ |
| 12 | * restore error messages for stage2_add_link_lib | 14 | * restore error messages for stage2_add_link_lib |
| 13 | * windows CUSTOMBUILD : error : unable to build compiler_rt: FileNotFound [D:\a\1\s\build\zig_install_lib_files.vcxproj] | 15 | * windows CUSTOMBUILD : error : unable to build compiler_rt: FileNotFound [D:\a\1\s\build\zig_install_lib_files.vcxproj] |
| 14 | * try building some software with zig cc to make sure it didn't regress | 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 | * implement proper parsing of clang stderr/stdout and exposing compile errors with the Compilation API | 18 | * implement proper parsing of clang stderr/stdout and exposing compile errors with the Compilation API |
| 18 | * implement proper parsing of LLD stderr/stdout and exposing compile errors with the Compilation API | 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,16 +454,16 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 454 | break :blk false; | 454 | break :blk false; |
| 455 | }; | 455 | }; |
| 456 | 456 | ||
| 457 | const link_libc = options.link_libc or | 457 | const link_libc = options.link_libc or target_util.osRequiresLibC(options.target); |
| 458 | (is_exe_or_dyn_lib and target_util.osRequiresLibC(options.target)); | ||
| 459 | 458 | ||
| 460 | const must_dynamic_link = dl: { | 459 | const must_dynamic_link = dl: { |
| 461 | if (target_util.cannotDynamicLink(options.target)) | 460 | if (target_util.cannotDynamicLink(options.target)) |
| 462 | break :dl false; | 461 | break :dl false; |
| 463 | if (target_util.osRequiresLibC(options.target)) | 462 | if (is_exe_or_dyn_lib and link_libc and |
| 464 | break :dl true; | 463 | (options.target.isGnuLibC() or target_util.osRequiresLibC(options.target))) |
| 465 | if (is_exe_or_dyn_lib and link_libc and options.target.isGnuLibC()) | 464 | { |
| 466 | break :dl true; | 465 | break :dl true; |
| 466 | } | ||
| 467 | if (options.system_libs.len != 0) | 467 | if (options.system_libs.len != 0) |
| 468 | break :dl true; | 468 | break :dl true; |
| 469 | 469 |