| ... | @@ -958,7 +958,6 @@ pub const InitOptions = struct { | ... | @@ -958,7 +958,6 @@ pub const InitOptions = struct { |
| 958 | /// building such dependencies themselves, this flag must be set to avoid | 958 | /// building such dependencies themselves, this flag must be set to avoid |
| 959 | /// infinite recursion. | 959 | /// infinite recursion. |
| 960 | skip_linker_dependencies: bool = false, | 960 | skip_linker_dependencies: bool = false, |
| 961 | parent_compilation_link_libc: bool = false, | | |
| 962 | hash_style: link.HashStyle = .both, | 961 | hash_style: link.HashStyle = .both, |
| 963 | entry: ?[]const u8 = null, | 962 | entry: ?[]const u8 = null, |
| 964 | force_undefined_symbols: std.StringArrayHashMapUnmanaged(void) = .{}, | 963 | force_undefined_symbols: std.StringArrayHashMapUnmanaged(void) = .{}, |
| ... | @@ -1547,7 +1546,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1547,7 +1546,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1547 | hash.addOptionalBytes(options.test_filter); | 1546 | hash.addOptionalBytes(options.test_filter); |
| 1548 | hash.addOptionalBytes(options.test_name_prefix); | 1547 | hash.addOptionalBytes(options.test_name_prefix); |
| 1549 | hash.add(options.skip_linker_dependencies); | 1548 | hash.add(options.skip_linker_dependencies); |
| 1550 | hash.add(options.parent_compilation_link_libc); | | |
| 1551 | hash.add(formatted_panics); | 1549 | hash.add(formatted_panics); |
| 1552 | hash.add(options.emit_h != null); | 1550 | hash.add(options.emit_h != null); |
| 1553 | hash.add(error_limit); | 1551 | hash.add(error_limit); |
| ... | @@ -1945,7 +1943,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1945,7 +1943,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1945 | .error_return_tracing = error_return_tracing, | 1943 | .error_return_tracing = error_return_tracing, |
| 1946 | .llvm_cpu_features = llvm_cpu_features, | 1944 | .llvm_cpu_features = llvm_cpu_features, |
| 1947 | .skip_linker_dependencies = options.skip_linker_dependencies, | 1945 | .skip_linker_dependencies = options.skip_linker_dependencies, |
| 1948 | .parent_compilation_link_libc = options.parent_compilation_link_libc, | | |
| 1949 | .each_lib_rpath = options.each_lib_rpath orelse options.is_native_os, | 1946 | .each_lib_rpath = options.each_lib_rpath orelse options.is_native_os, |
| 1950 | .build_id = build_id, | 1947 | .build_id = build_id, |
| 1951 | .cache_mode = cache_mode, | 1948 | .cache_mode = cache_mode, |
| ... | @@ -2747,7 +2744,6 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes | ... | @@ -2747,7 +2744,6 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes |
| 2747 | man.hash.addOptionalBytes(comp.test_filter); | 2744 | man.hash.addOptionalBytes(comp.test_filter); |
| 2748 | man.hash.addOptionalBytes(comp.test_name_prefix); | 2745 | man.hash.addOptionalBytes(comp.test_name_prefix); |
| 2749 | man.hash.add(comp.bin_file.options.skip_linker_dependencies); | 2746 | man.hash.add(comp.bin_file.options.skip_linker_dependencies); |
| 2750 | man.hash.add(comp.bin_file.options.parent_compilation_link_libc); | | |
| 2751 | man.hash.add(comp.formatted_panics); | 2747 | man.hash.add(comp.formatted_panics); |
| 2752 | man.hash.add(mod.emit_h != null); | 2748 | man.hash.add(mod.emit_h != null); |
| 2753 | man.hash.add(mod.error_limit); | 2749 | man.hash.add(mod.error_limit); |
| ... | @@ -6654,14 +6650,6 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca | ... | @@ -6654,14 +6650,6 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca |
| 6654 | } | 6650 | } |
| 6655 | try buffer.appendSlice("};\n"); | 6651 | try buffer.appendSlice("};\n"); |
| 6656 | | 6652 | |
| 6657 | // This is so that compiler_rt and libc.zig libraries know whether they | | |
| 6658 | // will eventually be linked with libc. They make different decisions | | |
| 6659 | // about what to export depending on whether another libc will be linked | | |
| 6660 | // in. For example, compiler_rt will not export the __chkstk symbol if it | | |
| 6661 | // knows libc will provide it, and likewise c.zig will not export memcpy. | | |
| 6662 | const link_libc = comp.bin_file.options.link_libc or | | |
| 6663 | (comp.bin_file.options.skip_linker_dependencies and comp.bin_file.options.parent_compilation_link_libc); | | |
| 6664 | | | |
| 6665 | try buffer.writer().print( | 6653 | try buffer.writer().print( |
| 6666 | \\pub const target = std.Target{{ | 6654 | \\pub const target = std.Target{{ |
| 6667 | \\ .cpu = cpu, | 6655 | \\ .cpu = cpu, |
| ... | @@ -6685,7 +6673,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca | ... | @@ -6685,7 +6673,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca |
| 6685 | , .{ | 6673 | , .{ |
| 6686 | std.zig.fmtId(@tagName(target.ofmt)), | 6674 | std.zig.fmtId(@tagName(target.ofmt)), |
| 6687 | std.zig.fmtId(@tagName(comp.bin_file.options.optimize_mode)), | 6675 | std.zig.fmtId(@tagName(comp.bin_file.options.optimize_mode)), |
| 6688 | link_libc, | 6676 | comp.bin_file.options.link_libc, |
| 6689 | comp.bin_file.options.link_libcpp, | 6677 | comp.bin_file.options.link_libcpp, |
| 6690 | comp.bin_file.options.error_return_tracing, | 6678 | comp.bin_file.options.error_return_tracing, |
| 6691 | comp.bin_file.options.valgrind, | 6679 | comp.bin_file.options.valgrind, |
| ... | @@ -6833,7 +6821,7 @@ fn buildOutputFromZig( | ... | @@ -6833,7 +6821,7 @@ fn buildOutputFromZig( |
| 6833 | .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features, | 6821 | .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features, |
| 6834 | .clang_passthrough_mode = comp.clang_passthrough_mode, | 6822 | .clang_passthrough_mode = comp.clang_passthrough_mode, |
| 6835 | .skip_linker_dependencies = true, | 6823 | .skip_linker_dependencies = true, |
| 6836 | .parent_compilation_link_libc = comp.bin_file.options.link_libc, | 6824 | .link_libc = comp.bin_file.options.link_libc, |
| 6837 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, | 6825 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, |
| 6838 | }); | 6826 | }); |
| 6839 | defer sub_compilation.destroy(); | 6827 | defer sub_compilation.destroy(); |
| ... | @@ -6914,7 +6902,7 @@ pub fn build_crt_file( | ... | @@ -6914,7 +6902,7 @@ pub fn build_crt_file( |
| 6914 | .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features, | 6902 | .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features, |
| 6915 | .clang_passthrough_mode = comp.clang_passthrough_mode, | 6903 | .clang_passthrough_mode = comp.clang_passthrough_mode, |
| 6916 | .skip_linker_dependencies = true, | 6904 | .skip_linker_dependencies = true, |
| 6917 | .parent_compilation_link_libc = comp.bin_file.options.link_libc, | 6905 | .link_libc = comp.bin_file.options.link_libc, |
| 6918 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, | 6906 | .want_structured_cfg = comp.bin_file.options.want_structured_cfg, |
| 6919 | }); | 6907 | }); |
| 6920 | defer sub_compilation.destroy(); | 6908 | defer sub_compilation.destroy(); |