commit:     b15d873b0f867c6b2fe6c763bf859ea79ea41074
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Mon Oct 10 03:16:41 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 18 15:00:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b15d873b

dev-lang/zig: fix building with Clang 16, fix searching LLD

Upstream PR https://github.com/ziglang/zig/pull/13121

Closes: https://bugs.gentoo.org/877231
Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Closes: https://github.com/gentoo/gentoo/pull/27718
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/zig/files/zig-0.9.1-fix-clang16.patch     | 23 ++++++++++++++++++++++
 .../{zig-0.9.1-r2.ebuild => zig-0.9.1-r3.ebuild}   |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch 
b/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch
new file mode 100644
index 000000000000..deb563378d76
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch
@@ -0,0 +1,23 @@
+From: Eric Joldasov <[email protected]>
+Fix building with Clang 16
+Upstream PR https://github.com/ziglang/zig/pull/13121
+
+--- a/src/stage1/parse_f128.c
++++ b/src/stage1/parse_f128.c
+@@ -983,14 +983,14 @@ static int isspace(int c)
+     return c == ' ' || (unsigned)c-'\t' < 5;
+ }
+ 
+-static inline float128_t makeInf128() {
++static inline float128_t makeInf128(void) {
+     union ldshape ux;
+     ux.i2.hi = 0x7fff000000000000UL;
+     ux.i2.lo = 0x0UL;
+     return ux.f;
+ }
+ 
+-static inline float128_t makeNaN128() {
++static inline float128_t makeNaN128(void) {
+     uint64_t rand = 0UL;
+     union ldshape ux;
+     ux.i2.hi = 0x7fff000000000000UL | (rand & 0xffffffffffffUL);

diff --git a/dev-lang/zig/zig-0.9.1-r2.ebuild b/dev-lang/zig/zig-0.9.1-r3.ebuild
similarity index 94%
rename from dev-lang/zig/zig-0.9.1-r2.ebuild
rename to dev-lang/zig/zig-0.9.1-r3.ebuild
index 4adbe994a8f3..463cead06e2d 100644
--- a/dev-lang/zig/zig-0.9.1-r2.ebuild
+++ b/dev-lang/zig/zig-0.9.1-r3.ebuild
@@ -23,6 +23,7 @@ IUSE="test +threads"
 RESTRICT="!test? ( test )"
 
 PATCHES=(
+       "${FILESDIR}/${P}-fix-clang16.patch"
        "${FILESDIR}/${P}-fix-single-threaded.patch"
        "${FILESDIR}/${P}-fix-riscv.patch"
        "${FILESDIR}/${P}-fix-bad-hostname-segfault.patch"
@@ -59,6 +60,7 @@ src_configure() {
                -DZIG_USE_CCACHE=OFF
                -DZIG_PREFER_CLANG_CPP_DYLIB=ON
                -DZIG_SINGLE_THREADED="$(usex !threads)"
+               -DCMAKE_PREFIX_PATH=$(get_llvm_prefix ${LLVM_MAX_SLOT})
        )
 
        cmake_src_configure

Reply via email to