pg.ddx.io  pgsql-ports@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Pitt <martin@piware.de>
To: pgsql-ports@postgresql.org
Subject: Re: gcc 4.0 build failures on m68k, mips, and mipsel
Date: Thu, 25 Aug 2005 09:43:12 +0200
Message-ID: <20050825074312.GA8461@piware.de> (raw)
In-Reply-To: <2290.1124565042@sss.pgh.pa.us>
References: <20050724155941.GA27638@piware.de>
	<20050820154044.GA7412@piware.de>
	<2290.1124565042@sss.pgh.pa.us>

Hi! 

Tom Lane [2005-08-20 15:10 -0400]:
> Martin Pitt <martin@piware.de> writes:
> > However, Thiemo Seufer dealt with this and created a proper tas()
> > function for PostgreSQL on mips, which also works with gcc 4. Of
> > course this is much better, so I applied his patch in Debian.
> > I attach the patch. Do you consider applying it upstream?
> 
> Hm, does this patch actually compile as-is?  I'd think you'd need to
> have the MIPS definition of slock_t placed earlier than the assembly
> code fragment.

Sorry, I got the patch against 7.4 and I couldn't check it against 8.0
I fixed it for 8.0, and the new packages have finally built
successfully on mips:

http://buildd.debian.org/fetch.php?&pkg=postgresql-7.4&ver=1%3A7.4.8-17&arch=mips&st...
http://buildd.debian.org/fetch.php?&pkg=postgresql-8.0&ver=8.0.3-14&arch=mips&stamp=...

I attach the updated patch against 8.0.

Sorry for the confusion, and thanks!

Martin
-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachments:

14-mips-gcc4.patch (text/plain, 1.6K) download diff -ruN postgresql-8.0.3-old/src/backend/storage/lmgr/s_lock.c postgresql-8.0.3/src/backend/storage/lmgr/s_lock.c --- postgresql-8.0.3-old/src/backend/storage/lmgr/s_lock.c 2004-12-31 23:01:05.000000000 +0100 +++ postgresql-8.0.3/src/backend/storage/lmgr/s_lock.c 2005-08-23 19:30:19.000000000 +0200 @@ -172,7 +172,7 @@ #endif /* __m68k__ */ -#if defined(__mips__) && !defined(__sgi) +#if defined(__mips__) && !defined(__sgi) && !defined(__linux__) static void tas_dummy() { diff -ruN postgresql-8.0.3-old/src/include/storage/s_lock.h postgresql-8.0.3/src/include/storage/s_lock.h --- postgresql-8.0.3-old/src/include/storage/s_lock.h 2005-08-23 19:30:18.000000000 +0200 +++ postgresql-8.0.3/src/include/storage/s_lock.h 2005-08-23 19:31:29.000000000 +0200 @@ -445,7 +445,32 @@ #define HAS_TEST_AND_SET typedef unsigned int slock_t; -#endif + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register volatile slock_t *__l = lock; + register int __r; + + __asm__ __volatile__( + " .set push \n" + " .set mips2 \n" + " .set noreorder \n" + " .set nomacro \n" + "1: ll %0, %1 \n" + " bne %0, $0, 1f \n" + " xori %0, 1 \n" + " sc %0, %1 \n" + " beq %0, $0, 1b \n" + " sync \n" + "1: .set pop " + : "=&r" (__r), "+R" (*__l)); + return __r; +} + +#endif /* mips */ #endif /* __GNUC__ */
signature.asc (application/pgp-signature, 188B) download

view thread (6+ messages)  latest in thread

Message-ID: <20050825074312.GA8461@piware.de>
Permalink:  ../20050825074312.GA8461@piware.de/
Also on:    postgresql.org/message-id/20050825074312.GA8461@piware.de

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-ports@postgresql.org
  Cc: martin@piware.de
  Subject: Re: gcc 4.0 build failures on m68k, mips, and mipsel
  In-Reply-To: <20050825074312.GA8461@piware.de>
  References: <20050724155941.GA27638@piware.de> <20050820154044.GA7412@piware.de> <2290.1124565042@sss.pgh.pa.us> <20050825074312.GA8461@piware.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox