Ian
There was a patch submitted a while ago that doesn't
seem to have been rolled into 7.2.1 that fixes this.
It does it by patching s_lock.c to add the set .mips2
assembler directive. The patch is attached.
Your patch works just as well. It is what I have been
doing to get PostgreSQL to compile on the MIPS machine
I am using.
Cheers,
Warwick
> Hi all,
>
> I've been messing with NetBSD/cobalt 1.5.3, and have found that the template
> file for NetBSD could be improved a little - without the following change
> the system dies in s_lock.c because the opcodes are only available with the
> -mips2 flag, and it's not correctly picked up for this platform.
>
> The file src/template/netbsd should have three lines added (similar to the
> current src/template/linux one), so the full file looks like this:
>
> ----
> CFLAGS=-O2
>
> case $host_cpu in
> cobalt*) CFLAGS="$CFLAGS -mips2";;
> esac
> ----
>
> With this change made the standard 7.2.1 tarball compiled without a single
> problem. I've yet to test speed and stability.
>
--
Warwick Hunter Agile TV Corporation
Voice: +61 7 5584 5912 Fax: +61 7 5575 9550
mailto:whunter@agile.tv http://www.agile.tv
-----Forwarded Message-----
From: rmurray@debian.org
To: 139003@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Bug#139003: a little bit more is needed...
Date: 27 Mar 2002 00:21:18 -0800
reopen 139003
thanks
Looks like a small patch is needed as well to do the right thing on Linux.
The patch enables the mips2 ISA for the ll/sc operations, and then restores
it when done. The kernel/libc emulation code will take over on CPUs without
ll/sc, and on CPUs with it, it'll use the operations provided by the CPU.
Combined with the earlier fix (removing -mips2), postgresql builds again on
mips and mipsel. The patch is against 7.2-7.
diff -urN postgresql-7.2/src/backend/storage/lmgr/s_lock.c postgresql-7.2.fixed/src/backend/storage/lmgr/s_lock.c
--- postgresql-7.2/src/backend/storage/lmgr/s_lock.c Mon Nov 5 18:46:28 2001
+++ postgresql-7.2.fixed/src/backend/storage/lmgr/s_lock.c Wed Mar 27 07:46:59 2002
@@ -173,9 +173,12 @@
.global tas \n\
tas: \n\
.frame $sp, 0, $31 \n\
+ .set push \n\
+ .set mips2 \n\n
ll $14, 0($4) \n\
or $15, $14, 1 \n\
sc $15, 0($4) \n\
+ .set pop \n\
beq $15, 0, fail\n\
bne $14, 0, fail\n\
li $2, 0 \n\