compiler-rt: disable some exports for ofmt=c

This commit is contained in:
Veikka Tuominen 2022-11-30 17:20:34 +02:00
parent f8b779c114
commit 98037a0238
3 changed files with 10 additions and 4 deletions

View file

@ -453,7 +453,7 @@ fn __atomic_fetch_nand_8(ptr: *u64, val: u64, model: i32) callconv(.C) u64 {
}
comptime {
if (supports_atomic_ops) {
if (supports_atomic_ops and builtin.object_format != .c) {
@export(__atomic_load, .{ .name = "__atomic_load", .linkage = linkage });
@export(__atomic_store, .{ .name = "__atomic_store", .linkage = linkage });
@export(__atomic_exchange, .{ .name = "__atomic_exchange", .linkage = linkage });

View file

@ -1,8 +1,11 @@
const std = @import("std");
const common = @import("./common.zig");
const builtin = @import("builtin");
comptime {
@export(memcpy, .{ .name = "memcpy", .linkage = common.linkage });
if (builtin.object_format != .c) {
@export(memcpy, .{ .name = "memcpy", .linkage = common.linkage });
}
}
pub fn memcpy(noalias dest: ?[*]u8, noalias src: ?[*]const u8, len: usize) callconv(.C) ?[*]u8 {

View file

@ -1,9 +1,12 @@
const std = @import("std");
const common = @import("./common.zig");
const builtin = @import("builtin");
comptime {
@export(memset, .{ .name = "memset", .linkage = common.linkage });
@export(__memset, .{ .name = "__memset", .linkage = common.linkage });
if (builtin.object_format != .c) {
@export(memset, .{ .name = "memset", .linkage = common.linkage });
@export(__memset, .{ .name = "__memset", .linkage = common.linkage });
}
}
pub fn memset(dest: ?[*]u8, c: u8, len: usize) callconv(.C) ?[*]u8 {