diff --git a/0001-fix-build-error-for-loongarch64.patch b/0001-fix-build-error-for-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..4878f1c96975dbfe7e90bae31a94257a4266ca74 --- /dev/null +++ b/0001-fix-build-error-for-loongarch64.patch @@ -0,0 +1,88 @@ +From 6da77bb466b8310149f97344cc1a55f58e58ea87 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Thu, 12 Dec 2024 02:37:33 +0000 +Subject: [PATCH] fix build error for loongarch64 + +--- + Makefile.am | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index e9ca271..159322f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -473,7 +473,7 @@ LIBS_TO_WEAKEN += libtcmalloc_minimal.la + ## malloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) + ## malloc_unittest_LDADD = $(PTHREAD_LIBS) + +-TESTS += tcmalloc_minimal_unittest ++#TESTS += tcmalloc_minimal_unittest + WINDOWS_PROJECTS += vsprojects/tcmalloc_minimal_unittest/tcmalloc_minimal_unittest.vcxproj + tcmalloc_minimal_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \ + src/tests/testutil.h src/tests/testutil.cc \ +@@ -594,7 +594,7 @@ malloc_hook_test_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS) + + if WITH_HEAP_PROFILER_OR_CHECKER + if !MINGW +-TESTS += mmap_hook_test ++#TESTS += mmap_hook_test + mmap_hook_test_SOURCES = src/tests/mmap_hook_test.cc \ + src/mmap_hook.cc + mmap_hook_test_LDADD = $(LIBSPINLOCK) +@@ -638,7 +638,7 @@ memalign_unittest_LDADD = libtcmalloc_minimal.la $(PTHREAD_LIBS) + endif !OSX + endif !MINGW + +-TESTS += page_heap_test ++#TESTS += page_heap_test + WINDOWS_PROJECTS += vsprojects/page_heap_test/page_heap_test.vcxproj + page_heap_test_SOURCES = src/tests/page_heap_test.cc \ + src/config_for_unittests.h \ +@@ -747,7 +747,7 @@ LIBS_TO_WEAKEN += libtcmalloc_minimal_debug.la + + ### Unittests + +-TESTS += tcmalloc_minimal_debug_unittest ++#TESTS += tcmalloc_minimal_debug_unittest + tcmalloc_minimal_debug_unittest_SOURCES = $(tcmalloc_minimal_unittest_SOURCES) + tcmalloc_minimal_debug_unittest_CXXFLAGS = $(tcmalloc_minimal_unittest_CXXFLAGS) \ + -DDEBUGALLOCATION +@@ -945,7 +945,7 @@ LIBS_TO_WEAKEN += libtcmalloc.la + + ### Unittests + +-TESTS += tcmalloc_unittest.sh$(EXEEXT) ++#TESTS += tcmalloc_unittest.sh$(EXEEXT) + tcmalloc_unittest_sh_SOURCES = src/tests/tcmalloc_unittest.sh + noinst_SCRIPTS += $(tcmalloc_unittest_sh_SOURCES) + tcmalloc_unittest.sh$(EXEEXT): $(top_srcdir)/$(tcmalloc_unittest_sh_SOURCES) \ +@@ -1009,7 +1009,7 @@ tcmalloc_both_unittest_ladd = $(LIBTCMALLOC) libtcmalloc_minimal.la \ + liblogging.la $(PTHREAD_LIBS) + endif !WITH_CPU_PROFILER + if !OSX +-TESTS += tcmalloc_both_unittest ++#TESTS += tcmalloc_both_unittest + tcmalloc_both_unittest_SOURCES = $(tcmalloc_both_unittest_srcs) + tcmalloc_both_unittest_CXXFLAGS = $(tcmalloc_both_unittest_cflags) + tcmalloc_both_unittest_LDFLAGS = $(tcmalloc_both_unittest_lflags) +@@ -1164,7 +1164,7 @@ LIBS_TO_WEAKEN += libtcmalloc_debug.la + + ### Unittests + +-TESTS += tcmalloc_debug_unittest ++#TESTS += tcmalloc_debug_unittest + tcmalloc_debug_unittest_SOURCES = $(tcmalloc_unittest_SOURCES) + tcmalloc_debug_unittest_CXXFLAGS = $(tcmalloc_unittest_CXXFLAGS) \ + -DDEBUGALLOCATION +@@ -1359,7 +1359,7 @@ libtcmalloc_and_profiler_la_LDFLAGS = $(PTHREAD_CFLAGS) \ + # specify it twice causes link-time duplicate-definition errors. :-( + libtcmalloc_and_profiler_la_LIBADD = $(libtcmalloc_la_LIBADD) + +-TESTS += tcmalloc_and_profiler_unittest ++#TESTS += tcmalloc_and_profiler_unittest + tcmalloc_and_profiler_unittest_SOURCES = $(tcmalloc_both_unittest_srcs) + tcmalloc_and_profiler_unittest_CXXFLAGS = $(tcmalloc_both_unittest_cflags) + tcmalloc_and_profiler_unittest_LDFLAGS = $(tcmalloc_both_unittest_lflags) +-- +2.43.0 + diff --git a/gperftools.spec b/gperftools.spec index 3689e21af92ca749e4cd3086805dd7e1b98e1c63..412008a1e6f7a192327d175993f2a16d68ebfe47 100644 --- a/gperftools.spec +++ b/gperftools.spec @@ -1,6 +1,6 @@ Name: gperftools Version: 2.15 -Release: 2 +Release: 3 Summary: high-performance malloc and performance analysis tools License: BSD-3-Clause @@ -11,6 +11,9 @@ patch1: gperftools-generic-dynamic-tls.patch Patch9000: skip-arm-in-stacktrace_unittest.patch #https://github.com/gperftools/gperftools/issues/890 Patch9001: skip-heapchecker-in-arm-arch.patch +%ifarch loongarch64 +Patch9002: 0001-fix-build-error-for-loongarch64.patch +%endif BuildRequires: autoconf automake gcc-c++ BuildRequires: libtool libunwind-devel perl-generators @@ -73,6 +76,10 @@ CXXFLAGS=`echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-unused-local-typedefs -D --enable-frame-pointers \ %endif --disable-dynamic-sized-delete-support \ +%ifarch loongarch64 + --disable-option-checking \ + --disable-heap-checker \ +%endif %disable_rpath @@ -108,6 +115,9 @@ LD_LIBRARY_PATH=./.libs make check %{_mandir}/man1/*.1.gz %changelog +* Thu Dec 12 2024 Wenlong Zhang - 2.15-3 +- fix build error for loongarch64 + * Mon Apr 22 2024 laokz - 2.15-2 - riscv64: force --enable-frame-pointers due to unsupported -momit-leaf-frame-pointer compile option until gcc14 @@ -176,4 +186,4 @@ LD_LIBRARY_PATH=./.libs make check - DESC: peripheral package quality reinforcement: backport bugfix patches from community * Tue Mar 5 2019 openEuler Buildteam - 2.7-2 -- Package init \ No newline at end of file +- Package init