diff --git a/cmake.spec b/cmake.spec index cda75acb782807942df740304b23b006cdd44012..dc0d84828d5cf95f1ebcc949a779312c6835c7e4 100644 --- a/cmake.spec +++ b/cmake.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %bcond_with bootstrap %bcond_without emacs %bcond_without git_test @@ -37,6 +37,8 @@ Source5: %{name}.req Patch100: %{name}-findruby.patch +Patch200: fix_atomic_error_when_build_on_riscv64.patch + BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc-c++ @@ -214,7 +216,8 @@ $SRCDIR/bootstrap --prefix=%{_prefix} \ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \ -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ - -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF + -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \ + -DCMake_TEST_NO_NETWORK:BOOL=ON popd %make_build -C %{_vpath_builddir} @@ -294,6 +297,8 @@ NO_TEST="$NO_TEST|curl" %endif %ifarch riscv64 NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocIncludeSymlink" +NO_TEST="$NO_TEST|RunCMake.Make|RunCMake.BuildDepends|Qt6Autogen.RerunMocBasic|Qt6Autogen.RerunRccDepends" +NO_TEST="$NO_TEST|RunCMake.ExternalProject|CMakeLib.testUVProcessChain|ExportImport|CMakeOnly.AllFindModules|RunCMake.AutogenQt5|RunCMake.Byproducts|RunCMake.GenEx-LINK_LIBRARY|RunCMake.GenEx-LINK_GROUP|RunCMake.GoogleTest|RunCMake.Graphviz|RunCMake.ObjectLibrary|RunCMake.CompileFeatures|RunCMake.WriteBasicConfigVersionFile|RunCMake.MaxRecursionDepth|TryCompile|CPackTestAllGenerators" %endif bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure popd @@ -351,6 +356,9 @@ popd %{_rpmconfigdir}/%{name}.req %changelog +* Tue Jun 03 2025 Shangtong Guo - 3.30.3-2 +- fix atomic link error when build on riscv64 + * Thu Feb 27 2025 Zhao Hang - 3.30.5-1 - Update to 3.30.5-1 from 3.26.3-1 - Drop non-upstream CMAKE_DL_LIBS windows patch diff --git a/fix_atomic_error_when_build_on_riscv64.patch b/fix_atomic_error_when_build_on_riscv64.patch new file mode 100644 index 0000000000000000000000000000000000000000..03ca6c645bdde7dc3887e962ed470a933c78b865 --- /dev/null +++ b/fix_atomic_error_when_build_on_riscv64.patch @@ -0,0 +1,19 @@ +diff -ruN cmake-3.30.5/Modules/Platform/Linux.cmake cmake-3.30.5_bak/Modules/Platform/Linux.cmake +--- cmake-3.30.5/Modules/Platform/Linux.cmake 2024-10-08 08:56:04.000000000 -0400 ++++ cmake-3.30.5_bak/Modules/Platform/Linux.cmake 2025-05-29 19:57:52.565154600 -0400 +@@ -93,3 +93,15 @@ + set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE) + endif() + endif() ++ ++# RISCV needs -latomic ++# https://gitlab.kitware.com/cmake/cmake/-/issues/20895 ++# ++# Ideally I'd use CMAKE_C_COMPILER_ARCHITECTURE_ID, but that is only ++# available on Win platforms. Not sure why though, cause every ++# compiler on Linux has a default architecture it compiles for too, ++# when no flags are passed to ask the compiler to behave differently. ++if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64") ++ string(APPEND CMAKE_C_STANDARD_LIBRARIES " -latomic") ++ string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -latomic") ++endif()