summaryrefslogtreecommitdiffstats
path: root/package/postgresql/0002-fix-sparc-compile.patch
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-08-09 20:13:36 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-08-10 15:55:44 +0200
commitb1c6801f1c5dfdf8610d16d8a4cd68d062b44e16 (patch)
tree46bb26c128641deb5202f6443d66e3f3cdef10d1 /package/postgresql/0002-fix-sparc-compile.patch
parent076c508d1b3ac6e68baf9373b05974727a697550 (diff)
downloadbuildroot-b1c6801f1c5dfdf8610d16d8a4cd68d062b44e16.tar.gz
buildroot-b1c6801f1c5dfdf8610d16d8a4cd68d062b44e16.zip
postgresql: fix sparc compile issue
Fixes autobuilder compile error: http://autobuild.buildroot.net/results/f374d3535cf91f139ce80703cd2d0a2be5d3b2b1/ The predefines are wrong: ./output/host/usr/bin/sparc-buildroot-linux-uclibc-gcc -dM -E - </dev/null|grep sparc #define sparc 1 #define __sparc__ 1 #define __sparc 1 #define __sparc_v8__ 1 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/postgresql/0002-fix-sparc-compile.patch')
-rw-r--r--package/postgresql/0002-fix-sparc-compile.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/package/postgresql/0002-fix-sparc-compile.patch b/package/postgresql/0002-fix-sparc-compile.patch
new file mode 100644
index 0000000000..9eec23ab5f
--- /dev/null
+++ b/package/postgresql/0002-fix-sparc-compile.patch
@@ -0,0 +1,38 @@
+The gcc predefines for Linux are __sparc_v8__/__sparc_v7__
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur postgresql-9.4.4.orig/src/include/storage/s_lock.h postgresql-9.4.4/src/include/storage/s_lock.h
+--- postgresql-9.4.4.orig/src/include/storage/s_lock.h 2015-06-09 21:29:38.000000000 +0200
++++ postgresql-9.4.4/src/include/storage/s_lock.h 2015-08-09 19:57:06.000000000 +0200
+@@ -420,12 +420,12 @@
+ : "=r"(_res), "+m"(*lock)
+ : "r"(lock)
+ : "memory");
+-#if defined(__sparcv7)
++#if defined(__sparcv7) || defined(__sparc_v7__)
+ /*
+ * No stbar or membar available, luckily no actually produced hardware
+ * requires a barrier.
+ */
+-#elif defined(__sparcv8)
++#elif defined(__sparcv8) || defined(__sparc_v8__)
+ /* stbar is available (and required for both PSO, RMO), membar isn't */
+ __asm__ __volatile__ ("stbar \n":::"memory");
+ #else
+@@ -438,13 +438,13 @@
+ return (int) _res;
+ }
+
+-#if defined(__sparcv7)
++#if defined(__sparcv7) || defined(__sparc_v7__)
+ /*
+ * No stbar or membar available, luckily no actually produced hardware
+ * requires a barrier.
+ */
+ #define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0)
+-#elif defined(__sparcv8)
++#elif defined(__sparcv8) || defined(__sparc_v8__)
+ /* stbar is available (and required for both PSO, RMO), membar isn't */
+ #define S_UNLOCK(lock) \
+ do \
OpenPOWER on IntegriCloud