spec: split aarch64 patch to allow build for %upgrade == 0

Version: 9.2.4-6
This commit is contained in:
Pavel Raiskup 2013-07-24 14:15:40 +02:00
parent 44506bd77e
commit 9d28c85075
3 changed files with 49 additions and 43 deletions

View File

@ -0,0 +1,34 @@
diff --git a/postgresql-9.1.9/src/include/storage/s_lock.h b/postgresql-9.1.9/src/include/storage/s_lock.h
index 987fb9c..1ba718c 100644
--- a/postgresql-9.1.9/src/include/storage/s_lock.h
+++ b/postgresql-9.1.9/src/include/storage/s_lock.h
@@ -296,6 +296,29 @@ tas(volatile slock_t *lock)
#endif /* __arm__ */
+/*
+ * On ARM64, we use __sync_lock_test_and_set(int *, int) if available.
+ */
+#if defined(__aarch64__) || defined(__aarch64)
+#ifdef HAVE_GCC_INT_ATOMICS
+#define HAS_TEST_AND_SET
+
+#define TAS(lock) tas(lock)
+
+typedef int slock_t;
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+ return __sync_lock_test_and_set(lock, 1);
+}
+
+#define S_UNLOCK(lock) __sync_lock_release(lock)
+
+#endif /* HAVE_GCC_INT_ATOMICS */
+#endif /* __aarch64__ */
+
+
/* S/390 and S/390x Linux (32- and 64-bit zSeries) */
#if defined(__s390__) || defined(__s390x__)
#define HAS_TEST_AND_SET

View File

@ -1,37 +1,3 @@
diff --git a/postgresql-9.1.9/src/include/storage/s_lock.h b/postgresql-9.1.9/src/include/storage/s_lock.h
index 987fb9c..1ba718c 100644
--- a/postgresql-9.1.9/src/include/storage/s_lock.h
+++ b/postgresql-9.1.9/src/include/storage/s_lock.h
@@ -296,6 +296,29 @@ tas(volatile slock_t *lock)
#endif /* __arm__ */
+/*
+ * On ARM64, we use __sync_lock_test_and_set(int *, int) if available.
+ */
+#if defined(__aarch64__) || defined(__aarch64)
+#ifdef HAVE_GCC_INT_ATOMICS
+#define HAS_TEST_AND_SET
+
+#define TAS(lock) tas(lock)
+
+typedef int slock_t;
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+ return __sync_lock_test_and_set(lock, 1);
+}
+
+#define S_UNLOCK(lock) __sync_lock_release(lock)
+
+#endif /* HAVE_GCC_INT_ATOMICS */
+#endif /* __aarch64__ */
+
+
/* S/390 and S/390x Linux (32- and 64-bit zSeries) */
#if defined(__s390__) || defined(__s390x__)
#define HAS_TEST_AND_SET
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index d4a783f..29124b1 100644
--- a/src/include/storage/s_lock.h

View File

@ -58,7 +58,7 @@ Summary: PostgreSQL client programs
Name: postgresql
%global majorversion 9.2
Version: 9.2.4
Release: 5%{?dist}
Release: 6%{?dist}
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
# recognizes it as an independent license, so we do as well.
@ -103,11 +103,6 @@ Patch4: postgresql-config-comment.patch
Patch5: postgresql-multi-sockets.patch
Patch6: postgresql-var-run-socket.patch
# Add support for atomic operations TAS/S_UNLOCK in aarch64.
# ~> upstream (612ecf311b)
# ~> #970661
Patch7: postgresql-9.2.4-aarch64-atomic.patch
# Comments for these patches are in the patch files.
Patch8: postgresql-man.patch
@ -115,6 +110,12 @@ Patch8: postgresql-man.patch
# ~> upstream (035a5e1e8c34)
Patch9: postgresql-9.2.4-perl-5.18.patch
# Add support for atomic operations TAS/S_UNLOCK in aarch64.
# ~> upstream (612ecf311b)
# ~> #970661
Patch10: postgresql-9.2.4-aarch64-atomic.patch
Patch11: postgresql-9.2.4-aarch64-atomic-upgrade.patch
BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk
BuildRequires: perl(ExtUtils::Embed), perl-devel
BuildRequires: readline-devel zlib-devel
@ -343,6 +344,7 @@ benchmarks.
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
# We used to run autoconf here, but there's no longer any real need to,
# since Postgres ships with a reasonably modern configure script.
@ -360,10 +362,11 @@ tar xfj %{SOURCE3}
# (and also see the ppc64p7 hack above)
cp -p config/config.guess postgresql-%{prevversion}/config/config.guess
cp -p config/config.sub postgresql-%{prevversion}/config/config.sub
%endif
# the %%{SOURCE3} must be unpacked before this patch is applied
%patch7 -p1 -b .atomic-aarch64
pushd postgresql-%{prevversion}
%patch11 -p2
popd
%endif
# remove .gitignore files to ensure none get into the RPMs (bug #642210)
find . -type f -name .gitignore | xargs rm
@ -1114,6 +1117,9 @@ fi
%endif
%changelog
* Wed Jul 24 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.4-6
- split aarch64 patch to allow build without postgresql-upgrade
* Tue Jul 23 2013 Pavel Raiskup <praiskup@redhat.com> - 9.2.4-5
- fix testsuite to allow build against Perl 5.18