From 8532ec0a9f72cee85ec5c565360cabd4438e2058 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Sat, 26 Jul 2025 16:53:47 +0200 Subject: [PATCH 1/2] gcc-15 patches --- build/pkgs/gap/spkg-install.in | 2 +- .../gap_packages/patches/semigrouups.patch | 60 +++++++++++++++++++ build/pkgs/gap_packages/spkg-install.in | 20 ++++++- build/pkgs/planarity/spkg-install.in | 2 + build/pkgs/sagelib/spkg-install.in | 2 + src/doc/en/prep/Logging-On.rst | 2 +- 6 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 build/pkgs/gap_packages/patches/semigrouups.patch diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in index 7d207a47a48..07c0705251a 100644 --- a/build/pkgs/gap/spkg-install.in +++ b/build/pkgs/gap/spkg-install.in @@ -4,7 +4,7 @@ cd src -export CFLAGS=$CFLAGS_NON_NATIVE +export CFLAGS="-std=gnu17 $CFLAGS_NON_NATIVE" export CXXFLAGS=$CXXFLAGS_NON_NATIVE GAP_BUILD_ROOT="$(pwd)" diff --git a/build/pkgs/gap_packages/patches/semigrouups.patch b/build/pkgs/gap_packages/patches/semigrouups.patch new file mode 100644 index 00000000000..b699e44de2a --- /dev/null +++ b/build/pkgs/gap_packages/patches/semigrouups.patch @@ -0,0 +1,60 @@ +--- a/pkg/semigroups/gapbind14/include/gapbind14/gapbind14.hpp 2024-10-19 05:11:26.000000000 -0600 ++++ b/pkg/semigroups//gapbind14/include/gapbind14/gapbind14.hpp 2025-01-17 15:51:00.454986860 -0700 +@@ -291,7 +291,7 @@ namespace gapbind14 { + _funcs.push_back({detail::copy_c_str(nm), + sizeof...(Args) - 1, + detail::params_c_str(sizeof...(Args) - 1), +- (GVarFunc) func, ++ (ObjFunc) func, + detail::copy_c_str(fnm + ":Func" + nm)}); + } + +@@ -305,7 +305,7 @@ namespace gapbind14 { + .push_back({detail::copy_c_str(nm), + sizeof...(Args) - 1, + detail::params_c_str(sizeof...(Args) - 1), +- (GVarFunc) func, ++ (ObjFunc) func, + detail::copy_c_str(flnm + ":Func" + sbtyp + "::" + nm)}); + } + +--- a/pkg/semigroups//gapbind14/src/gapbind14.cpp 2024-10-19 05:11:26.000000000 -0600 ++++ b/pkg/semigroups//gapbind14/src/gapbind14.cpp 2025-01-17 15:43:51.483642580 -0700 +@@ -26,7 +26,7 @@ + #include "gapbind14/gap_include.hpp" // for Obj etc + + #define GVAR_ENTRY(srcfile, name, nparam, params) \ +- {#name, nparam, params, (GVarFunc) name, srcfile ":Func" #name} ++ {#name, nparam, params, (ObjFunc) (unsigned long) name, srcfile ":Func" #name} + + namespace gapbind14 { + UInt T_GAPBIND14_OBJ = 0; +@@ -241,7 +241,7 @@ namespace gapbind14 { + // TODO(later) remove, use InstallGlobalFunction instead + StructGVarFunc GVarFuncs[] + = {GVAR_ENTRY("gapbind14.cpp", IsValidGapbind14Object, 1, "arg1"), +- {0, 0, 0, 0, 0}}; ++ {nullptr, 0, nullptr, nullptr, nullptr}}; + } // namespace + + Module &module() { +--- a/pkg/semigroups//src/pkg.cpp 2024-10-19 05:11:26.000000000 -0600 ++++ b/pkg/semigroups//src/pkg.cpp 2025-01-17 15:44:47.234907535 -0700 +@@ -430,7 +430,7 @@ typedef Obj (*GVarFunc)(/*arguments*/); + + #define GVAR_ENTRY(srcfile, name, nparam, params) \ + { \ +-#name, nparam, params, (GVarFunc) name, srcfile ":Func" #name \ ++#name, nparam, params, (ObjFunc) (unsigned long) name, srcfile ":Func" #name \ + } + + // Table of functions to export +@@ -482,7 +482,7 @@ static StructGVarFunc GVarFuncs[] = { + 4, + "o, scc, lookup, nr_threads"), + +- {0, 0, 0, 0, 0} /* Finish with an empty entry */ ++ {nullptr, 0, nullptr, nullptr, nullptr} /* Finish with an empty entry */ + }; + + /****************************************************************************** diff --git a/build/pkgs/gap_packages/spkg-install.in b/build/pkgs/gap_packages/spkg-install.in index 2a73f074f77..79bc78722a4 100644 --- a/build/pkgs/gap_packages/spkg-install.in +++ b/build/pkgs/gap_packages/spkg-install.in @@ -92,7 +92,7 @@ install_compiled_pkg() # # These packages have an old ./configure that take the GAP_ROOT as a positional # argument -for pkg in cohomolo crypting grape guava orb datastructures +for pkg in cohomolo crypting grape orb datastructures do echo "Building GAP package $pkg" CFLAGS="$CFLAGS -Wno-implicit-function-declaration" @@ -104,6 +104,14 @@ do cd "$PKG_SRC_DIR" done +echo "Building GAP package guava" +export CFLAGS="-std=gnu17 $CFLAGS -Wno-implicit-function-declaration" +cd "$PKG_SRC_DIR/guava" +./configure "$GAP_ROOT" +sdh_make +install_compiled_pkg "guava" +cd "$PKG_SRC_DIR" + # These packages have a new-style autoconf ./configure # that takes --with-gaproot @@ -118,7 +126,7 @@ pararr=( " " " " "--with-external-planarity" "--with-external-libsemigroups" ) ############################################################################## parind=0 -for pkg in nq io digraphs semigroups +for pkg in nq io digraphs do echo "Building GAP package $pkg" cd "$PKG_SRC_DIR/$pkg" @@ -128,3 +136,11 @@ do install_compiled_pkg "$pkg" cd "$PKG_SRC_DIR" done + +echo "Building GAP package semigroups" +export CFLAGS="-std=gnu17 $CFLAGS" +cd "$PKG_SRC_DIR/semigroups" +sdh_configure --with-gaproot="$GAP_ROOT" --with-external-libsemigroups +sdh_make +install_compiled_pkg "semigroups" +cd "$PKG_SRC_DIR" diff --git a/build/pkgs/planarity/spkg-install.in b/build/pkgs/planarity/spkg-install.in index cf051425766..5a1863c95fb 100644 --- a/build/pkgs/planarity/spkg-install.in +++ b/build/pkgs/planarity/spkg-install.in @@ -1,3 +1,5 @@ +export CFLAGS="-std=gnu17 $CFLAGS" + cd src # Use newer version of config.guess and config.sub (see Issue #19723) diff --git a/build/pkgs/sagelib/spkg-install.in b/build/pkgs/sagelib/spkg-install.in index 5c78e3459c8..cb8ac526ea4 100644 --- a/build/pkgs/sagelib/spkg-install.in +++ b/build/pkgs/sagelib/spkg-install.in @@ -1,3 +1,5 @@ +export CFLAGS="-std=gnu17 $CFLAGS" + if [ "$SAGE_EDITABLE" = yes ]; then cd "$SAGE_SRC" else diff --git a/src/doc/en/prep/Logging-On.rst b/src/doc/en/prep/Logging-On.rst index 2181e22011b..e434cc3bcd5 100644 --- a/src/doc/en/prep/Logging-On.rst +++ b/src/doc/en/prep/Logging-On.rst @@ -54,7 +54,7 @@ the third option to "export" them will not make sense. The legacy SageNB has been retired in Sage 9.1. Please use the Jupyter notebook. Old SageNB worksheets can be converted to Jupyter notebooks -using the `sage --notebook=export`_ command or to RST +using the `sage --notebook=export` command or to RST using the `sage-sws2rst `_ package. Jupyter will bring you to a screen From e8098e9aac5dffc45925025723b5e03391234678 Mon Sep 17 00:00:00 2001 From: Enrique Artal Date: Sat, 26 Jul 2025 18:05:18 +0200 Subject: [PATCH 2/2] revert unnecessary changes --- build/pkgs/gap/spkg-install.in | 2 +- build/pkgs/planarity/spkg-install.in | 2 -- build/pkgs/sagelib/spkg-install.in | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build/pkgs/gap/spkg-install.in b/build/pkgs/gap/spkg-install.in index 07c0705251a..7d207a47a48 100644 --- a/build/pkgs/gap/spkg-install.in +++ b/build/pkgs/gap/spkg-install.in @@ -4,7 +4,7 @@ cd src -export CFLAGS="-std=gnu17 $CFLAGS_NON_NATIVE" +export CFLAGS=$CFLAGS_NON_NATIVE export CXXFLAGS=$CXXFLAGS_NON_NATIVE GAP_BUILD_ROOT="$(pwd)" diff --git a/build/pkgs/planarity/spkg-install.in b/build/pkgs/planarity/spkg-install.in index 5a1863c95fb..cf051425766 100644 --- a/build/pkgs/planarity/spkg-install.in +++ b/build/pkgs/planarity/spkg-install.in @@ -1,5 +1,3 @@ -export CFLAGS="-std=gnu17 $CFLAGS" - cd src # Use newer version of config.guess and config.sub (see Issue #19723) diff --git a/build/pkgs/sagelib/spkg-install.in b/build/pkgs/sagelib/spkg-install.in index cb8ac526ea4..5c78e3459c8 100644 --- a/build/pkgs/sagelib/spkg-install.in +++ b/build/pkgs/sagelib/spkg-install.in @@ -1,5 +1,3 @@ -export CFLAGS="-std=gnu17 $CFLAGS" - if [ "$SAGE_EDITABLE" = yes ]; then cd "$SAGE_SRC" else