From c296d482ae78ed0eed5bfbb97a6bb777f35fa618 Mon Sep 17 00:00:00 2001 From: yanying <201250106@smail.nju.edu.cn> Date: Sat, 7 Sep 2024 15:16:13 +0800 Subject: [PATCH] Fix clang test fail in align_alloc.c - Add attribute to compile test_alignment_errors and test_oom_errors with no optimization if build with clang --- ...Fix-clang-test-fail-in-align_alloc.c.patch | 42 +++++++++++++++++++ jemalloc.spec | 8 +++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-Fix-clang-test-fail-in-align_alloc.c.patch diff --git a/0001-Fix-clang-test-fail-in-align_alloc.c.patch b/0001-Fix-clang-test-fail-in-align_alloc.c.patch new file mode 100644 index 0000000..d532c7f --- /dev/null +++ b/0001-Fix-clang-test-fail-in-align_alloc.c.patch @@ -0,0 +1,42 @@ +From c59c02ff8028cc393a3029ea15cb7591d2bc2d4a Mon Sep 17 00:00:00 2001 +From: yanyir +Date: Sat, 7 Sep 2024 16:07:37 +0800 +Subject: [PATCH] Fix clang test fail in align_alloc.c - Add attribute to + compile test_alignment_errors and test_oom_errors with no optimization if + build with clang + +--- + test/integration/aligned_alloc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/test/integration/aligned_alloc.c b/test/integration/aligned_alloc.c +index 41ec4fef..eb6fa0d6 100644 +--- a/test/integration/aligned_alloc.c ++++ b/test/integration/aligned_alloc.c +@@ -13,7 +13,10 @@ purge(void) { + "Unexpected mallctl error"); + } + +-TEST_BEGIN(test_alignment_errors) { ++#if __clang__ ++__attribute__((optnone)) ++#endif ++TEST_BEGIN(test_alignment_errors) { + size_t alignment; + void *p; + +@@ -45,7 +48,10 @@ TEST_END + JEMALLOC_DIAGNOSTIC_PUSH + JEMALLOC_DIAGNOSTIC_IGNORE_ALLOC_SIZE_LARGER_THAN + +-TEST_BEGIN(test_oom_errors) { ++#if __clang__ ++__attribute__((optnone)) ++#endif ++TEST_BEGIN(test_oom_errors) { + size_t alignment, size; + void *p; + +-- +2.41.0.windows.1 + diff --git a/jemalloc.spec b/jemalloc.spec index fe446f8..0a5f4f0 100644 --- a/jemalloc.spec +++ b/jemalloc.spec @@ -12,12 +12,13 @@ Name: jemalloc Version: 5.3.0 -Release: 1 +Release: 2 Summary: General-purpose scalable concurrent malloc implementation License: BSD-2-Clause URL: http://www.canonware.com/jemalloc/ Source0: https://github.com/jemalloc/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2 +Patch0001: 0001-Fix-clang-test-fail-in-align_alloc.c.patch BuildRequires: perl-generators gcc /usr/bin/xsltproc @@ -38,7 +39,7 @@ Summary: help for jemalloc. The help package contains manual pages and other related files for jemalloc. %prep -%setup -q +%autosetup -p1 %build export LDFLAGS="%{?__global_ldflags} -lrt" @@ -80,6 +81,9 @@ make check %{_mandir}/man3/jemalloc.3* %changelog +* Sat Sep 07 2024 yanying <201250106@smail.nju.edu.cn> - 5.3.0-2 +- Fix clang test fail in align_alloc.c + * Wed Mar 01 2023 li-long315 - 5.3.0-1 - Upgrade to 5.3.0 -- Gitee