Hi! So, here's my suggestion on how to fix this issue.
First, copy the attached patch to the ghc source package but do not add it to the series file. Instead, add the following to debian/rules: ifeq (armel,$(DEB_HOST_ARCH)) patch -p1 < debian/patches/armel-revert-ticket-10375.patch endif This will revert the fix from upstream ticket 10375 but only for armel which will make the package build on armel again (I am currently doing a testbuild to verify this but it's still building after two days on armel on qemu). Then manually build ghc on an armel machine with the above changes in a prepared changeroot with the build dependencies taken from snapshots.debian.org. This way we workaround the fact that ghc is BD-Uninstallable on armel. Then create a new version of hscolour (can be just a cosmetic change just so that we can create a new package version) and build and upload the package manually on armel. This should resolve this issue and make ghc build all the haskell packages on armel again. I have also talked to upstream and the general opinion is that ARM support generally still needs lots of work, independent of this particular bug now so I assume that in the future, we will be able to drop this workaround again and hopefully have ghc's build system differenriate between armel and armhf which is what would have prevented this regression in the first place. Cheers, Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
diff --git a/aclocal.m4 b/aclocal.m4 index 2282b99..0c2633a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -568,18 +568,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], $3="$$3 -D_HPUX_SOURCE" $5="$$5 -D_HPUX_SOURCE" ;; - arm*linux*) - # On arm/linux and arm/android, tell gcc to generate Arm - # instructions (ie not Thumb) and to link using the gold linker. - # Forcing LD to be ld.gold is done in FIND_LD m4 macro. - $2="$$2 -marm" - $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack" - $4="$$4 -z noexecstack" - ;; - - aarch64*linux*) - # On aarch64/linux and aarch64/android, tell gcc to link using the - # gold linker. + arm*linux* | \ + aarch64*linux* ) + # On arm/linux, aarch64/linux, arm/android and aarch64/android, tell + # gcc to link using the gold linker. # Forcing LD to be ld.gold is done in FIND_LD m4 macro. $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack" $4="$$4 -z noexecstack" diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs index a01fcd8..cd31acb 100644 --- a/compiler/ghci/ByteCodeItbls.hs +++ b/compiler/ghci/ByteCodeItbls.hs @@ -219,17 +219,17 @@ mkJumpToAddr dflags a = case platformArch (targetPlatform dflags) of , fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ] ArchARM { } -> - -- Generates Arm sequence, + -- Generates Thumb sequence, -- ldr r1, [pc, #0] -- bx r1 -- -- which looks like: -- 00000000 <.addr-0x8>: - -- 0: 00109fe5 ldr r1, [pc] ; 8 <.addr> - -- 4: 11ff2fe1 bx r1 + -- 0: 4900 ldr r1, [pc] ; 8 <.addr> + -- 4: 4708 bx r1 let w32 = fromIntegral (funPtrToInt a) :: Word32 - in Left [ 0x00, 0x10, 0x9f, 0xe5 - , 0x11, 0xff, 0x2f, 0xe1 + in Left [ 0x49, 0x00 + , 0x47, 0x08 , byte0 w32, byte1 w32, byte2 w32, byte3 w32] arch -> diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs index d7ddf80..1a9373b 100644 --- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs +++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs @@ -52,7 +52,7 @@ moduleLayout = sdocWithPlatform $ \platform -> $+$ text "target triple = \"x86_64-linux-gnu\"" Platform { platformArch = ArchARM {}, platformOS = OSLinux } -> 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\"" - $+$ text "target triple = \"armv6-unknown-linux-gnueabihf\"" + $+$ text "target triple = \"arm-unknown-linux-gnueabi\"" Platform { platformArch = ArchARM {}, platformOS = OSAndroid } -> 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\"" $+$ text "target triple = \"arm-unknown-linux-androideabi\"" diff --git a/rts/Linker.c b/rts/Linker.c index 355b33a..0a13e6f 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5564,11 +5564,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, #ifdef arm_HOST_ARCH // Thumb instructions have bit 0 of symbol's st_value set is_target_thm = S & 0x1; - - if (is_target_thm) - errorBelch( "Symbol `%s' requires Thumb linkage which is not " - "currently supported.\n", symbol ); - T = sym.st_info & STT_FUNC && is_target_thm; // Make sure we clear bit 0. Strictly speaking we should have done