public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig-bin/files/, dev-lang/zig-bin/
@ 2022-08-22  8:18 Jakov Smolić
  0 siblings, 0 replies; 3+ messages in thread
From: Jakov Smolić @ 2022-08-22  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     1f53d35103da2331afeaad49718cb0703dd5f88d
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Tue Jul 26 21:19:14 2022 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Mon Aug 22 08:16:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f53d351

dev-lang/zig-bin: new package, add 0.9.1

Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-lang/zig-bin/Manifest                          |  4 +++
 .../files/zig-bin-0.9.1-fix-detecting-abi.patch    | 19 +++++++++++
 dev-lang/zig-bin/metadata.xml                      | 16 ++++++++++
 dev-lang/zig-bin/zig-bin-0.9.1.ebuild              | 37 ++++++++++++++++++++++
 4 files changed, 76 insertions(+)

diff --git a/dev-lang/zig-bin/Manifest b/dev-lang/zig-bin/Manifest
new file mode 100644
index 000000000000..65078bba09fa
--- /dev/null
+++ b/dev-lang/zig-bin/Manifest
@@ -0,0 +1,4 @@
+DIST zig-linux-aarch64-0.9.1.tar.xz 37034860 BLAKE2B 3b984198d74ee01570e4e10175dc4471268970cc5bd66d732042f17f1cf31301cec9237df756b7fa589915ed4c4f29dcd9ba61fb8e65ce7e9b579762773fe26d SHA512 ca647f04a67a45ad9e869e335266fad9a4a0f3f377da31d54a6f022727404db6cf2386d33315df20d5da0b6883f59e27bb0d73e18856e571cf4bc8f890565639
+DIST zig-linux-armv7a-0.9.1.tar.xz 37974652 BLAKE2B 5d51260d8322d1400719d97c7cac2d12555622272900533128e20d45ea7a1c321b8a3eb9c7c406bbfd459da24d19451c65011bc2cac0b0c29a0372c56ea73a2b SHA512 239c5f02aeb1c85bc2c43374d610e27722c434d23cf3adf43b3923772dfe5800e340d6a6b3672bd307c159c2cccce5137aabb5b6648148c351e29c171de9e333
+DIST zig-linux-i386-0.9.1.tar.xz 44969172 BLAKE2B 7051242284f1ceca662a64257adf64b7383b71b475f27abd3377bdaf8335d56d8cbb9a961ebceb6ae26058258216848dcbde2f50f95a74e0b64578a9522f33d5 SHA512 5bdf0ebffe45023b5a28331137458d258048c7974311c8e8090bc610f0ec262dc0004f0a939cff443b1d94a9cca4035de8e6e98dad9d668413888da02b325b6d
+DIST zig-linux-x86_64-0.9.1.tar.xz 41011464 BLAKE2B 053fc1c3d30e5798b7d30c9a4f9b5609b9b080e9f237dab52ae661b183663fca6582dcc37458e8a51dd7eb4fbd1d3a9946f7c67cb756b69460f0e23b03cc96eb SHA512 0e5f5971dc9e586911f98122a410c98d8aaef2795d2d68488a1e9468ea45135479dac7f92708c973db4f8efce78cb0c6b3759cf239fba6237052434a2120d4d3

diff --git a/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-detecting-abi.patch b/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-detecting-abi.patch
new file mode 100644
index 000000000000..6aa2f49b379a
--- /dev/null
+++ b/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-detecting-abi.patch
@@ -0,0 +1,19 @@
+From: Eric Joldasov <bratishkaerik@getgoogleoff.me>
+
+Upstream parses /usr/bin/env ELF file for detecting C ABI and the dynamic linker.
+However, if sys-apps/coreutils was merged with "multicall" USE flag, it would be a script and not a ELF file.
+This will raise error.UnexpectedEndOfFile, and Zig will fallback to default dynamic linker (i.e. musl),
+which breaks building programs with Zig on glibc systems. This patch changes file from
+/usr/bin/env to /bin/bash, because it is more reliable on Gentoo systems.
+
+--- a/lib/std/zig/system/NativeTargetInfo.zig
++++ b/lib/std/zig/system/NativeTargetInfo.zig
+@@ -355,7 +355,7 @@ fn detectAbiAndDynamicLinker(
+         return result;
+     }
+ 
+-    const env_file = std.fs.openFileAbsoluteZ("/usr/bin/env", .{}) catch |err| switch (err) {
++    const env_file = std.fs.openFileAbsoluteZ("/bin/bash", .{}) catch |err| switch (err) {
+         error.NoSpaceLeft => unreachable,
+         error.NameTooLong => unreachable,
+         error.PathAlreadyExists => unreachable,

diff --git a/dev-lang/zig-bin/metadata.xml b/dev-lang/zig-bin/metadata.xml
new file mode 100644
index 000000000000..a5a5818faae7
--- /dev/null
+++ b/dev-lang/zig-bin/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>bratishkaerik@getgoogleoff.me</email>
+		<name>Eric Joldasov</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">ziglang/zig</remote-id>
+		<bugs-to>https://github.com/ziglang/zig/issues</bugs-to>
+	</upstream>
+</pkgmetadata>

diff --git a/dev-lang/zig-bin/zig-bin-0.9.1.ebuild b/dev-lang/zig-bin/zig-bin-0.9.1.ebuild
new file mode 100644
index 000000000000..7aa14d86a3ea
--- /dev/null
+++ b/dev-lang/zig-bin/zig-bin-0.9.1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="A robust, optimal, and maintainable programming language"
+HOMEPAGE="https://ziglang.org/"
+SRC_URI="
+	amd64? ( https://ziglang.org/download/${PV}/zig-linux-x86_64-${PV}.tar.xz )
+	arm? ( https://ziglang.org/download/${PV}/zig-linux-armv7a-${PV}.tar.xz )
+	arm64? ( https://ziglang.org/download/${PV}/zig-linux-aarch64-${PV}.tar.xz )
+	x86? ( https://ziglang.org/download/${PV}/zig-linux-i386-${PV}.tar.xz )"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~arm ~arm64 ~x86"
+
+RDEPEND="!dev-lang/zig"
+
+PATCHES=( "${FILESDIR}/${P}-fix-detecting-abi.patch" )
+
+QA_PREBUILT="opt/${P}/zig"
+
+src_unpack() {
+	unpack ${A}
+
+	mv "${WORKDIR}/"* "${S}"
+}
+
+src_install() {
+	insinto /opt/
+	doins -r "${S}"
+
+	dosym -r /opt/${P}/doc/ /usr/share/doc/${PF}
+	dosym -r /opt/${P}/zig /usr/bin/zig
+	fperms 0755 /usr/bin/zig
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig-bin/files/, dev-lang/zig-bin/
@ 2022-12-01 13:57 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2022-12-01 13:57 UTC (permalink / raw
  To: gentoo-commits

commit:     ff3fac4781eca7b1250547c9627f021cebbdf2a7
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Thu Dec  1 12:43:10 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  1 13:57:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff3fac47

dev-lang/zig-bin: drop 0.9.1-r1

Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/zig-bin/Manifest                          |  5 ---
 .../zig-bin-0.9.1-fix-bad-hostname-segfault.patch  | 26 ------------
 dev-lang/zig-bin/zig-bin-0.9.1-r1.ebuild           | 47 ----------------------
 3 files changed, 78 deletions(-)

diff --git a/dev-lang/zig-bin/Manifest b/dev-lang/zig-bin/Manifest
index f3a4958e521b..66658fc5412e 100644
--- a/dev-lang/zig-bin/Manifest
+++ b/dev-lang/zig-bin/Manifest
@@ -1,10 +1,5 @@
-DIST zig-0.9.1-fix-detecting-abi.patch 22233 BLAKE2B fa523c4c4c23a74c0b4f85c6d2d91ef98b31d25694bb9dbc7988b82db972a16ab273aa9f1883cfa8ca79ef7fc56fca67d0a8656ba248b6db47bc902b7ac64a93 SHA512 259967f88f54c20f556bd9d67189ce3a2cfeb0250f0cee4dffb29020d976d61265a5dd9ae9cfcadfb7b1e152b47ee17f4184eafac2b80495f4ee8f98733cd692
 DIST zig-linux-aarch64-0.10.0.tar.xz 40387688 BLAKE2B 47d0cb61f054b79dcd9e5f87f3f910c9440079dca7648a3017c871fb20bc76e07de5b76a438a9d8eda147e77061bebf43b1486160899eeca0972b547b269c607 SHA512 5db0df7fce49dd3ca7002c3d9782a8d16c8b92721cf5f8983978dddcfb42dd31c4e3edad5a321bceda627730320c95dc552226b9e5e06ba84315804153991de1
-DIST zig-linux-aarch64-0.9.1.tar.xz 37034860 BLAKE2B 3b984198d74ee01570e4e10175dc4471268970cc5bd66d732042f17f1cf31301cec9237df756b7fa589915ed4c4f29dcd9ba61fb8e65ce7e9b579762773fe26d SHA512 ca647f04a67a45ad9e869e335266fad9a4a0f3f377da31d54a6f022727404db6cf2386d33315df20d5da0b6883f59e27bb0d73e18856e571cf4bc8f890565639
 DIST zig-linux-armv7a-0.10.0.tar.xz 50805936 BLAKE2B 57a2c8bf10d80a5b06570ebea786be725e6020a7184835a966ddae32a2126910915e2d2bae0932226edb644692ff39e7ab201a8d040c62106ac40539cd3e8096 SHA512 31d16e477a52e10d6ce4e646c7b97d6162c68d5938890b815fb9d5da527248ab46926649d68d5623953b9fbac707131c89d5c8388e9ae5128cf2182d0ab58278
-DIST zig-linux-armv7a-0.9.1.tar.xz 37974652 BLAKE2B 5d51260d8322d1400719d97c7cac2d12555622272900533128e20d45ea7a1c321b8a3eb9c7c406bbfd459da24d19451c65011bc2cac0b0c29a0372c56ea73a2b SHA512 239c5f02aeb1c85bc2c43374d610e27722c434d23cf3adf43b3923772dfe5800e340d6a6b3672bd307c159c2cccce5137aabb5b6648148c351e29c171de9e333
 DIST zig-linux-i386-0.10.0.tar.xz 48451732 BLAKE2B e1ae0d48723e1439b612f56dee05776d83a9cabe4bd4ddc6198d777a51a5b2b8c696cf7ce7817641ab46edb91eff992abc4d12de7620d21b1bb63fc482d610da SHA512 6c4152137047efbf2cf3a65583697325baf29c5847734d38622207d15de04aa5bbcd15e37c3c07c51536a2f34ab16ceaf7776c009b0862cb510ed2a0494bdeef
-DIST zig-linux-i386-0.9.1.tar.xz 44969172 BLAKE2B 7051242284f1ceca662a64257adf64b7383b71b475f27abd3377bdaf8335d56d8cbb9a961ebceb6ae26058258216848dcbde2f50f95a74e0b64578a9522f33d5 SHA512 5bdf0ebffe45023b5a28331137458d258048c7974311c8e8090bc610f0ec262dc0004f0a939cff443b1d94a9cca4035de8e6e98dad9d668413888da02b325b6d
 DIST zig-linux-riscv64-0.10.0.tar.xz 42272968 BLAKE2B 95fe8589b9be99625acb5c9a97fafd3126b838c7e0722529d34cfe87043cb0e8d6957e6f2bb3ac3ae1fc2f51cf6a062b98abe224c221ba659de1e16703b53255 SHA512 ae00cf4eb5e499bd44e94d6cd77464d85878881034ce088ef69aa1f3fdf58420768112b36007829ecaba74e77e96c0706222a2fc1397b773e3bb5f726a710549
 DIST zig-linux-x86_64-0.10.0.tar.xz 44142400 BLAKE2B 7ba72ce57e616c5ead2fb84dc7e1b0ff08e8dffab56ca30cd00bff1d9b80fd62034f3d78b903f37f911665239a4717a6e93230faa77b3f387b0dada835672fb7 SHA512 87037766e58a736d7e4f9fca1c21dce070f2de8cd08dae7951e67252327b72dd69f79831f5c8e406be7ecc6522184400eba3bd265d3c7020c8fa4d2efc9f8766
-DIST zig-linux-x86_64-0.9.1.tar.xz 41011464 BLAKE2B 053fc1c3d30e5798b7d30c9a4f9b5609b9b080e9f237dab52ae661b183663fca6582dcc37458e8a51dd7eb4fbd1d3a9946f7c67cb756b69460f0e23b03cc96eb SHA512 0e5f5971dc9e586911f98122a410c98d8aaef2795d2d68488a1e9468ea45135479dac7f92708c973db4f8efce78cb0c6b3759cf239fba6237052434a2120d4d3

diff --git a/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-bad-hostname-segfault.patch b/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-bad-hostname-segfault.patch
deleted file mode 100644
index 2e87ecc6d6ee..000000000000
--- a/dev-lang/zig-bin/files/zig-bin-0.9.1-fix-bad-hostname-segfault.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://github.com/ziglang/zig/commit/601d8f721d6dc90ac390bf5ecc7d8bafdd6a30d8
-Bug https://bugs.gentoo.org/829959
-
-From 601d8f721d6dc90ac390bf5ecc7d8bafdd6a30d8 Mon Sep 17 00:00:00 2001
-From: Veikka Touminen <git@vexu.eu>
-Date: Sun, 10 Jul 2022 04:27:23 -0600
-Subject: [PATCH] std.net.getAddressList: fix segfault on bad hostname
-
-Fixes #12065
----
- lib/std/net.zig | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/std/net.zig b/lib/std/net.zig
-index 235ad8496a1..c381df9bce7 100644
---- a/lib/std/net.zig
-+++ b/lib/std/net.zig
-@@ -731,7 +731,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A
-         break :blk result;
-     };
-     const arena = result.arena.allocator();
--    errdefer result.arena.deinit();
-+    errdefer result.deinit();
- 
-     if (builtin.target.os.tag == .windows or builtin.link_libc) {
-         const name_c = try std.cstr.addNullByte(allocator, name);

diff --git a/dev-lang/zig-bin/zig-bin-0.9.1-r1.ebuild b/dev-lang/zig-bin/zig-bin-0.9.1-r1.ebuild
deleted file mode 100644
index b731f0d2c5d7..000000000000
--- a/dev-lang/zig-bin/zig-bin-0.9.1-r1.ebuild
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="A robust, optimal, and maintainable programming language"
-HOMEPAGE="https://ziglang.org/"
-SRC_URI="
-	amd64? ( https://ziglang.org/download/${PV}/zig-linux-x86_64-${PV}.tar.xz )
-	arm? ( https://ziglang.org/download/${PV}/zig-linux-armv7a-${PV}.tar.xz )
-	arm64? ( https://ziglang.org/download/${PV}/zig-linux-aarch64-${PV}.tar.xz )
-	x86? ( https://ziglang.org/download/${PV}/zig-linux-i386-${PV}.tar.xz )"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="-* ~amd64 ~arm ~arm64 ~x86"
-
-RDEPEND="!dev-lang/zig"
-
-SRC_URI+=" https://codeberg.org/BratishkaErik/distfiles/media/branch/master/zig-0.9.1-fix-detecting-abi.patch"
-
-# Zig provides its standard library in source form "/opt/zig-bin-{PV}/lib/",
-# and all other Zig libraries are meant to be consumed in source form,
-# 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=(
-	"${FILESDIR}/${P}-fix-bad-hostname-segfault.patch"
-	"${DISTDIR}/zig-0.9.1-fix-detecting-abi.patch"
-)
-
-QA_PREBUILT="opt/${P}/zig"
-
-src_unpack() {
-	unpack ${A}
-
-	mv "${WORKDIR}/"* "${S}"
-}
-
-src_install() {
-	insinto /opt/
-	doins -r "${S}"
-
-	dosym -r /opt/${P}/doc/ /usr/share/doc/${PF}
-	dosym -r /opt/${P}/zig /usr/bin/zig
-	fperms 0755 /usr/bin/zig
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig-bin/files/, dev-lang/zig-bin/
@ 2023-07-09  2:02 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-07-09  2:02 UTC (permalink / raw
  To: gentoo-commits

commit:     4df05bbbdf80c84c3f373ad75789ec0a6d13cbb4
Author:     Violet Purcell <vimproved <AT> inventati <DOT> org>
AuthorDate: Sat Jul  8 18:23:12 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <vimproved <AT> inventati.org>
Closes: https://github.com/gentoo/gentoo/pull/31791
Signed-off-by: Sam James <sam <AT> 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 <andrew@ziglang.org>
+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"
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-09  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 13:57 [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig-bin/files/, dev-lang/zig-bin/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2023-07-09  2:02 Sam James
2022-08-22  8:18 Jakov Smolić

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox