Blob Blame History Raw
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.12-25) unstable; urgency=medium
 .
   * Version_2_6_13pre31, kfreebsd and mips64 FTBFS fix
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.12.orig/h/elf64_mips_reloc.h
+++ gcl-2.6.12/h/elf64_mips_reloc.h
@@ -1,6 +1,7 @@
     case R_MIPS_JALR:
       break;
     case R_MIPS_64:
+      if (ELF_R_FTYPE(r->r_info)==R_MIPS_GPREL32) s-=(ul)got;
       add_val(where,~0L,s+a);
       break;
     case R_MIPS_GPREL32:
--- gcl-2.6.12.orig/h/elf64_mips_reloc_special.h
+++ gcl-2.6.12/h/elf64_mips_reloc_special.h
@@ -3,7 +3,7 @@ static ul ggot,ggote; static Rela *hr;
 #undef ELF_R_SYM 
 #define ELF_R_SYM(a_) (a_&0xffffffff) 
 #undef ELF_R_TYPE 
-#define ELF_R_TYPE(a_) (((a_>>40)&0xff) ? ((a_>>40)&0xff) : ((a_>>56)&0xff)) 
+#define ELF_R_TYPE(a_) (((a_>>40)&0xff) ? ((a_>>40)&0xff) : (((a_>>48)&0xff) ? ((a_>>48)&0xff) : ((a_>>56)&0xff)))
 #define ELF_R_FTYPE(a_) ((a_>>56)&0xff)
 
 typedef struct {
--- gcl-2.6.12.orig/o/main.c
+++ gcl-2.6.12/o/main.c
@@ -179,7 +179,7 @@ get_phys_pages_no_malloc(char n) {
 
 }
 
-#elif defined(__sun__)
+#elif defined(__sun__) || defined(__GNU__)
 
 static ufixnum
 get_phys_pages_no_malloc(char n) {