From a1e9bc51c92bad5abacf272adcc83123f5af9944 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 2 Mar 2025 12:23:12 +0800 Subject: [PATCH] try build with cmake 4.0 --- autofdo.spec | 22 +++++++++---------- ...y-glog-eliminate-deprecation-warning.patch | 20 +++++++++++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 backport-autofdo-third_party-glog-eliminate-deprecation-warning.patch diff --git a/autofdo.spec b/autofdo.spec index eedc945..7b3e34b 100644 --- a/autofdo.spec +++ b/autofdo.spec @@ -1,6 +1,6 @@ Name: autofdo Version: 0.30.1 -Release: 3 +Release: 4 Summary: A tool to convert perf.data profile to AutoFDO profile License: Apache-2.0 URL: https://github.com/google/autofdo @@ -10,10 +10,8 @@ Source0: %{name}-%{version}.tar.xz Source1: abseil.tar.xz Patch1: 0001-adjust-the-link-method-of-dependency-libraries.patch Patch2: 0002-unscaledcycleclock-remove-RISC-V-support.patch -BuildRequires: gcc gcc-c++ libtool git cmake elfutils-libelf-devel openssl-devel pkg-config ninja-build gtest libunwind-devel protobuf-devel chrpath -Requires: glibc openssl-libs elfutils libgcc libstdc++ zlib - - +Patch3: backport-autofdo-third_party-glog-eliminate-deprecation-warning.patch +BuildRequires: gcc gcc-c++ cmake elfutils-libelf-devel openssl-devel pkg-config ninja-build libunwind-devel protobuf-devel %description This package contains a tool to convert perf.data profile to AutoFDO @@ -24,15 +22,14 @@ profile that can be used by GCC and LLVM. tar -xvf %{SOURCE1} -C ./third_party %build -cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -DENABLE_TOOL=GCOV ./ -%ninja_build +%cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TOOL=GCOV -DBUILD_SHARED_LIBS=OFF +%cmake_build %install mkdir -p %{buildroot}%{_bindir} -cd %{buildroot}%{_bindir} -cp %{_builddir}/%{name}-%{version}/create_gcov ./ -cp %{_builddir}/%{name}-%{version}/dump_gcov ./ -cp %{_builddir}/%{name}-%{version}/profile_merger ./ +install -m0755 %{__cmake_builddir}/create_gcov %{buildroot}%{_bindir} +install -m0755 %{__cmake_builddir}/dump_gcov %{buildroot}%{_bindir} +install -m0755 %{__cmake_builddir}/profile_merger %{buildroot}%{_bindir} %files %{_bindir}/create_gcov @@ -40,6 +37,9 @@ cp %{_builddir}/%{name}-%{version}/profile_merger ./ %{_bindir}/profile_merger %changelog +* Sun Mar 02 2025 Funda Wang - 0.30.1-4 +- try build with cmake 4.0 + * Wed Feb 12 2025 Zhenyu Zhao - 0.30.1-3 - Type:update - ID:NA diff --git a/backport-autofdo-third_party-glog-eliminate-deprecation-warning.patch b/backport-autofdo-third_party-glog-eliminate-deprecation-warning.patch new file mode 100644 index 0000000..95e5036 --- /dev/null +++ b/backport-autofdo-third_party-glog-eliminate-deprecation-warning.patch @@ -0,0 +1,20 @@ +From 3411d58669fe07e70335b252299432a00d1e7c6c Mon Sep 17 00:00:00 2001 +From: Sergiu Deitsch +Date: Thu, 5 Oct 2023 00:48:10 +0200 +Subject: [PATCH] cmake: eliminate deprecation warning + +--- + cmake/GetCacheVariables.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/glog/cmake/GetCacheVariables.cmake b/third_party/glog/cmake/GetCacheVariables.cmake +index ead35895a..76f2b1683 100644 +--- a/third_party/glog/cmake/GetCacheVariables.cmake ++++ b/third_party/glog/cmake/GetCacheVariables.cmake +@@ -1,5 +1,5 @@ + cmake_policy (PUSH) +-cmake_policy (VERSION 3.3) ++cmake_policy (VERSION 3.16...3.27) + + include (CMakeParseArguments) + -- Gitee