diff --git a/nspr-4.35-sw8a.patch b/nspr-4.35-sw8a.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1c8690c0b48acea1fbc83eab1b1aaa97527d233 --- /dev/null +++ b/nspr-4.35-sw8a.patch @@ -0,0 +1,159 @@ +diff -uNar nspr-4.35.org/nspr/pr/include/md/_linux.h nspr-4.35.new/nspr/pr/include/md/_linux.h +--- nspr-4.35.org/nspr/pr/include/md/_linux.h 2024-04-17 15:26:54.283473604 +0800 ++++ nspr-4.35.new/nspr/pr/include/md/_linux.h 2024-04-17 15:26:24.460193716 +0800 +@@ -231,16 +231,13 @@ + #define _MD_INIT_ATOMIC() + #define _MD_ATOMIC_ADD(ptr, i) ({ \ + PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " addw %[ret], %[inc], %[tmp] \n" \ + " addw %[ret], %[inc], %[ret] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -248,7 +245,6 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r" (__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : [inc] "Ir" (i), "m" (*ptr)); \ + __atomic_ret; \ +@@ -256,16 +252,13 @@ + #define _MD_ATOMIC_INCREMENT(ptr) _MD_ATOMIC_ADD(ptr, 1) + #define _MD_ATOMIC_DECREMENT(ptr) ({ \ + PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " subw %[ret], 1, %[tmp] \n" \ + " subw %[ret], 1, %[ret] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -273,22 +266,18 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r" (__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : "m" (*ptr)); \ + __atomic_ret; \ + }) + #define _MD_ATOMIC_SET(ptr, n) ({ \ + PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " mov %[newval], %[tmp] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -296,7 +285,6 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r"(__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : [newval] "Ir" (n), "m" (*ptr)); \ + __atomic_ret; \ +diff -uNar nspr-4.35.org/nspr/pr/include/md/_linux.h.gcc-atomics nspr-4.35.new/nspr/pr/include/md/_linux.h.gcc-atomics +--- nspr-4.35.org/nspr/pr/include/md/_linux.h.gcc-atomics 2024-04-17 15:26:54.283473604 +0800 ++++ nspr-4.35.new/nspr/pr/include/md/_linux.h.gcc-atomics 2024-04-17 15:24:45.534948379 +0800 +@@ -209,16 +209,13 @@ + #define _MD_INIT_ATOMIC() + #define _MD_ATOMIC_ADD(ptr, i) ({ \ + PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " addw %[ret], %[inc], %[tmp] \n" \ + " addw %[ret], %[inc], %[ret] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -226,7 +223,6 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r" (__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : [inc] "Ir" (i), "m" (*ptr)); \ + __atomic_ret; \ +@@ -234,16 +230,13 @@ + #define _MD_ATOMIC_INCREMENT(ptr) _MD_ATOMIC_ADD(ptr, 1) + #define _MD_ATOMIC_DECREMENT(ptr) ({ \ + PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " subw %[ret], 1, %[tmp] \n" \ + " subw %[ret], 1, %[ret] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -251,22 +244,18 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r" (__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : "m" (*ptr)); \ + __atomic_ret; \ + }) + #define _MD_ATOMIC_SET(ptr, n) ({ \ +- PRInt32 __atomic_tmp, __atomic_ret; \ +- PRInt32 __atomic_tmp1, __atomic_tmp2; \ ++ PRInt32 __atomic_tmp, __atomic_ret; \ ++ PRInt32 __atomic_tmp1; \ + __asm__ __volatile__( \ + "1: ldi %[tmp1],%[val] \n" \ +- " ldi %[tmp2],1 \n" \ + " lldw %[ret], 0(%[tmp1]) \n" \ +- " wr_f %[tmp2] \n" \ + " mov %[newval], %[tmp] \n" \ + " lstw %[tmp], 0(%[tmp1]) \n" \ +- " rd_f %[tmp] \n" \ + " beq %[tmp], 2f \n" \ + ".subsection 2 \n" \ + "2: br 1b \n" \ +@@ -274,7 +263,6 @@ + : [ret] "=&r" (__atomic_ret), \ + [tmp] "=&r"(__atomic_tmp), \ + [tmp1] "=&r" (__atomic_tmp1), \ +- [tmp2] "=&r" (__atomic_tmp2), \ + [val] "=m" (*ptr) \ + : [newval] "Ir" (n), "m" (*ptr)); \ + __atomic_ret; \ diff --git a/nspr.spec b/nspr.spec index 21b71ae7f20e8309812a6d510b85d51dd3692511..a66edff704b0aae15de8f7b0468a9eef490b516d 100644 --- a/nspr.spec +++ b/nspr.spec @@ -1,5 +1,5 @@ %global nspr_version 4.35.0 -%define anolis_release .0.2 +%define anolis_release .0.3 # The upstream omits the trailing ".0", while we need it for # consistency with the pkg-config version: @@ -32,6 +32,7 @@ Patch1000: 1000-nspr-anolis-support-loongarch64-build.patch Patch10: nspr-4.34-fix-coverity-loop-issue.patch Patch11: nspr-4.34-server-passive.patch Patch1001: nspr-4.34-sw.patch +Patch1002: nspr-4.35-sw8a.patch %description NSPR provides platform independence for non-GUI operating system @@ -70,6 +71,7 @@ pushd nspr popd %patch1000 -p1 %patch1001 -p1 +%patch1002 -p1 %build %define _configure ./nspr/configure %configure \ @@ -161,6 +163,9 @@ done %{_mandir}/man*/* %changelog +* Wed Apr 17 2024 wxiat - 4.35.0-1.0.3 +- delete wr_f and rd_f + * Thu Mar 21 2024 wxiat - 4.35.0-1.0.2 - cherry-pick `add sw patch #ff50ad5468b46ef4b285a5f2e2e507730d9b0e5c`.