From d61c148199642f43f4d95760cb8ce27370a3476a Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Sun, 26 Jan 2025 09:47:14 +0800 Subject: [PATCH] No longer support aarch64_ilp32 compilation --- backport-cmake-aarch64-ilp32-support.patch | 238 --------------------- cmake.attr | 2 +- cmake.req | 2 - cmake.spec | 16 +- macros.cmake.in | 4 - 5 files changed, 5 insertions(+), 257 deletions(-) delete mode 100644 backport-cmake-aarch64-ilp32-support.patch diff --git a/backport-cmake-aarch64-ilp32-support.patch b/backport-cmake-aarch64-ilp32-support.patch deleted file mode 100644 index fa3b47d..0000000 --- a/backport-cmake-aarch64-ilp32-support.patch +++ /dev/null @@ -1,238 +0,0 @@ -From d5d39d3adba9f68b7c2e83920230102adb172c23 Mon Sep 17 00:00:00 2001 -From: root -Date: Thu, 3 Dec 2020 17:03:47 +0800 -Subject: [PATCH] cmake aarch64-ilp32 support - -Reference:https://build.opensuse.org/package/view_file/devel:ARM:Factory:Contrib:ILP32/cmake/aarch64-ilp32.patch?expand=1 -Conflict:Contextual adaptation - ---- - Modules/CMakeCompilerABI.h | 5 +++++ - Modules/FindGTK2.cmake | 2 ++ - Modules/FindJNI.cmake | 4 ++++ - Modules/FindPkgConfig.cmake | 4 ++++ - Modules/GNUInstallDirs.cmake | 5 +++++ - Modules/Platform/UnixPaths.cmake | 3 ++- - Source/cmFindLibraryCommand.cxx | 6 ++++++ - Source/cmFindPackageCommand.cxx | 11 +++++++++++ - Source/cmFindPackageCommand.h | 1 + - Source/cmMakefile.cxx | 13 +++++++++++++ - Source/cmMakefile.h | 3 +++ - 11 files changed, 56 insertions(+), 1 deletion(-) - -diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h -index 45532af..38545c9 100644 ---- a/Modules/CMakeCompilerABI.h -+++ b/Modules/CMakeCompilerABI.h -@@ -24,6 +24,11 @@ const char info_sizeof_dptr[] = { - defined(__ILP32__) - # define ABI_ID "ELF X32" - -+#elif defined(__ELF__) && defined(__aarch64__) && defined(__LP64__) -+# define ABI_ID "ELF LP64" -+#elif defined(__ELF__) && defined(__aarch64__) && defined(__ILP32__) -+# define ABI_ID "ELF ILP32" -+ - #elif defined(__ELF__) - # define ABI_ID "ELF" - #endif -diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake -index 83091f3..9ed1f4d 100644 ---- a/Modules/FindGTK2.cmake -+++ b/Modules/FindGTK2.cmake -@@ -293,9 +293,11 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) - PATHS - ${_gtk2_arch_dir} - /usr/local/libx32 -+ /usr/local/libilp32 - /usr/local/lib64 - /usr/local/lib - /usr/libx32 -+ /usr/libilp32 - /usr/lib64 - /usr/lib - /opt/gnome/include -diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake -index 3a5bd31..04fe966 100644 ---- a/Modules/FindJNI.cmake -+++ b/Modules/FindJNI.cmake -@@ -64,6 +64,8 @@ macro(java_append_library_directories _var) - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") - # Subdir is "arm" for both big-endian (arm) and little-endian (armel). - set(_java_libarch "arm" "aarch32") -+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") -+ set(_java_libarch "aarch64" "aarch64_ilp32") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") - # mips* machines are bi-endian mostly so processor does not tell - # endianness of the underlying system. -@@ -216,6 +218,8 @@ set(_JNI_JAVA_DIRECTORIES_BASE - # SuSE specific paths for default JVM - /usr/lib64/jvm/java - /usr/lib64/jvm/jre -+ /usr/libilp32/jvm/java -+ /usr/libilp32/jvm/jre - ) - - set(_JNI_JAVA_AWT_LIBRARY_TRIES) -diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake -index bd1bc7c..4773d99 100644 ---- a/Modules/FindPkgConfig.cmake -+++ b/Modules/FindPkgConfig.cmake -@@ -317,6 +317,10 @@ macro(_pkg_set_path_internal) - if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") - list(APPEND _lib_dirs "libx32/pkgconfig") - endif() -+ get_property(uselibilp32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBILP32_PATHS) -+ if(uselibilp32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF ILP32") -+ list(APPEND _lib_dirs "libilp32/pkgconfig") -+ endif() - endif() - endif() - if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING) -diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake -index f95e6e2..003e8cc 100644 ---- a/Modules/GNUInstallDirs.cmake -+++ b/Modules/GNUInstallDirs.cmake -@@ -245,6 +245,11 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set - if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX) - set(__LAST_LIBDIR_DEFAULT "lib64") - endif() -+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") -+ set(_LIBDIR_DEFAULT "libilp32") -+ if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX) -+ set(__LAST_LIBDIR_DEFAULT "libilp32") -+ endif() - endif() - endif() - endif() -diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake -index 97f744d..9acb7b3 100644 ---- a/Modules/Platform/UnixPaths.cmake -+++ b/Modules/Platform/UnixPaths.cmake -@@ -60,7 +60,7 @@ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH - ) - - list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES -- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64 -+ /lib /lib32 /lib64 /libilp32 /usr/lib /usr/lib32 /usr/lib64 /usr/libilp32 - ) - - if(CMAKE_SYSROOT_COMPILE) -@@ -90,3 +90,4 @@ unset(_cmake_sysroot_compile) - set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE) - set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) - set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE) -+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBILP32_PATHS TRUE) -diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx -index 20221b1..b73b1c1 100644 ---- a/Source/cmFindLibraryCommand.cxx -+++ b/Source/cmFindLibraryCommand.cxx -@@ -70,6 +70,12 @@ bool cmFindLibraryCommand::InitialPass(std::vector const& argsIn) - "FIND_LIBRARY_USE_LIBX32_PATHS")) { - this->AddArchitecturePaths("x32"); - } -+ // add special 32 bit paths if this is an ilp32 compile. -+ else if (this->Makefile->PlatformIsilp32() && -+ this->Makefile->GetState()->GetGlobalPropertyAsBool( -+ "FIND_LIBRARY_USE_LIBILP32_PATHS")) { -+ this->AddArchitecturePaths("ilp32"); -+ } - - std::string const library = this->FindLibrary(); - if (!library.empty()) { -diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx -index 2b11b62..deb5f1e 100644 ---- a/Source/cmFindPackageCommand.cxx -+++ b/Source/cmFindPackageCommand.cxx -@@ -100,6 +100,7 @@ cmFindPackageCommand::cmFindPackageCommand(cmExecutionStatus& status) - this->UseLib32Paths = false; - this->UseLib64Paths = false; - this->UseLibx32Paths = false; -+ this->UseLibilp32Paths = false; - this->UseRealPath = false; - this->PolicyScope = true; - this->VersionMajor = 0; -@@ -190,6 +191,13 @@ bool cmFindPackageCommand::InitialPass(std::vector const& args) - this->UseLibx32Paths = true; - } - -+ // Lookup whether libilp32 paths should be used. -+ if (this->Makefile->PlatformIsilp32() && -+ this->Makefile->GetState()->GetGlobalPropertyAsBool( -+ "FIND_LIBRARY_USE_LIBILP32_PATHS")) { -+ this->UseLibilp32Paths = true; -+ } -+ - // Check if User Package Registry should be disabled - // The `CMAKE_FIND_USE_PACKAGE_REGISTRY` has - // priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY -@@ -2097,6 +2105,9 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) - if (this->UseLibx32Paths) { - common.emplace_back("libx32"); - } -+ if (this->UseLibilp32Paths) { -+ common.emplace_back("libilp32"); -+ } - common.emplace_back("lib"); - common.emplace_back("share"); - -diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h -index 85fe7b6..f254581 100644 ---- a/Source/cmFindPackageCommand.h -+++ b/Source/cmFindPackageCommand.h -@@ -178,6 +178,7 @@ private: - bool UseLib32Paths; - bool UseLib64Paths; - bool UseLibx32Paths; -+ bool UseLibilp32Paths; - bool UseRealPath; - bool PolicyScope; - std::string LibraryArchitecture; -diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx -index f143ef7..8b5aee4 100644 ---- a/Source/cmMakefile.cxx -+++ b/Source/cmMakefile.cxx -@@ -2569,6 +2569,9 @@ bool cmMakefile::PlatformIs32Bit() const - if (strcmp(plat_abi, "ELF X32") == 0) { - return false; - } -+ if (strcmp(plat_abi, "ELF ILP32") == 0) { -+ return false; -+ } - } - if (const char* sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P")) { - return atoi(sizeof_dptr) == 4; -@@ -2595,6 +2598,16 @@ bool cmMakefile::PlatformIsx32() const - return false; - } - -+bool cmMakefile::PlatformIsilp32() const -+{ -+ if (const char* plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { -+ if (strcmp(plat_abi, "ELF ILP32") == 0) { -+ return true; -+ } -+ } -+ return false; -+} -+ - cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const - { - std::string sdkRoot; -diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h -index 6e59494..615e291 100644 ---- a/Source/cmMakefile.h -+++ b/Source/cmMakefile.h -@@ -511,6 +511,9 @@ public: - /** Return whether the target platform is x32. */ - bool PlatformIsx32() const; - -+ /** Return whether the target platform is ilp32. */ -+ bool PlatformIsilp32() const; -+ - /** Apple SDK Type */ - enum class AppleSDK - { --- -2.23.0 - diff --git a/cmake.attr b/cmake.attr index f9724b6..83f3f1a 100644 --- a/cmake.attr +++ b/cmake.attr @@ -1,3 +1,3 @@ %__cmake_provides %{_rpmconfigdir}/cmake.prov %__cmake_requires %{_rpmconfigdir}/cmake.req -%__cmake_path ^(/usr/lib(64|ilp32)?|%{_datadir})/cmake/.*/.*(Config\.cmake|-config\.cmake)$ +%__cmake_path ^(%{_libdir}|%{_datadir})/cmake/.*/.*(Config\.cmake|-config\.cmake)$ diff --git a/cmake.req b/cmake.req index 5dea386..9af5c44 100644 --- a/cmake.req +++ b/cmake.req @@ -45,8 +45,6 @@ class CMakeParser: has_module = True if re.match(".*/usr/lib(64)?/cmake/.*", modulePath): is_arched = True - elif re.match(".*/usr/libilp32/cmake/.*", modulePath): - is_arched = True if has_module: if is_arched: diff --git a/cmake.spec b/cmake.spec index 4b5fd64..500ce30 100644 --- a/cmake.spec +++ b/cmake.spec @@ -2,17 +2,10 @@ %bcond_without ncurses %bcond_without X11_test -%ifarch aarch64_ilp32 -%bcond_with cmake_gui -%bcond_with emacs -%bcond_without bootstrap -%bcond_with sphinx -%else %bcond_without cmake_gui %bcond_without emacs %bcond_with bootstrap %bcond_without sphinx -%endif # Do not build non-lto objects to reduce build time significantly. %global build_cflags %(echo '%{build_cflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') @@ -28,7 +21,7 @@ Name: cmake Version: 3.27.9 %global major_version %(echo %{version} | awk -F. '{print $1}') -Release: 9 +Release: 10 Summary: Cross-platform make system License: BSD-3-Clause AND MIT-open-group AND Zlib URL: http://www.cmake.org @@ -41,7 +34,6 @@ Source5: cmake.req Patch0: cmake-findruby.patch Patch1: cmake-3.27.9-fix-cxx-standard-check-issue.patch Patch2: cmake-3.22.0-sw.patch -Patch3: backport-cmake-aarch64-ilp32-support.patch BuildRequires: coreutils findutils gcc-c++ gcc-gfortran sed @@ -140,9 +132,6 @@ Documentation for cmake. %ifarch sw_64 %patch 2 -p1 %endif -%ifarch aarch64_ilp32 -%patch 3 -p1 -%endif echo '#!%{__python3}' > %{name}.prov echo '#!%{__python3}' > %{name}.req @@ -319,6 +308,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %exclude %{_pkgdocdir}/Copyright.txt %changelog +* Sun Jan 26 2025 fuanan - 3.27.9-10 +- No longer support aarch64_ilp32 compilation + * Thu Jan 23 2025 Funda Wang - 3.27.9-9 - default to out-of-source build diff --git a/macros.cmake.in b/macros.cmake.in index accad53..24e3806 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -3,7 +3,6 @@ # %_cmake_lib_suffix64 -DLIB_SUFFIX=64 -%_cmake_lib_suffixilp32 -DLIB_SUFFIX=ilp32 %_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON %_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON %_cmake_version @@CMAKE_VERSION@@ @@ -37,9 +36,6 @@ -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ %if "%{?_lib}" == "lib64" \ %{?_cmake_lib_suffix64} \\\ -%endif \ -%if "%{?_lib}" == "libilp32" \ - %{?_cmake_lib_suffixilp32} \\\ %endif \ %{?_cmake_shared_libs} \\\ %{?_cmake_module_linker_flags:-DCMAKE_MODULE_LINKER_FLAGS="%_cmake_module_linker_flags%{?_cmake_module_linker_flags_extra: %_cmake_module_linker_flags_extra}"} \\\ -- Gitee