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 00:28:02 -0400
Message-ID: <25321.1560659282@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKcpw6W8Y56cxKJna6EsA+j2ZQ1p6DeXwMJFOOjb=baPigbV+Q@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>

YunQiang Su <wzssyqa@gmail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> 于2019年6月16日周日 上午11:32写道:
>> experimentation that NetBSD as of 7.0.2 doesn't default to assuming

> I have no idea about NetBSD. Can you run gcc -v on it?

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: mipsel--netbsd
Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=mipsel--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/pmax-mipsel/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/pmax-mipsel/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/pmax-mipsel/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/mipsel --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=mipsel--netbsd --with-sysroot=/var/obj/mknative/pmax-mipsel/usr/7/src/destdir.pmax
Thread model: posix
gcc version 4.8.4 (nb2 20150115) 

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.

Also, checking the predefined symbols on this gcc, I don't see
anything about __mips_isa_rev, but I do see that "__mips" is defined
and -march=mips2 changes it from "1" to "2".  So I'm wondering about
some test along the lines of

#if __mips_isa_rev > 0 || __mips == 1
#define FORCE_MIPS2_ARCHITECTURE
#endif

or alternatively, teach configure to force -march=mips2 if it sees
that "__mips" is predefined as 1.

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

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <25321.1560659282@sss.pgh.pa.us>
Permalink:  ../25321.1560659282@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25321.1560659282@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: <25321.1560659282@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