Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcMm2-00041d-75 for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jun 2019 04:28:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hcMlz-0007iI-QV for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jun 2019 04:28:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcMlz-0007iB-DU for pgsql-bugs@lists.postgresql.org; Sun, 16 Jun 2019 04:28:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcMlw-0001fY-Rs for pgsql-bugs@lists.postgresql.org; Sun, 16 Jun 2019 04:28:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5G4S21p025322; Sun, 16 Jun 2019 00:28:02 -0400 From: Tom Lane To: YunQiang Su cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build In-reply-to: References: <15844-8f62fe7e163939b3@postgresql.org> <15052.1560455595@sss.pgh.pa.us> <23287.1560655935@sss.pgh.pa.us> Comments: In-reply-to YunQiang Su message dated "Sun, 16 Jun 2019 11:52:54 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <25320.1560659282.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 16 Jun 2019 00:28:02 -0400 Message-ID: <25321.1560659282@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk YunQiang Su writes: > Tom Lane =E4=BA=8E2019=E5=B9=B46=E6=9C=8816=E6=97=A5= =E5=91=A8=E6=97=A5 =E4=B8=8A=E5=8D=8811:32=E5=86=99=E9=81=93=EF=BC=9A >> 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=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/libexec/lto-wrapper Target: mipsel--netbsd Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configu= re --target=3Dmipsel--netbsd --enable-long-long --enable-threads --with-bu= gurl=3Dhttp://www.NetBSD.org/Misc/send-pr.html --with-pkgversion=3D'NetBSD= nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx= -threads --enable-libstdcxx-time=3Drt --enable-lto --with-mpc-lib=3D/var/o= bj/mknative/pmax-mipsel/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpf= r-lib=3D/var/obj/mknative/pmax-mipsel/usr/7/src/external/lgpl3/mpfr/lib/li= bmpfr --with-gmp-lib=3D/var/obj/mknative/pmax-mipsel/usr/7/src/external/lg= pl3/gmp/lib/libgmp --with-mpc-include=3D/usr/7/src/external/lgpl3/mpc/dist= /src --with-mpfr-include=3D/usr/7/src/external/lgpl3/mpfr/dist/src --with-= gmp-include=3D/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/mipsel --enabl= e-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build= =3Dx86_64-unknown-netbsd6.0. --host=3Dmipsel--netbsd --with-sysroot=3D/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=3Dmips2 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=3Dmips2 changes it from "1" to "2". So I'm wondering about some test along the lines of #if __mips_isa_rev > 0 || __mips =3D=3D 1 #define FORCE_MIPS2_ARCHITECTURE #endif or alternatively, teach configure to force -march=3Dmips2 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