pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: wzssyqa@gmail.com
Subject: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
Date: Tue, 11 Jun 2019 04:39:35 +0000
Message-ID: <15844-8f62fe7e163939b3@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15844
Logged by:          Yunqiang Su
Email address:      wzssyqa@gmail.com
PostgreSQL version: 12beta1
Operating system:   Linux
Description:        

MIPS r6 changes the encoding of LL/SC instruction,
while the .set mips2 will force assembler to generate
old encoding.

This patch can fix this problem.

In fact if we not willing to support MIPS I or any CPU without ll/sc
at all, we can just remove .set mips2 here.

inline patch 1: postgresql-11-11.2/src/include/storage/s_lock.h (+9/-2 lines) download inline-1.patchIndex: postgresql-11-11.2/src/include/storage/s_lock.h =================================================================== --- postgresql-11-11.2.orig/src/include/storage/s_lock.h +++ postgresql-11-11.2/src/include/storage/s_lock.h @@ -606,6 +606,13 @@ typedef unsigned int slock_t; #define TAS(lock) tas(lock) + +#if __mips_isa_rev >= 6 +# define MIPS_SET_VER " \n" +#else +# define MIPS_SET_VER ".set mips2 \n" +#endif + static __inline__ int tas(volatile slock_t *lock) { @@ -615,7 +622,7 @@ tas(volatile slock_t *lock) __asm__ __volatile__( " .set push \n" - " .set mips2 \n" + MIPS_SET_VER " .set noreorder \n" " .set nomacro \n" " ll %0, %2 \n" @@ -637,7 +644,7 @@ do \ { \ __asm__ __volatile__( \ " .set push \n" \ - " .set mips2 \n" \ + MIPS_SET_VER \ " .set noreorder \n" \ " .set nomacro \n" \ " sync \n" \

view thread (20+ messages)  latest in thread

Message-ID: <15844-8f62fe7e163939b3@postgresql.org>
Permalink:  ../15844-8f62fe7e163939b3@postgresql.org/
Also on:    postgresql.org/message-id/15844-8f62fe7e163939b3@postgresql.org

 ·  · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, wzssyqa@gmail.com
  Subject: Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
  In-Reply-To: <15844-8f62fe7e163939b3@postgresql.org>

* 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