[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#565856: postgresql-8.3: Please support Renesas SH(sh4)



Source: postgresql-8.3
Version: 8.3.9-1
Severity: important
Tags: patch
User: debian-sh4@superh.org
Usertags: sh4
X-Debbugs-CC: debian-superh@lists.debian.org

Hi,

I am now trying to run Debian on Renesas SH(sh4) CPU.
http://buildd.debian-ports.org/status/architecture.php?suite=unstable&a=sh4

postgresql-8.3 FTBFS on SH4.
Because postgresql-8.3 does not support Renesas SH.
http://buildd.debian-ports.org/fetch.php?pkg=postgresql-8.3&arch=sh4&ver=8.3.9-1&stamp=1260870740&file=log&as=raw

-----
xlog.c:5847: warning: type defaults to 'int' in declaration of 'type name'
xlog.c:5980: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:5980: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:5983: error: expected ')' before 'slock_t'
xlog.c:5983: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:5983: warning: type defaults to 'int' in declaration of 'type name'
xlog.c: In function 'pg_current_xlog_location':
xlog.c:6816: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:6816: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:6818: error: expected ')' before 'slock_t'
xlog.c:6818: error: 'XLogCtlData' has no member named 'info_lck'
xlog.c:6818: warning: type defaults to 'int' in declaration of 'type name'
make[5]: *** [xlog.o] Error 1
make[4]: *** [transam-recursive] Error 2
make[3]: *** [access-recursive] Error 2
-----

This problam is same as #548847.
I tested with this patch. Package build and test are good.
I attached patch and build log.

Could you apply this patch?

Best regards,
 Nobuhiro
--- postgresql-8.4-8.4.1/src/include/storage/s_lock.h	2009-01-02 02:24:01.000000000 +0900
+++ postgresql-head/src/include/storage/s_lock.h	2009-09-29 15:06:45.000000000 +0900
@@ -567,6 +567,35 @@
 
 #endif /* __m32r__ */
 
+#if defined(__sh__)				/* Renesas' SuperH */
+#define HAS_TEST_AND_SET
+
+typedef unsigned char slock_t;
+
+#define TAS(lock) tas(lock)
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+	register int _res;
+
+	/*
+	 * This asm is coded as if %0 could be any register, but actually SuperH
+	 * restricts the target of xor-immediate to be R0.  That's handled by
+	 * the "z" constraint on _res.
+	 */
+	__asm__ __volatile__(
+		"	tas.b @%2    \n"
+		"	movt  %0     \n"
+		"	xor   #1,%0  \n"
+:		"=z"(_res), "+m"(*lock)
+:		"r"(lock)
+:		"memory", "t");
+	return _res;
+}
+
+#endif	 /* __sh__ */
+
 
 /* These live in s_lock.c, but only for gcc */
 

Attachment: postgresql-8.3_8.3.9-1_sh4.build.gz
Description: GNU Zip compressed data


Reply to: