| ... | @@ -1,8 +1,14 @@ | ... | @@ -1,8 +1,14 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | const native_endian = builtin.cpu.arch.endian(); | 3 | const native_endian = builtin.cpu.arch.endian(); |
| | 4 | const ofmt_c = builtin.object_format == .c; |
| 4 | | 5 | |
| 5 | pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .internal else .weak; | 6 | pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) |
| | 7 | .internal |
| | 8 | else if (ofmt_c) |
| | 9 | .strong |
| | 10 | else |
| | 11 | .weak; |
| 6 | /// Determines the symbol's visibility to other objects. | 12 | /// Determines the symbol's visibility to other objects. |
| 7 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not | 13 | /// For WebAssembly this allows the symbol to be resolved to other modules, but will not |
| 8 | /// export it to the host runtime. | 14 | /// export it to the host runtime. |
| ... | @@ -28,7 +34,7 @@ pub const want_float_exceptions = !builtin.cpu.arch.isWasm(); | ... | @@ -28,7 +34,7 @@ pub const want_float_exceptions = !builtin.cpu.arch.isWasm(); |
| 28 | | 34 | |
| 29 | // Libcalls that involve u128 on Windows x86-64 are expected by LLVM to use the | 35 | // Libcalls that involve u128 on Windows x86-64 are expected by LLVM to use the |
| 30 | // calling convention of @Vector(2, u64), rather than what's standard. | 36 | // calling convention of @Vector(2, u64), rather than what's standard. |
| 31 | pub const want_windows_v2u64_abi = builtin.os.tag == .windows and builtin.cpu.arch == .x86_64 and @import("builtin").object_format != .c; | 37 | pub const want_windows_v2u64_abi = builtin.os.tag == .windows and builtin.cpu.arch == .x86_64 and !ofmt_c; |
| 32 | | 38 | |
| 33 | /// This governs whether to use these symbol names for f16/f32 conversions | 39 | /// This governs whether to use these symbol names for f16/f32 conversions |
| 34 | /// rather than the standard names: | 40 | /// rather than the standard names: |