PATCH: Linux/MIPS support

From: Ralf Baechle <ralf(at)uni-koblenz(dot)de>
To: pgsql-ports(at)postgresql(dot)org
Subject: PATCH: Linux/MIPS support
Date: 2000-10-21 21:28:16
Message-ID: 20001021232826.A2574@bacchus.dhis.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Below a patch relative to Postgress 6.5.3 to fix the Linux/MIPS support.
It does:

- update the Linux/MIPS entries in src/template/.similar
- changes the compilation flags in src/template/linux_mips:
- Don't use -mips2, this code model isn't supported on all processors, so
it's a bad choice for a default. Aside the performance gain is very
small.
- No special compilation flags necessary for MIPS ELF systems, so
delete -fpic.
- removal of -mips2 affects the tas function in s_lock.c. I solved the
problem by conditionally putting the assembler into MIPS 2 mode only for
Linux. For MIPS I machines the kernel emulation for these instruction
then does the job. This needs to be a conditional since we cannot rely
on the assembler properly supporting .set mipsX; Linux's assembler however
does properly.

A further problem when compiling with glibc 2.1.94 is that the file
src/backend/port/inet_aton.h redeclares the system function inet_aton().
Sorry, I don't have a patch for this problem.

Please apply,

Ralf

diff -urN postgresql-6.5.3.orig/src/backend/storage/buffer/s_lock.c postgresql-6.5.3/src/backend/storage/buffer/s_lock.c
--- postgresql-6.5.3.orig/src/backend/storage/buffer/s_lock.c Sun Jun 6 22:19:35 1999
+++ postgresql-6.5.3/src/backend/storage/buffer/s_lock.c Sat Oct 21 20:35:08 2000
@@ -147,8 +147,11 @@
static void
tas_dummy()
{
- __asm__(" \n\
-.global tas \n\
+ __asm__(
+#ifdef __linux__
+" .set mips2 \n"
+#endif
+".global tas \n\
tas: \n\
.frame $sp, 0, $31 \n\
ll $14, 0($4) \n\
@@ -161,8 +164,11 @@
j $31 \n\
fail: \n\
li $2, 1 \n\
- j $31 \n\
- ");
+ j $31 \n"
+#ifdef __linux__
+" .set mips2 \n"
+#endif
+ );
}

#endif /* __mips */
diff -urN postgresql-6.5.3.orig/src/template/.similar postgresql-6.5.3/src/template/.similar
--- postgresql-6.5.3.orig/src/template/.similar Sat Oct 21 19:22:22 2000
+++ postgresql-6.5.3/src/template/.similar Sat Oct 21 20:04:26 2000
@@ -33,6 +33,6 @@
sparc-sun-sunos4=sunos4_gcc
sparc-sun-sunos5=solaris_sparc_gcc
sparc-unknown-linux-gnu=linux_sparc
-mips-pc-linux-gnu=linux_mips
+mips-unknown-linux-gnu=linux_mips
mipsel-unknown-linux-gnu=linux_mips
arm-unknown-linux-gnu=linux_arm
diff -urN postgresql-6.5.3.orig/src/template/linux_mips postgresql-6.5.3/src/template/linux_mips
--- postgresql-6.5.3.orig/src/template/linux_mips Fri Dec 18 18:25:41 1998
+++ postgresql-6.5.3/src/template/linux_mips Sat Oct 21 20:04:26 2000
@@ -1,6 +1,6 @@
AROPT:crs
-CFLAGS:-O2 -mips2
-SHARED_LIB:-fpic
+CFLAGS:-O2
+SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Joerg Hessdoerfer 2000-10-23 12:43:52 Re: great work!
Previous Message Pawel Wegrzyn 2000-10-21 13:04:12 latest version?