Source: ghc
Version: 7.6.3-4
Severity: wishlist
Tags: patch upstream

Dear Maintainer,

please reenable ghci on arm as it prevents many package from building. I
improved on the patch proposed upstream and it works on porterbox. Maybe
you could give it a try in experimental. See the patch in the attached
file.

Best regards.


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'oldstable-updates'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: Add ARM implementation for mkJumpToAddr
 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.
 .
 ghc (7.6.3-4) unstable; urgency=low
 .
   [ Colin Watson ]
   * Enable verbose build output (see
     http://lists.debian.org/debian-devel/2013/06/msg00539.html).
 .
   [ Gianfranco Costamagna ]
 .
   * Switch to llvm (Closes: #711948)
   * removed deprecated DM-Upload-Allowed
   * removed some version checks, higher versions are already in oldstable.
   * Added dpkg-buildflags as build-dep, fixing lintian warning.
Author: Joachim Breitner <nome...@debian.org>
Bug-Debian: http://bugs.debian.org/711948

---
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: http://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>

--- ghc-7.6.3.orig/compiler/ghci/ByteCodeItbls.lhs
+++ ghc-7.6.3/compiler/ghci/ByteCodeItbls.lhs
@@ -242,6 +242,18 @@ mkJumpToAddr a
       , fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ]
     where w64 = fromIntegral (ptrToInt a) :: Word64
 
+#elif arm_TARGET_ARCH
+type ItblCode = Word32
+mkJumpToAddr a
+    = [ 0xe92d0080      -- push    {r7}
+      , 0xe3a0780f      -- mov     r7, #983040     ; 0xf0000
+      , 0xe2877002      -- add     r7, r7, #2
+      , 0xe3a02000      -- mov     r2, #0
+      , 0xef000000      -- swi     0x0
+      , 0xe8bd0080      -- pop     {r7}
+      , 0xe51ff004      -- ldr pc, [pc, #-4]    # pc reads as <current insn>+8
+      , fromIntegral (ptrToInt a) ]
+
 #else
 type ItblCode = Word32
 mkJumpToAddr a

Reply via email to