Compare commits

..

No commits in common. "f5c5dd8f236e9966753f008228be532b454b3ab1" and "26ceb588378633554db038b8375dd458e2cae445" have entirely different histories.

5 changed files with 45 additions and 82 deletions

View File

@ -1,21 +1,7 @@
From 7473a08ba5d72c164dafd18f5d24204b650273dd Mon Sep 17 00:00:00 2001 diff -Naur libatomic_ops-7.6.12.org/src/Makefile.am libatomic_ops-7.6.12.sw/src/Makefile.am
From: li weigang <weigangli99@gmail.com> --- libatomic_ops-7.6.12.org/src/Makefile.am 2022-02-26 02:35:27.760000000 +0000
Date: Wed, 1 Nov 2023 14:38:23 +0800 +++ libatomic_ops-7.6.12.sw/src/Makefile.am 2022-02-26 02:38:49.230000000 +0000
Subject: [PATCH] add sw_64 support @@ -81,6 +81,7 @@
---
src/Makefile.am | 1 +
src/atomic_ops.h | 2 +
src/atomic_ops/sysdeps/gcc/sw_64.h | 70 ++++++++++++++++++++++++++++++
src/atomic_ops_stack.c | 2 +-
4 files changed, 74 insertions(+), 1 deletion(-)
create mode 100644 src/atomic_ops/sysdeps/gcc/sw_64.h
diff --git a/src/Makefile.am b/src/Makefile.am
index e71b67c..334d497 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,6 +85,7 @@ nobase_private_HEADERS = atomic_ops/ao_version.h \
\ \
atomic_ops/sysdeps/gcc/aarch64.h \ atomic_ops/sysdeps/gcc/aarch64.h \
atomic_ops/sysdeps/gcc/alpha.h \ atomic_ops/sysdeps/gcc/alpha.h \
@ -23,24 +9,9 @@ index e71b67c..334d497 100644
atomic_ops/sysdeps/gcc/arm.h \ atomic_ops/sysdeps/gcc/arm.h \
atomic_ops/sysdeps/gcc/avr32.h \ atomic_ops/sysdeps/gcc/avr32.h \
atomic_ops/sysdeps/gcc/cris.h \ atomic_ops/sysdeps/gcc/cris.h \
diff --git a/src/atomic_ops.h b/src/atomic_ops.h diff -Naur libatomic_ops-7.6.12.org/src/atomic_ops/sysdeps/gcc/sw_64.h libatomic_ops-7.6.12.sw/src/atomic_ops/sysdeps/gcc/sw_64.h
index b341e53..edba1c2 100644 --- libatomic_ops-7.6.12.org/src/atomic_ops/sysdeps/gcc/sw_64.h 1970-01-01 00:00:00.000000000 +0000
--- a/src/atomic_ops.h +++ libatomic_ops-7.6.12.sw/src/atomic_ops/sysdeps/gcc/sw_64.h 2022-02-26 02:41:18.020000000 +0000
+++ b/src/atomic_ops.h
@@ -348,6 +348,8 @@
# elif defined(__hppa__)
# include "atomic_ops/sysdeps/gcc/hppa.h"
# define AO_CAN_EMUL_CAS
+# elif defined(__sw_64__)
+# include "atomic_ops/sysdeps/gcc/sw_64.h"
# elif defined(__alpha__)
# include "atomic_ops/sysdeps/gcc/alpha.h"
# define AO_GENERALIZE_TWICE
diff --git a/src/atomic_ops/sysdeps/gcc/sw_64.h b/src/atomic_ops/sysdeps/gcc/sw_64.h
new file mode 100644
index 0000000..fd196cf
--- /dev/null
+++ b/src/atomic_ops/sysdeps/gcc/sw_64.h
@@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
+/* +/*
+ * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. + * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
@ -112,19 +83,36 @@ index 0000000..fd196cf
+#define AO_HAVE_compare_and_swap +#define AO_HAVE_compare_and_swap
+ +
+/* TODO: implement AO_fetch_compare_and_swap */ +/* TODO: implement AO_fetch_compare_and_swap */
diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c diff -Naur libatomic_ops-7.6.12.org/src/atomic_ops.h libatomic_ops-7.6.12.sw/src/atomic_ops.h
index ec8ace4..03638be 100644 --- libatomic_ops-7.6.12.org/src/atomic_ops.h 2022-02-26 02:35:27.770000000 +0000
--- a/src/atomic_ops_stack.c +++ libatomic_ops-7.6.12.sw/src/atomic_ops.h 2022-02-26 02:36:05.400000000 +0000
+++ b/src/atomic_ops_stack.c @@ -310,6 +310,8 @@
@@ -81,7 +81,7 @@ AO_API AO_uintptr_t *AO_stack_next_ptr(AO_uintptr_t next) # elif defined(__hppa__)
} /* extern "C" */ # include "atomic_ops/sysdeps/gcc/hppa.h"
# endif # define AO_CAN_EMUL_CAS
+# elif defined(__sw_64__)
+# include "atomic_ops/sysdeps/gcc/sw_64.h"
# elif defined(__alpha__)
# include "atomic_ops/sysdeps/gcc/alpha.h"
# define AO_GENERALIZE_TWICE
diff -Naur libatomic_ops-7.6.12.org/src/atomic_ops_stack.c libatomic_ops-7.6.12.sw/src/atomic_ops_stack.c
--- libatomic_ops-7.6.12.org/src/atomic_ops_stack.c 2022-02-26 02:35:27.760000000 +0000
+++ libatomic_ops-7.6.12.sw/src/atomic_ops_stack.c 2022-02-26 02:38:24.530000000 +0000
@@ -180,7 +180,7 @@
/* We need to make sure that first is still the first entry on the */
/* list. Otherwise it's possible that a reinsertion of it was */
/* already started before we added the black list entry. */
-# if defined(__alpha__) && (__GNUC__ == 4) -# if defined(__alpha__) && (__GNUC__ == 4)
+# if (defined(__alpha__) || defined(__sw_64__)) && (__GNUC__ == 4) +# if (defined(__alpha__) || defined(__sw_64__)) && (__GNUC__ == 4)
/* Workaround __builtin_expect bug found in */ if (first != AO_load_acquire(list))
/* gcc-4.6.3/alpha causing test_stack failure. */ /* Workaround __builtin_expect bug found in */
# undef AO_EXPECT_FALSE /* gcc-4.6.3/alpha causing test_stack failure. */
-- @@ -196,7 +196,7 @@
2.20.1 }
first_ptr = AO_REAL_NEXT_PTR(first);
next = AO_load_next(first_ptr);
-# if defined(__alpha__) && (__GNUC__ == 4)
+# if (defined(__alpha__) || defined(__sw_64__)) && (__GNUC__ == 4)
if (!AO_compare_and_swap_release(list, first, next))
# else
if (AO_EXPECT_FALSE(!AO_compare_and_swap_release(list, first, next)))

BIN
libatomic_ops-7.6.12.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,11 +1,11 @@
Name: libatomic_ops Name: libatomic_ops
Version: 7.8.2 Version: 7.6.12
Release: 3 Release: 2
Summary: Atomic memory update operations Summary: Atomic memory update operations
License: GPLv2 License: GPLv2
URL: https://github.com/ivmai/libatomic_ops/ URL: https://github.com/ivmai/libatomic_ops/
Source0: http://github.com/ivmai/libatomic_ops/releases/download/v%{version}/libatomic_ops-%{version}.tar.gz Source0: http://github.com/ivmai/libatomic_ops/releases/download/v%{version}/libatomic_ops-%{version}.tar.gz
Patch1: 0001-add-sw_64-support.patch Patch1: libatomic_ops-7.6.12-sw.patch
BuildRequires: gcc BuildRequires: gcc
@ -35,21 +35,19 @@ The devel for %{name}
%make_install %make_install
%check %check
export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs/ #%make_build check
%make_build check
%files %files
%license COPYING %license COPYING
%license LICENSE %license doc/LICENSING.txt
%{_libdir}/libatomic_ops.so.1* %{_libdir}/libatomic_ops.so.1*
%{_libdir}/libatomic_ops_gpl.so.1* %{_libdir}/libatomic_ops_gpl.so.1*
%exclude %{_libdir}/*.la %exclude %{_libdir}/*.la
%exclude %{_docdir}/libatomic_ops/{COPYING,README*,*.txt} %exclude %{_docdir}/libatomic_ops/{COPYING,README*,*.txt}
%exclude %{_docdir}/libatomic_ops/{AUTHORS,ChangeLog,LICENSE}
%files devel %files devel
%doc README* %doc doc/README*
%{_includedir}/atomic_ops.h %{_includedir}/atomic_ops.h
%{_includedir}/atomic_ops_malloc.h %{_includedir}/atomic_ops_malloc.h
%{_includedir}/atomic_ops_stack.h %{_includedir}/atomic_ops_stack.h
@ -64,29 +62,6 @@ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs/
%doc AUTHORS ChangeLog README.md %doc AUTHORS ChangeLog README.md
%changelog %changelog
* Tue Jul 09 2024 wangxiao <wangxiao184@h-partners.com> - 7.8.2-3
- enable make check
* Mon Feb 26 2024 laokz <zhangkai@iscas.ac.cn> - 7.8.2-2
- fix patch error
* Thu Feb 08 2024 Weifeng Su <suweifeng1@huawei.com> - 7.8.2-1
- upgrade to version 7.8.2:
-Resolve warning in GCC11
-Fix comparison warning in add_chunk_as
-Address Clang 16 AO_pt_lock issue
-Handle Mingw64-GCC _atomic_errors
-Fix linker errors in OpenBSD build
-Update get_chunk for mmap placement
-Correct typos in names/comments
-Update CMake version to 3.5
* Wed Nov 01 2023 liweigang <weigangli99@gmail.com> - 7.8.0-1
- update to version 7.8.0
* Tue Oct 18 2022 dillon chen <dillon.chen@gmail.com> - 7.6.14-1
- update to 7.6.14
* Thu Jul 28 2022 wuzx<wuzx1226@qq.com> - 7.6.12-2 * Thu Jul 28 2022 wuzx<wuzx1226@qq.com> - 7.6.12-2
- add sw64 patch - add sw64 patch

View File

@ -1,5 +1,5 @@
version_control: github version_control: github
src_repo: ivmai/libatomic_ops src_repo: ivmai/libatomic_ops
tag_prefix: ^v tag_prefix: ^v
separator: . seperator: .