summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-02-11 03:57:32 +0000
committerSam James <sam@gentoo.org>2023-02-11 04:18:58 +0000
commit3cc10101043aa2994d613ddd371323275a7beb42 (patch)
tree765461e1422f76222665f5a600f255db5cde6440 /dev-lang/swi-prolog
parentnet-analyzer/rrdtool: fix configure w/ clang 16 (diff)
downloadgentoo-3cc10101043aa2994d613ddd371323275a7beb42.tar.gz
gentoo-3cc10101043aa2994d613ddd371323275a7beb42.tar.bz2
gentoo-3cc10101043aa2994d613ddd371323275a7beb42.zip
dev-lang/swi-prolog: fix configure w/ clang 16
Closes: https://bugs.gentoo.org/879657 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/swi-prolog')
-rw-r--r--dev-lang/swi-prolog/files/swi-prolog-9.1.2-configure-clang16.patch61
-rw-r--r--dev-lang/swi-prolog/swi-prolog-9.1.2-r1.ebuild (renamed from dev-lang/swi-prolog/swi-prolog-9.1.2.ebuild)5
2 files changed, 66 insertions, 0 deletions
diff --git a/dev-lang/swi-prolog/files/swi-prolog-9.1.2-configure-clang16.patch b/dev-lang/swi-prolog/files/swi-prolog-9.1.2-configure-clang16.patch
new file mode 100644
index 000000000000..292728269526
--- /dev/null
+++ b/dev-lang/swi-prolog/files/swi-prolog-9.1.2-configure-clang16.patch
@@ -0,0 +1,61 @@
+https://bugs.gentoo.org/879657
+https://github.com/SWI-Prolog/swipl-devel/commit/2328d9d54c8aa368a4bf0165b1b811d1f31ba0f7
+https://github.com/SWI-Prolog/swipl-devel/commit/0d1088443348b71a3624835a19469e2b6cc7e284
+
+From 2328d9d54c8aa368a4bf0165b1b811d1f31ba0f7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 10 Jan 2023 14:08:04 +0100
+Subject: [PATCH] cmake: Fix C99 compatibility issues in GCC built-in detection
+
+Future compilers may not support implicit ints or implicit
+function declarations, so avoid them, by using an explicit int
+type and including <alloca.h> for the alloca function.
+--- a/cmake/GCCBuiltins.cmake
++++ b/cmake/GCCBuiltins.cmake
+@@ -22,7 +22,7 @@ check_c_source_compiles(
+ "volatile int i=0; int main() { return 0; }"
+ HAVE_VOLATILE)
+ check_c_source_compiles(
+- "static inline foo() { return 0; } int main() { return foo(); }"
++ "static inline int foo() { return 0; } int main() { return foo(); }"
+ HAVE_INLINE)
+ check_c_source_compiles(
+ "int main() { void *p = &&lbl; goto *p; lbl: return 0; }"
+@@ -45,7 +45,7 @@ check_visibility()
+ # Builtin functions that lead to conflicts
+
+ check_c_source_compiles(
+- "int main() { char *s = alloca(10); return s!=0; }"
++ "#include <alloca.h>\nint main() { char *s = alloca(10); return s!=0; }"
+ HAVE_ALLOCA)
+ check_c_source_compiles(
+ "#include <math.h>\nint main() { double x; return signbit(x); }"
+
+From 0d1088443348b71a3624835a19469e2b6cc7e284 Mon Sep 17 00:00:00 2001
+From: Jan Wielemaker <J.Wielemaker@vu.nl>
+Date: Wed, 11 Jan 2023 13:30:34 +0100
+Subject: [PATCH] Cleanup some no longer used GCC __builtin checks.
+
+--- a/cmake/GCCBuiltins.cmake
++++ b/cmake/GCCBuiltins.cmake
+@@ -9,12 +9,6 @@ check_c_source_compiles(
+ check_c_source_compiles(
+ "int i=0; int main() { return __builtin_expect(i, 0) ? 0 : 1; }"
+ HAVE___BUILTIN_EXPECT)
+-check_c_source_compiles(
+- "int i=0; struct {int x[10];} st; int main() { return __builtin_choose_expr(1, i, st); }"
+- HAVE___BUILTIN_CHOOSE_EXPR)
+-check_c_source_compiles(
+- "int i=0; int main() { return __builtin_types_compatible_p(typeof(i), int); }"
+- HAVE___BUILTIN_TYPES_COMPATIBLE_P)
+ check_c_source_compiles(
+ "__thread int i=0; int main() { return 0; }"
+ HAVE___THREAD)
+@@ -48,5 +42,5 @@ check_c_source_compiles(
+ "#include <alloca.h>\nint main() { char *s = alloca(10); return s!=0; }"
+ HAVE_ALLOCA)
+ check_c_source_compiles(
+- "#include <math.h>\nint main() { double x; return signbit(x); }"
++ "#include <math.h>\nint main() { double x = 0.0; return signbit(x); }"
+ HAVE_SIGNBIT)
+
diff --git a/dev-lang/swi-prolog/swi-prolog-9.1.2.ebuild b/dev-lang/swi-prolog/swi-prolog-9.1.2-r1.ebuild
index 5449898d6a02..7cee8edc9d51 100644
--- a/dev-lang/swi-prolog/swi-prolog-9.1.2.ebuild
+++ b/dev-lang/swi-prolog/swi-prolog-9.1.2-r1.ebuild
@@ -73,6 +73,11 @@ DEPEND="${COMMON_DEPEND}
"
BDEPEND="virtual/pkgconfig"
+PATCHES=(
+ # Upstream in >= 9.1.3
+ "${FILESDIR}"/${P}-configure-clang16.patch
+)
+
pkg_setup() {
java-pkg-opt-2_pkg_setup
}