pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: YunQiang Su <wzssyqa@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
Date: Sun, 16 Jun 2019 12:16:53 -0400
Message-ID: <22615.1560701813@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKcpw6XYkD9Ku-0Fw6VZ6=wR030c5xCBOnTGsjLzFqdffkM8dw@mail.gmail.com>
References: <15844-8f62fe7e163939b3@postgresql.org>
	<15052.1560455595@sss.pgh.pa.us>
	<CAKcpw6W2WBdTVnJSeV845V78bwOPDjhROfteX7D2o0TTU2_opA@mail.gmail.com>
	<23287.1560655935@sss.pgh.pa.us>
	<CAKcpw6W8Y56cxKJna6EsA+j2ZQ1p6DeXwMJFOOjb=baPigbV+Q@mail.gmail.com>
	<25321.1560659282@sss.pgh.pa.us>
	<CAKcpw6XYkD9Ku-0Fw6VZ6=wR030c5xCBOnTGsjLzFqdffkM8dw@mail.gmail.com>

YunQiang Su <wzssyqa@gmail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> 于2019年6月16日周日 下午12:28写道:
>> I found that specifying -march=mips2 gets it to accept the s_lock.h
>> code without ".set mips2".  Given that we don't make any pretense of
>> actually running on MIPS-I hardware, I wonder if some hack involving
>> forcing -march would be sane?  You'd get better code quality across
>> the board, presumably.

> -march is not a good idea, since r6 cannot compatible with the previous version.
> If you use -march=mips2 or something else, it will failed to build for r6.
> Which -march to use should be determined by finial user or distribution vendor.

Sure, the trick would be to not override a (default or specified)
architecture setting that's higher than mips2.  I was imagining
using AC_EGREP_CPP() to see if __mips expands to exactly 1.  But
on reflection, probably a better idea is to just see if asm with
ll/sc/sync compiles, and add -march=mips2 if not.

(We should not do anything if --disable-spinlocks has been specified,
btw, since then we don't need those asm commands to work.  This is
and would remain the workaround for building PG for MIPS-I, if some
benighted soul insists on doing that.)

>> (BTW, have you got any recommendations for booting recent Debian/MIPS
>> under qemu?  I can't get anything newer than wheezy to work.)

> I have an r6 one:
>   http://mips64el.bfsu.edu.cn/debian-new/tarball/qemu/
> It is buster.

Thanks for the pointer.

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <22615.1560701813@sss.pgh.pa.us>
Permalink:  ../22615.1560701813@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22615.1560701813@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, wzssyqa@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
  In-Reply-To: <22615.1560701813@sss.pgh.pa.us>

* 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