From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 83F0115800D for ; Sun, 9 Jul 2023 02:02:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C52BBE0938; Sun, 9 Jul 2023 02:02:47 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8B0CFE0938 for ; Sun, 9 Jul 2023 02:02:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C3A67340DF9 for ; Sun, 9 Jul 2023 02:02:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 62951AD0 for ; Sun, 9 Jul 2023 02:02:45 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688868148.4df05bbbdf80c84c3f373ad75789ec0a6d13cbb4.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig-bin/files/, dev-lang/zig-bin/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/zig-bin/files/zig-0.10.1-musl-1.2.4-lfs64.patch dev-lang/zig-bin/zig-bin-0.10.1-r2.ebuild dev-lang/zig-bin/zig-bin-0.10.1-r3.ebuild X-VCS-Directories: dev-lang/zig-bin/ dev-lang/zig-bin/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4df05bbbdf80c84c3f373ad75789ec0a6d13cbb4 X-VCS-Branch: master Date: Sun, 9 Jul 2023 02:02:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c787bc59-d7c4-4b2b-a93c-edba0955f590 X-Archives-Hash: b871b4b02cc498a5475e2056214ab782 commit: 4df05bbbdf80c84c3f373ad75789ec0a6d13cbb4 Author: Violet Purcell inventati org> AuthorDate: Sat Jul 8 18:23:12 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Jul 9 02:02:28 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4df05bbb dev-lang/zig-bin: Backport fix for musl 1.2.4 Signed-off-by: Violet Purcell inventati.org> Closes: https://github.com/gentoo/gentoo/pull/31791 Signed-off-by: Sam James gentoo.org> .../files/zig-0.10.1-musl-1.2.4-lfs64.patch | 220 +++++++++++++++++++++ ...n-0.10.1-r2.ebuild => zig-bin-0.10.1-r3.ebuild} | 4 +- 2 files changed, 223 insertions(+), 1 deletion(-) diff --git a/dev-lang/zig-bin/files/zig-0.10.1-musl-1.2.4-lfs64.patch b/dev-lang/zig-bin/files/zig-0.10.1-musl-1.2.4-lfs64.patch new file mode 100644 index 000000000000..05a550a7920e --- /dev/null +++ b/dev-lang/zig-bin/files/zig-0.10.1-musl-1.2.4-lfs64.patch @@ -0,0 +1,220 @@ +From https://github.com/ziglang/zig/commit/b20ccff515364cdb8f3e733cc950e53ab77656db Mon Sep 17 00:00:00 2001 +From: Andrew Kelley +Date: Mon, 19 Jun 2023 15:17:01 -0700 +Subject: [PATCH] std.os: update logic for 64-bit symbol choice + +musl v1.2.4 dropped the "64"-suffixed aliases for legacy "LFS64" ("large +file support") interfaces, so this commit changes the corresponding Zig +logic to call the correct names. +--- a/lib/std/os.zig ++++ b/lib/std/os.zig +@@ -890,10 +890,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize { + }; + const adjusted_len = @min(max_count, buf.len); + +- const pread_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.pread64 +- else +- system.pread; ++ const pread_sym = if (lfs64_abi) system.pread64 else system.pread; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + while (true) { +@@ -966,10 +963,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void { + } + + while (true) { +- const ftruncate_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.ftruncate64 +- else +- system.ftruncate; ++ const ftruncate_sym = if (lfs64_abi) system.ftruncate64 else system.ftruncate; + + const ilen = @bitCast(i64, length); // the OS treats this as unsigned + switch (errno(ftruncate_sym(fd, ilen))) { +@@ -1034,10 +1028,7 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { + + const iov_count = math.cast(u31, iov.len) orelse math.maxInt(u31); + +- const preadv_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.preadv64 +- else +- system.preadv; ++ const preadv_sym = if (lfs64_abi) system.preadv64 else system.preadv; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + while (true) { +@@ -1311,10 +1302,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize { + }; + const adjusted_len = @min(max_count, bytes.len); + +- const pwrite_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.pwrite64 +- else +- system.pwrite; ++ const pwrite_sym = if (lfs64_abi) system.pwrite64 else system.pwrite; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + while (true) { +@@ -1400,10 +1388,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz + } + } + +- const pwritev_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.pwritev64 +- else +- system.pwritev; ++ const pwritev_sym = if (lfs64_abi) system.pwritev64 else system.pwritev; + + const iov_count = if (iov.len > IOV_MAX) IOV_MAX else @intCast(u31, iov.len); + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned +@@ -1514,10 +1499,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: u32, perm: mode_t) OpenError!fd_t + return open(mem.sliceTo(file_path, 0), flags, perm); + } + +- const open_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.open64 +- else +- system.open; ++ const open_sym = if (lfs64_abi) system.open64 else system.open; + + while (true) { + const rc = open_sym(file_path, flags, perm); +@@ -1730,10 +1712,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: u32, mode: mode_t) + return openat(dir_fd, mem.sliceTo(file_path, 0), flags, mode); + } + +- const openat_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.openat64 +- else +- system.openat; ++ const openat_sym = if (lfs64_abi) system.openat64 else system.openat; + + while (true) { + const rc = openat_sym(dir_fd, file_path, flags, mode); +@@ -4117,10 +4096,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat { + @compileError("fstat is not yet implemented on Windows"); + } + +- const fstat_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.fstat64 +- else +- system.fstat; ++ const fstat_sym = if (lfs64_abi) system.fstat64 else system.fstat; + + var stat = mem.zeroes(Stat); + switch (errno(fstat_sym(fd, &stat))) { +@@ -4176,10 +4152,7 @@ pub fn fstatatZ(dirfd: fd_t, pathname: [*:0]const u8, flags: u32) FStatAtError!S + return fstatatWasi(dirfd, mem.sliceTo(pathname), flags); + } + +- const fstatat_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.fstatat64 +- else +- system.fstatat; ++ const fstatat_sym = if (lfs64_abi) system.fstatat64 else system.fstatat; + + var stat = mem.zeroes(Stat); + switch (errno(fstatat_sym(dirfd, pathname, &stat, flags))) { +@@ -4416,10 +4389,7 @@ pub fn mmap( + fd: fd_t, + offset: u64, + ) MMapError![]align(mem.page_size) u8 { +- const mmap_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.mmap64 +- else +- system.mmap; ++ const mmap_sym = if (lfs64_abi) system.mmap64 else system.mmap; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + const rc = mmap_sym(ptr, length, prot, flags, fd, ioffset); +@@ -4823,10 +4793,7 @@ pub fn lseek_SET(fd: fd_t, offset: u64) SeekError!void { + } + } + +- const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.lseek64 +- else +- system.lseek; ++ const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + switch (errno(lseek_sym(fd, ioffset, SEEK.SET))) { +@@ -4870,10 +4837,7 @@ pub fn lseek_CUR(fd: fd_t, offset: i64) SeekError!void { + else => |err| return unexpectedErrno(err), + } + } +- const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.lseek64 +- else +- system.lseek; ++ const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + switch (errno(lseek_sym(fd, ioffset, SEEK.CUR))) { +@@ -4917,10 +4881,7 @@ pub fn lseek_END(fd: fd_t, offset: i64) SeekError!void { + else => |err| return unexpectedErrno(err), + } + } +- const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.lseek64 +- else +- system.lseek; ++ const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; + + const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned + switch (errno(lseek_sym(fd, ioffset, SEEK.END))) { +@@ -4964,10 +4925,7 @@ pub fn lseek_CUR_get(fd: fd_t) SeekError!u64 { + else => |err| return unexpectedErrno(err), + } + } +- const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.lseek64 +- else +- system.lseek; ++ const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek; + + const rc = lseek_sym(fd, 0, SEEK.CUR); + switch (errno(rc)) { +@@ -6169,10 +6127,7 @@ pub fn sendfile( + // TODO we should not need this cast; improve return type of @min + const adjusted_count = @intCast(usize, adjusted_count_tmp); + +- const sendfile_sym = if (builtin.link_libc) +- system.sendfile64 +- else +- system.sendfile; ++ const sendfile_sym = if (lfs64_abi) system.sendfile64 else system.sendfile; + + while (true) { + var offset: off_t = @bitCast(off_t, in_offset); +@@ -7050,10 +7005,7 @@ pub fn prctl(option: PR, args: anytype) PrctlError!u31 { + pub const GetrlimitError = UnexpectedError; + + pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { +- const getrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.getrlimit64 +- else +- system.getrlimit; ++ const getrlimit_sym = if (lfs64_abi) system.getrlimit64 else system.getrlimit; + + var limits: rlimit = undefined; + switch (errno(getrlimit_sym(resource, &limits))) { +@@ -7067,10 +7019,7 @@ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit { + pub const SetrlimitError = error{ PermissionDenied, LimitTooBig } || UnexpectedError; + + pub fn setrlimit(resource: rlimit_resource, limits: rlimit) SetrlimitError!void { +- const setrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc) +- system.setrlimit64 +- else +- system.setrlimit; ++ const setrlimit_sym = if (lfs64_abi) system.setrlimit64 else system.setrlimit; + + switch (errno(setrlimit_sym(resource, &limits))) { + .SUCCESS => return, +@@ -7339,3 +7288,5 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, signal: usize) PtraceError! + }, + }; + } ++ ++const lfs64_abi = builtin.os.tag == .linux and builtin.link_libc and builtin.abi.isGnu(); diff --git a/dev-lang/zig-bin/zig-bin-0.10.1-r2.ebuild b/dev-lang/zig-bin/zig-bin-0.10.1-r3.ebuild similarity index 97% rename from dev-lang/zig-bin/zig-bin-0.10.1-r2.ebuild rename to dev-lang/zig-bin/zig-bin-0.10.1-r3.ebuild index 4674b943f38f..b5dcb9e26682 100644 --- a/dev-lang/zig-bin/zig-bin-0.10.1-r2.ebuild +++ b/dev-lang/zig-bin/zig-bin-0.10.1-r3.ebuild @@ -34,7 +34,9 @@ IDEPEND="app-eselect/eselect-zig" # because they can use compile-time mechanics (and it is easier for distributions to patch them) # Here we use this feature for fixing programs that use standard library # Note: Zig build system is also part of standard library, so we can fix it too -#PATCHES=( ) +PATCHES=( + "${FILESDIR}/zig-0.10.1-musl-1.2.4-lfs64.patch" +) QA_PREBUILT="opt/${P}/zig"