[gc] libatomic_ops: use -DAO_USE_PTHREAD_DEFS on ARMv5
Rex Dieter
rdieter at fedoraproject.org
Fri Mar 2 20:22:09 UTC 2012
commit 73b5e99c72ab0dd1248cc8326139893cfd20408d
Author: Rex Dieter <rdieter at fedoraproject.org>
Date: Fri Mar 2 14:22:09 2012 -0600
libatomic_ops: use -DAO_USE_PTHREAD_DEFS on ARMv5
gc-7.2alpha6-libatomic_ops_arm5.patch | 49 +++++++++++++++++++++++++++++++++
gc.spec | 14 +++++++--
2 files changed, 60 insertions(+), 3 deletions(-)
---
diff --git a/gc-7.2alpha6-libatomic_ops_arm5.patch b/gc-7.2alpha6-libatomic_ops_arm5.patch
new file mode 100644
index 0000000..84e9bba
--- /dev/null
+++ b/gc-7.2alpha6-libatomic_ops_arm5.patch
@@ -0,0 +1,49 @@
+From 2a28e66d5603dae37031ff8105fdf6acb649b46d Mon Sep 17 00:00:00 2001
+From: Niels de Vos <devos at fedoraproject.org>
+Date: Fri, 2 Mar 2012 21:06:58 +0100
+Subject: [PATCH] Fallback to pthread implementation on ARMv5 and earlier
+
+ARMv6 and newer has optimized code, earlier versions need to fall back to
+the pthread implementation.
+
+Signed-off-by: Niels de Vos <devos at fedoraproject.org>
+---
+ src/atomic_ops.h | 18 ++++++++++++------
+ 1 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/atomic_ops.h b/src/atomic_ops.h
+index 3f9000d..af09501 100644
+--- a/src/atomic_ops.h
++++ b/src/atomic_ops.h
+@@ -193,16 +193,22 @@
+ # define AO_compiler_barrier() asm("")
+ #endif
+
+-#if defined(AO_USE_PTHREAD_DEFS)
+-# include "atomic_ops/sysdeps/generic_pthread.h"
+-#endif /* AO_USE_PTHREAD_DEFS */
+-
+ #if (defined(__CC_ARM) || defined(__ARMCC__)) && !defined(__GNUC__) \
+ && !defined(AO_USE_PTHREAD_DEFS)
+-# include "atomic_ops/sysdeps/armcc/arm_v6.h"
+-# define AO_GENERALIZE_TWICE
++# if __TARGET_ARCH_ARM >= 6
++ /* ARMv6 and newer has optimized code, earlier versions */
++ /* need to fall back to the pthread implementation. */
++# include "atomic_ops/sysdeps/armcc/arm_v6.h"
++# define AO_GENERALIZE_TWICE
++# else
++# define AO_USE_PTHREAD_DEFS
++# endif
+ #endif
+
++#if defined(AO_USE_PTHREAD_DEFS)
++# include "atomic_ops/sysdeps/generic_pthread.h"
++#endif /* AO_USE_PTHREAD_DEFS */
++
+ #if defined(__GNUC__) && !defined(AO_USE_PTHREAD_DEFS) \
+ && !defined(__INTEL_COMPILER)
+ # if defined(__i386__)
+--
+1.7.3.4
+
diff --git a/gc.spec b/gc.spec
index cfb3780..62af4a5 100644
--- a/gc.spec
+++ b/gc.spec
@@ -4,7 +4,7 @@
Summary: A garbage collector for C and C++
Name: gc
Version: 7.2
-Release: 0.6.%{pre}%{?dist}
+Release: 0.7.%{pre}%{?dist}
Group: System Environment/Libraries
License: BSD
@@ -13,9 +13,11 @@ Source0: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-%{version}%{?
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
## upstreamable patches
-Patch50: gc-7.1-dup_cpp_headers.patch
+# use AO_USE_PTHREAD_DEFS on ARMv5
+Patch51: gc-7.2alpha6-libatomic_ops_arm5.patch
## upstream patches
+Patch100: gc-7.1-dup_cpp_headers.patch
BuildRequires: automake libtool
BuildRequires: pkgconfig
@@ -52,7 +54,10 @@ that involves minimum overhead across a variety of architectures.
%prep
%setup -q -n gc-%{version}%{?pre}
-%patch50 -p1 -b .dup_cpp_headers
+pushd libatomic_ops
+%patch51 -p1 -b .libatomic_ops_arm5
+popd
+%patch100 -p1 -b .dup_cpp_headers
# refresh auto*/libtool to purge rpaths
rm -f libtool libtool.m4
autoreconf -i -f
@@ -140,6 +145,9 @@ rm -rf %{buildroot}
%changelog
+* Fri Mar 02 2012 Rex Dieter <rdieter at fedoraproject.org> 7.2-0.7.alpha6
+- libatomic_ops: use -DAO_USE_PTHREAD_DEFS on ARMv5
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 7.2-0.6.alpha6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list