diff --git a/0001-Build-Static-Library.patch b/0001-adjust-the-link-method-of-dependency-libraries.patch similarity index 36% rename from 0001-Build-Static-Library.patch rename to 0001-adjust-the-link-method-of-dependency-libraries.patch index e6cd1ddcc986e5bedfd82c9187fe11224a851437..317cf15025f37fd5ccdb0d7ccf99ae47d375a05b 100644 --- a/0001-Build-Static-Library.patch +++ b/0001-adjust-the-link-method-of-dependency-libraries.patch @@ -1,5 +1,28 @@ +From 6693885c1234273bd570d4ee4f4f5856a4df46ea Mon Sep 17 00:00:00 2001 +From: Eric Wang +Date: Wed, 7 Aug 2024 09:12:17 +0800 +Subject: [PATCH] adjust the link method of dependency libraries + +--- + CMakeLists.txt | 2 +- + third_party/glog/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dc10c28..808e489 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,7 @@ set(CMAKE_CXX_STANDARD 17) + set(ABSL_PROPAGATE_CXX_STD on) + + project(autofdo) +-set (Protobuf_USE_STATIC_LIBS TRUE) ++set (Protobuf_USE_STATIC_LIBS FALSE) + + function (execute_perf_protobuf) + diff --git a/third_party/glog/CMakeLists.txt b/third_party/glog/CMakeLists.txt -index 2d00c4d..b6b3a1a 100644 +index 846b444..8be869b 100644 --- a/third_party/glog/CMakeLists.txt +++ b/third_party/glog/CMakeLists.txt @@ -34,7 +34,7 @@ include (GenerateExportHeader) @@ -10,4 +33,7 @@ index 2d00c4d..b6b3a1a 100644 +option (BUILD_SHARED_LIBS "Build shared libraries" OFF) option (PRINT_UNSYMBOLIZED_STACK_TRACES "Print file offsets in traces instead of symbolizing" OFF) - option (WITH_GFLAGS "Use gflags" ON) + option (WITH_CUSTOM_PREFIX "Enable support for user-generated message prefixes" ON) +-- +2.39.3 (Apple Git-146) + diff --git a/0002-unscaledcycleclock-remove-RISC-V-support.patch b/0002-unscaledcycleclock-remove-RISC-V-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..f104a2efe440d640be942058aa45b1b79686b410 --- /dev/null +++ b/0002-unscaledcycleclock-remove-RISC-V-support.patch @@ -0,0 +1,49 @@ +diff --git a/third_party/abseil/absl/base/internal/unscaledcycleclock.cc b/third_party/abseil/absl/base/internal/unscaledcycleclock.cc +index 05e0e7b..a0bf3a6 100644 +--- a/third_party/abseil/absl/base/internal/unscaledcycleclock.cc ++++ b/third_party/abseil/absl/base/internal/unscaledcycleclock.cc +@@ -121,18 +121,6 @@ double UnscaledCycleClock::Frequency() { + return aarch64_timer_frequency; + } + +-#elif defined(__riscv) +- +-int64_t UnscaledCycleClock::Now() { +- int64_t virtual_timer_value; +- asm volatile("rdcycle %0" : "=r"(virtual_timer_value)); +- return virtual_timer_value; +-} +- +-double UnscaledCycleClock::Frequency() { +- return base_internal::NominalCPUFrequency(); +-} +- + #elif defined(_M_IX86) || defined(_M_X64) + + #pragma intrinsic(__rdtsc) +diff --git a/third_party/abseil/absl/base/internal/unscaledcycleclock_config.h b/third_party/abseil/absl/base/internal/unscaledcycleclock_config.h +index 24b324a..43a3dab 100644 +--- a/third_party/abseil/absl/base/internal/unscaledcycleclock_config.h ++++ b/third_party/abseil/absl/base/internal/unscaledcycleclock_config.h +@@ -21,8 +21,8 @@ + + // The following platforms have an implementation of a hardware counter. + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ +- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ +- defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) ++ defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \ ++ (defined(_M_X64) && !defined(_M_ARM64EC)) + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 + #else + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0 +@@ -53,8 +53,8 @@ + #if ABSL_USE_UNSCALED_CYCLECLOCK + // This macro can be used to test if UnscaledCycleClock::Frequency() + // is NominalCPUFrequency() on a particular platform. +-#if (defined(__i386__) || defined(__x86_64__) || defined(__riscv) || \ +- defined(_M_IX86) || defined(_M_X64)) ++#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \ ++ defined(_M_X64)) + #define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY + #endif + #endif diff --git a/autofdo-0.19.tar.xz b/autofdo-0.30.1.tar.xz similarity index 64% rename from autofdo-0.19.tar.xz rename to autofdo-0.30.1.tar.xz index 140c6819b63edf399ef60ac97de255d01cfec677..531f696aad632fb4220ddc16dad3de4ad26907e1 100644 Binary files a/autofdo-0.19.tar.xz and b/autofdo-0.30.1.tar.xz differ diff --git a/autofdo.spec b/autofdo.spec index b2699608d16af36c3ef803e95374dfcde1389005..110a40ba7dd0f8abf25057634dabb826645b6353 100644 --- a/autofdo.spec +++ b/autofdo.spec @@ -1,16 +1,19 @@ Name: autofdo -Version: 0.19 -Release: 3.20231228.git0e296280 +Version: 0.30.1 +Release: 2 Summary: A tool to convert perf.data profile to AutoFDO profile License: Apache-2.0 URL: https://github.com/google/autofdo # The package in the original url below contains GIT information which is useless, # so remove the GIT information and repackage it. Source0: %{name}-%{version}.tar.xz -Patch0: 0001-Build-Static-Library.patch +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 + + %description This package contains a tool to convert perf.data profile to AutoFDO profile that can be used by GCC and LLVM. @@ -19,7 +22,7 @@ profile that can be used by GCC and LLVM. %autosetup -p1 %build -cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. ./ +cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -DENABLE_TOOL=GCOV ./ %ninja_build %install @@ -29,15 +32,25 @@ cp %{_builddir}/%{name}-%{version}/create_gcov ./ cp %{_builddir}/%{name}-%{version}/dump_gcov ./ cp %{_builddir}/%{name}-%{version}/profile_merger ./ -export QA_CHECK_RAPTH=0 - %files %{_bindir}/create_gcov %{_bindir}/dump_gcov %{_bindir}/profile_merger %changelog -* Fri Dec 22 2023 zhaozhenyu - 0.19-3.20231228.git0e296280 +* Sun Oct 6 2024 pSomng - 0.30.1-2 +- Type:update +- ID:NA +- SUG:NA +- DESC: backport absel update for rdcycle + +* Tue Aug 6 2024 rfwang07 - 0.30.1-1 +- Type:Update +- ID:NA +- SUG:NA +- DESC:Update AutoFDO toolchain to 0.30.1 + +* Fri Dec 22 2023 zhaozhenyu - 0.19-3.20231228.git0e296280 - Type:Update - ID:NA - SUG:NA