Re: Help needed: Porting IRAF to MIPS

David Kuehling <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
> On 05.05.2014 12:16, Ole Streicher wrote:
>> since a while, I am working to bring the IRAF package [1] into Debian
>> [2]. I'd like to make the package working on as many Debian platforms
>> as possible.
>> 
>> The major problem here is that IRAF needs a small piece of assembler
>> code that provides a (sort of) setjmp() to their Fortran variant.

Attached you'll find a patch against your zsvjmp.tar.gz test-case that
adds mipsel support.  This seems to work on my debian squeeze mipsel
system, i.e. running 'make test' outputs:

  ./zzdebug
  Status = 0, step = 0
  Calling zdojmp
  Status = 1, step = 1
  All OK
  ./jmptest
   Status =                     0 step =                     0
   Calling zdojmp
   Status =                     1 step =                     1
   All OK
  STOP 0

cheers,

David

PS: forget my last comment WRT loading $t9 when jumping to PIC code: the
mipsel linker (or assembler?) automatically adds such stub code for
calls into PIC routines when ".abicalls" was enabled in the assembler
source.
-- 
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg
Fingerprint: B63B 6AF2 4EEB F033 46F7  7F1D 935E 6F08 E457 205F
010-add-mipsel-support.patch (text/x-diff, 828 B)
Index: zsvjmp/zsvjmp-mipsel.s
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ zsvjmp/zsvjmp-mipsel.s	2014-05-08 00:18:31.433683675 +0200
@@ -0,0 +1,19 @@
+	.file	"zsvjmp.s"
+
+# Copyright (c) 2014 David Kuehling <dvdkhlng AT posteo TOD de>
+# Distributable under the same license as IRAF
+# This file contains the Linux mipsel version of ZSVJMP for Debian.
+
+	.set mips1
+	.abicalls
+	.text
+	.global	zsvjmp_
+	.type	zsvjmp_, %function
+
+zsvjmp_:
+	sw  $a1, 0($a0)		# buf[0]=status
+	sw  $zero, 0($a1)	# *status=0
+	addiu  $a0, $a0, 4	# &buf[1] --> 1st arg for sigsetjmp
+	move    $a1, $zero	# 2nd arg is zero; this opcode fills delay slot
+	j      __sigsetjmp	# jump to sigsetjmp
+	##  note: no delay slot, filled by GAS reordering instructions above
signature.asc (application/pgp-signature, 229 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREIAAYFAlNqspoACgkQk15vCORXIF9C1QD/blvCWYSnsggS7LBL83UVHvYV
XZfkVmI8Hqp++CVxfr8A/3D3XG+YyU2DRNapj4J8/DnVOCqHjDPRWJWvNT6+1lu0
=9Amk
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.