From 1c6009e6a44e6ed18626a0c6803663fa3d3fac50 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Jan 10 2023 13:11:42 +0000 Subject: Fix C99 compatibility issues in CMake checks Related to: --- diff --git a/pl-cmake-c99.patch b/pl-cmake-c99.patch new file mode 100644 index 0000000..5e65e7b --- /dev/null +++ b/pl-cmake-c99.patch @@ -0,0 +1,27 @@ +Future compilers may not support implicit ints or implicit +function declarations, so avoid them, by using an explicit int +type and including for the alloca function. + +Submitted upstream: + +diff -ur swipl-9.0.3.orig/cmake/GCCBuiltins.cmake swipl-9.0.3/cmake/GCCBuiltins.cmake +--- swipl-9.0.3.orig/cmake/GCCBuiltins.cmake 2022-12-18 16:16:32.000000000 +0100 ++++ swipl-9.0.3/cmake/GCCBuiltins.cmake 2023-01-10 13:55:13.378369966 +0100 +@@ -22,7 +22,7 @@ + "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 @@ + # Builtin functions that lead to conflicts + + check_c_source_compiles( +- "int main() { char *s = alloca(10); return s!=0; }" ++ "#include \nint main() { char *s = alloca(10); return s!=0; }" + HAVE_ALLOCA) + check_c_source_compiles( + "#include \nint main() { double x; return signbit(x); }" diff --git a/pl.spec b/pl.spec index a9fb341..74b302e 100644 --- a/pl.spec +++ b/pl.spec @@ -17,7 +17,7 @@ Name: pl Version: 9.0.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: SWI-Prolog - Edinburgh compatible Prolog compiler #LICENSE: BSD-2-Clause #library/dialect/iso/iso_predicates.pl BSD-2-Clause AND (GPL-2.0-or-later WITH @@ -160,6 +160,8 @@ Patch1: swipl-8.2.0-Remove-files-locations-from-swipl-1-manual.patch # Unbundle libstemmer Patch2: swipl-8.2.0-unbundle-libstemmer.patch +Patch3: pl-cmake-c99.patch + BuildRequires: cmake BuildRequires: findutils BuildRequires: gcc-c++ @@ -602,6 +604,9 @@ cp -p packages/jpl/jpl.pl.install packages/jpl/jpl.pl %changelog +* Tue Jan 10 2023 Florian Weimer - 9.0.3-2 +- Fix C99 compatibility issues in CMake checks + * Sun Dec 18 2022 Jerry James - 9.0.3-1 - Version 9.0.3