authorgravatar for sertonix@posteo.netSertonix <sertonix@posteo.net> 2026-04-22 12:15:35+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-23 08:42:53+02:00
log084eab03d75187df41fbda5e4bd78e89d96297ff
treeb2576b40b3e75ba953a3b18d5173508c118b1ef7
parent99b90a431538de898ad2d49fb719f64572d849ab

compiler_rt: Fix extern mem{set,cpy,move} type on arm

Otherwise gcc will refuse to compile the bootstrap compiler_rt.c. Excerpt of the errors: /builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c:1459:21: error: conflicting types for 'memcpy'; have 'uint8_t *(uint8_t *, const uint8_t *, uintptr_t)' {aka 'unsigned char *(unsigned char *, const unsigned char *, unsigned int)'} 1459 | zig_extern uint8_t *memcpy(uint8_t *a0 zig_nonstring, uint8_t const *a1 zig_nonstring, uintptr_t a2); | ^~~~~~ /builds/sertonix/aports/community/zig/src/zig-0.16.0/stage1/zig.h:510:18: note: previous declaration of 'memcpy' with type 'void *(void *, const void *, unsigned int)' 510 | zig_extern void *memcpy (void *zig_restrict, void const *zig_restrict, size_t); | ^~~~~~ /builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c: In function 'zig_e___negxf2': /builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c:1758:9: error: passing argument 1 of 'memcpy' from incompatible pointer type [-Wincompatible-pointer-types] 1758 | memcpy(&t0, &a0, 16); | ^~~ | | | zig_u128 *

1 files changed, 3 insertions(+), 3 deletions(-)

lib/compiler_rt/arm.zig+3-3
......@@ -57,9 +57,9 @@ const __udivmodsi4 = @import("int.zig").__udivmodsi4;
5757const __divmoddi4 = @import("int.zig").__divmoddi4;
5858const __udivmoddi4 = @import("int.zig").__udivmoddi4;
5959
60extern fn memset(dest: ?[*]u8, c: i32, n: usize) ?[*]u8;
61extern fn memcpy(noalias dest: ?[*]u8, noalias src: ?[*]const u8, n: usize) ?[*]u8;
62extern fn memmove(dest: ?[*]u8, src: ?[*]const u8, n: usize) ?[*]u8;
60extern fn memset(dest: ?*anyopaque, c: i32, n: usize) ?*anyopaque;
61extern fn memcpy(noalias dest: ?*anyopaque, noalias src: ?*const anyopaque, n: usize) ?*anyopaque;
62extern fn memmove(dest: ?*anyopaque, src: ?*const anyopaque, n: usize) ?*anyopaque;
6363
6464pub fn __aeabi_memcpy(dest: [*]u8, src: [*]u8, n: usize) callconv(.{ .arm_aapcs = .{} }) void {
6565 @setRuntimeSafety(false);