| ... | ... | @@ -417,12 +417,14 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 417 | 417 | return error.MachineCodeModelNotSupported; |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | const link_libc = options.link_libc or target_util.osRequiresLibC(options.target); |
| 421 | |
| 420 | 422 | const must_dynamic_link = dl: { |
| 421 | 423 | if (target_util.cannotDynamicLink(options.target)) |
| 422 | 424 | break :dl false; |
| 423 | 425 | if (target_util.osRequiresLibC(options.target)) |
| 424 | 426 | break :dl true; |
| 425 | | if (is_exe_or_dyn_lib and options.link_libc and options.target.isGnuLibC()) |
| 427 | if (is_exe_or_dyn_lib and link_libc and options.target.isGnuLibC()) |
| 426 | 428 | break :dl true; |
| 427 | 429 | if (options.system_libs.len != 0) |
| 428 | 430 | break :dl true; |
| ... | ... | @@ -444,12 +446,12 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 444 | 446 | options.zig_lib_directory.path.?, |
| 445 | 447 | options.target, |
| 446 | 448 | options.is_native_os, |
| 447 | | options.link_libc, |
| 449 | link_libc, |
| 448 | 450 | options.libc_installation, |
| 449 | 451 | ); |
| 450 | 452 | |
| 451 | 453 | const must_pic: bool = b: { |
| 452 | | if (target_util.requiresPIC(options.target, options.link_libc)) |
| 454 | if (target_util.requiresPIC(options.target, link_libc)) |
| 453 | 455 | break :b true; |
| 454 | 456 | break :b link_mode == .Dynamic; |
| 455 | 457 | }; |
| ... | ... | @@ -545,7 +547,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 545 | 547 | cache.hash.add(link_mode); |
| 546 | 548 | cache.hash.add(function_sections); |
| 547 | 549 | cache.hash.add(options.strip); |
| 548 | | cache.hash.add(options.link_libc); |
| 550 | cache.hash.add(link_libc); |
| 549 | 551 | cache.hash.add(options.link_libcpp); |
| 550 | 552 | cache.hash.add(options.output_mode); |
| 551 | 553 | cache.hash.add(options.machine_code_model); |
| ... | ... | @@ -676,7 +678,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 676 | 678 | .optimize_mode = options.optimize_mode, |
| 677 | 679 | .use_lld = use_lld, |
| 678 | 680 | .use_llvm = use_llvm, |
| 679 | | .link_libc = options.link_libc, |
| 681 | .link_libc = link_libc, |
| 680 | 682 | .link_libcpp = options.link_libcpp, |
| 681 | 683 | .objects = options.link_objects, |
| 682 | 684 | .frameworks = options.frameworks, |