From: Waldemar Brodkorb <wbx@openadk.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] postgresql: fix sparc compile issue
Date: Sun, 9 Aug 2015 11:41:51 +0200 [thread overview]
Message-ID: <20150809094150.GA8066@waldemar-brodkorb.de> (raw)
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>
---
package/postgresql/0001-fix-sparcv8-compile.patch | 38 +++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 package/postgresql/0001-fix-sparcv8-compile.patch
diff --git a/package/postgresql/0001-fix-sparcv8-compile.patch b/package/postgresql/0001-fix-sparcv8-compile.patch
new file mode 100644
index 0000000..cde5434
--- /dev/null
+++ b/package/postgresql/0001-fix-sparcv8-compile.patch
@@ -0,0 +1,38 @@
+The gcc predefines in 4.9.x 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 11:17:48.000000000 +0200
+@@ -420,12 +420,12 @@
+ : "=r"(_res), "+m"(*lock)
+ : "r"(lock)
+ : "memory");
+-#if defined(__sparcv7)
++#if defined(__sparc_v7__)
+ /*
+ * No stbar or membar available, luckily no actually produced hardware
+ * requires a barrier.
+ */
+-#elif defined(__sparcv8)
++#elif 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(__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(__sparc_v8__)
+ /* stbar is available (and required for both PSO, RMO), membar isn't */
+ #define S_UNLOCK(lock) \
+ do \
--
1.7.10.4
next reply other threads:[~2015-08-09 9:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 9:41 Waldemar Brodkorb [this message]
2015-08-09 14:54 ` [Buildroot] [PATCH] postgresql: fix sparc compile issue Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150809094150.GA8066@waldemar-brodkorb.de \
--to=wbx@openadk.org \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox