From 3540532ca474ec9b6bd23e50aac62306686ee666 Mon Sep 17 00:00:00 2001 From: lilong Date: Mon, 14 Oct 2024 16:12:59 +0800 Subject: [PATCH] add sw_64 support patch --- jemalloc.spec | 9 +++- support-sw_64.patch | 113 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 support-sw_64.patch diff --git a/jemalloc.spec b/jemalloc.spec index e0b82b2..51f06fb 100644 --- a/jemalloc.spec +++ b/jemalloc.spec @@ -12,13 +12,15 @@ Name: jemalloc Version: 5.1.0 -Release: 5 +Release: 6 Summary: General-purpose scalable concurrent malloc implementation License: BSD URL: http://www.canonware.com/jemalloc/ Source0: https://github.com/jemalloc/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2 Patch0: Fix-an-incorrect-assertion.patch - +%ifarch sw_64 +Patch1: support-sw_64.patch +%endif BuildRequires: libxslt perl-generators Requires: %{name}-help = %{version}-%{release} @@ -83,6 +85,9 @@ make check %{_mandir}/man3/jemalloc.3* %changelog +* Mon Oct 14 2024 lilong - 5.1.0-6 +- add sw_64 support patch + * Thu Dec 28 2023 fandehui - 5.1.0-5 - Fix an incorrect assertion. diff --git a/support-sw_64.patch b/support-sw_64.patch new file mode 100644 index 0000000..bfe35bc --- /dev/null +++ b/support-sw_64.patch @@ -0,0 +1,113 @@ +From 3671e76d0521c132f098972cb481236055100e47 Mon Sep 17 00:00:00 2001 +From: root +Date: Sat, 12 Oct 2024 15:51:41 +0800 +Subject: [PATCH] Redflag-enhancement-jemalloc-5.1.0-4-support-sw_64 + +Signed-off-by: root +--- + build-aux/config.guess | 40 +++++++++++++++++++ + build-aux/config.sub | 2 + + .../internal/jemalloc_internal_types.h | 3 ++ + 3 files changed, 45 insertions(+) + +diff --git a/build-aux/config.guess b/build-aux/config.guess +index 2e9ad7f..ff752fe 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -259,6 +259,36 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; ++ sw_64:OSF1:*:*) ++ case $UNAME_RELEASE in ++ *4.0) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ++ ;; ++ *5.*) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ ;; ++ esac ++ # According to Compaq, /usr/sbin/psrinfo has been available on ++ # OSF/1 and Tru64 systems produced since 1995. I hope that ++ # covers most systems running today. This code pipes the CPU ++ # types through head -n 1, so we only detect the type of CPU 0. ++ SW_64_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The sw_64 \(.*\) processor.*$/\1/p' | head -n 1` ++ case "$SW_64_CPU_TYPE" in ++ "SW6A (1621)") ++ UNAME_MACHINE=sw_64sw6a ;; ++ "SW6B (3231)") ++ UNAME_MACHINE=sw_64sw6b ;; ++ esac ++ # A Pn.n version is a patched version. ++ # A Vn.n version is a released version. ++ # A Tn.n version is a released field test version. ++ # A Xn.n version is an unreleased experimental baselevel. ++ # 1.2 uses "1.2" for uname -r. ++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` ++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. ++ exitcode=$? ++ trap '' 0 ++ exit $exitcode ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) +@@ -915,6 +945,15 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ sw_64:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ SW6A) UNAME_MACHINE=sw_64sw6a ;; ++ SW6B) UNAME_MACHINE=sw_64sw6b ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +@@ -1391,6 +1430,7 @@ EOF + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; ++ S*) echo sw_64-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; +diff --git a/build-aux/config.sub b/build-aux/config.sub +index dd2ca93..65e3b71 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -250,6 +250,7 @@ case $basic_machine in + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ ++ | sw_64 | sw_64sw6a | sw_64sw6b \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ +@@ -375,6 +376,7 @@ case $basic_machine in + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ ++ | sw_64 | sw_64sw6a | sw_64sw6b \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ +diff --git a/include/jemalloc/internal/jemalloc_internal_types.h b/include/jemalloc/internal/jemalloc_internal_types.h +index 1b750b1..8bff39a 100644 +--- a/include/jemalloc/internal/jemalloc_internal_types.h ++++ b/include/jemalloc/internal/jemalloc_internal_types.h +@@ -110,6 +110,9 @@ typedef int malloc_cpuid_t; + # ifdef __le32__ + # define LG_QUANTUM 4 + # endif ++# ifdef __sw_64__ ++# define LG_QUANTUM 4 ++# endif + # ifndef LG_QUANTUM + # error "Unknown minimum alignment for architecture; specify via " + "--with-lg-quantum" +-- +2.27.0 -- Gitee