|
0 |
Description: Revert ghci ARM improvements (ticket #10375) on armel
|
|
1 |
This patch reverts a change which improved ghci on ARM (see
|
|
2 |
ghc ticket #10375). While the change fixed ghci on armhf, it
|
|
3 |
actually resulted in the ghc package FTBFS on armel since the
|
|
4 |
changes introduced made ghc incompatible with this architecture
|
|
5 |
(ticket #11058). As a temporary workaround, we revert this particular
|
|
6 |
change when ghc is built on armel. For this reason, this patch
|
|
7 |
is not applied using the series file but only selectively on
|
|
8 |
armel with the help of debian/rules.
|
|
9 |
.
|
|
10 |
|
|
11 |
--- ghc-7.10.3.orig/aclocal.m4
|
|
12 |
+++ ghc-7.10.3/aclocal.m4
|
|
13 |
@@ -574,18 +574,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
|
|
14 |
$3="$$3 -D_HPUX_SOURCE"
|
|
15 |
$5="$$5 -D_HPUX_SOURCE"
|
|
16 |
;;
|
|
17 |
- arm*linux*)
|
|
18 |
- # On arm/linux and arm/android, tell gcc to generate Arm
|
|
19 |
- # instructions (ie not Thumb) and to link using the gold linker.
|
|
20 |
- # Forcing LD to be ld.gold is done in FIND_LD m4 macro.
|
|
21 |
- $2="$$2 -marm"
|
|
22 |
- $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
|
|
23 |
- $4="$$4 -z noexecstack"
|
|
24 |
- ;;
|
|
25 |
-
|
|
26 |
- aarch64*linux*)
|
|
27 |
- # On aarch64/linux and aarch64/android, tell gcc to link using the
|
|
28 |
- # gold linker.
|
|
29 |
+ arm*linux* | \
|
|
30 |
+ aarch64*linux* )
|
|
31 |
+ # On arm/linux, aarch64/linux, arm/android and aarch64/android, tell
|
|
32 |
+ # gcc to link using the gold linker.
|
|
33 |
# Forcing LD to be ld.gold is done in FIND_LD m4 macro.
|
|
34 |
$3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
|
|
35 |
$4="$$4 -z noexecstack"
|
|
36 |
--- ghc-7.10.3.orig/compiler/ghci/ByteCodeItbls.hs
|
|
37 |
+++ ghc-7.10.3/compiler/ghci/ByteCodeItbls.hs
|
|
38 |
@@ -219,17 +219,17 @@ mkJumpToAddr dflags a = case platformArc
|
|
39 |
, fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ]
|
|
40 |
|
|
41 |
ArchARM { } ->
|
|
42 |
- -- Generates Arm sequence,
|
|
43 |
+ -- Generates Thumb sequence,
|
|
44 |
-- ldr r1, [pc, #0]
|
|
45 |
-- bx r1
|
|
46 |
--
|
|
47 |
-- which looks like:
|
|
48 |
-- 00000000 <.addr-0x8>:
|
|
49 |
- -- 0: 00109fe5 ldr r1, [pc] ; 8 <.addr>
|
|
50 |
- -- 4: 11ff2fe1 bx r1
|
|
51 |
+ -- 0: 4900 ldr r1, [pc] ; 8 <.addr>
|
|
52 |
+ -- 4: 4708 bx r1
|
|
53 |
let w32 = fromIntegral (funPtrToInt a) :: Word32
|
|
54 |
- in Left [ 0x00, 0x10, 0x9f, 0xe5
|
|
55 |
- , 0x11, 0xff, 0x2f, 0xe1
|
|
56 |
+ in Left [ 0x49, 0x00
|
|
57 |
+ , 0x47, 0x08
|
|
58 |
, byte0 w32, byte1 w32, byte2 w32, byte3 w32]
|
|
59 |
|
|
60 |
arch ->
|
|
61 |
--- ghc-7.10.3.orig/compiler/llvmGen/LlvmCodeGen/Ppr.hs
|
|
62 |
+++ ghc-7.10.3/compiler/llvmGen/LlvmCodeGen/Ppr.hs
|
|
63 |
@@ -52,7 +52,7 @@ moduleLayout = sdocWithPlatform $ \platf
|
|
64 |
$+$ text "target triple = \"x86_64-linux-gnu\""
|
|
65 |
Platform { platformArch = ArchARM {}, platformOS = OSLinux } ->
|
|
66 |
text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
|
|
67 |
- $+$ text "target triple = \"armv6-unknown-linux-gnueabihf\""
|
|
68 |
+ $+$ text "target triple = \"arm-unknown-linux-gnueabi\""
|
|
69 |
Platform { platformArch = ArchARM {}, platformOS = OSAndroid } ->
|
|
70 |
text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
|
|
71 |
$+$ text "target triple = \"arm-unknown-linux-androideabi\""
|
|
72 |
--- ghc-7.10.3.orig/rts/Linker.c
|
|
73 |
+++ ghc-7.10.3/rts/Linker.c
|
|
74 |
@@ -5574,11 +5574,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc,
|
|
75 |
#ifdef arm_HOST_ARCH
|
|
76 |
// Thumb instructions have bit 0 of symbol's st_value set
|
|
77 |
is_target_thm = S & 0x1;
|
|
78 |
-
|
|
79 |
- if (is_target_thm)
|
|
80 |
- errorBelch( "Symbol `%s' requires Thumb linkage which is not "
|
|
81 |
- "currently supported.\n", symbol );
|
|
82 |
-
|
|
83 |
T = sym.st_info & STT_FUNC && is_target_thm;
|
|
84 |
|
|
85 |
// Make sure we clear bit 0. Strictly speaking we should have done
|