[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Haskell on arm needs help (was: hledger and hledger-web packages for raspbian)



Joachim Breitner <nomeata@debian.org> writes:

> Hi,
>
>
> Am Samstag, den 22.11.2014, 12:49 +0000 schrieb Wookey:
>> More generally: I would like to see ghci working on arm64 (and arm in
>> general) as it blocks a lot of packages. My understanding it there is
>> some kind of arch-specific code-generator inside which needs quite a
>> lot of work teaching it a new ISA. No-one in Linaro has come forward
>> and said that they need this working badly enough to get it done there
>> so it needs to be done by community people.
>
> supposedly the situation is much better in 7.8, which uses the system
> linker. Unfortunately, we don’t know, because it FTBFS for other
> reasons:
> https://buildd.debian.org/status/package.php?p=ghc&suite=experimental
>
It looks to me like that arm[eh]l builds are failing due to ld.bfd is
being used to link our executables. Unfortunately ld.bfd has a
long-standing bug [1] which results in symbols being copied
where there should be a static reference. This likely wouldn't be a
problem if it weren't for the fact that the linker doesn't know about
our info tables. This means that we end up stumbling into an invalid
info table during the first GC. For this reason I have been recommending
ARM users to use gold to link our executables. I describe this in [2].

Unfortunately this tends to be a theme with GHC's ARM support: our code
usually works pretty well; we just exercise paths in other code around
the system aren't well tested. I have looked in to fixing the ld.bfd
issue; unfortunately bfd is a mess and either way it would be a long
time before the fix made it to users. It just seems easier to avoid the
issue altogether.

>> I presume the number of people intimately familiar with both haskell
>> and low-level arm coding is dangerously close to zero so it presumably
>> needs collaboration between relevant experts. Do we have some arm
>> people who want to put in some time on this, and some haskell people
>> they can talk to about exactly what needs to be done?
>> 
>> I can help by providing access to hardware even for non-DDs if that's
>> what's needed to make this happen.
>
> I grepped through the ghc commit messages and identified these people
> (CC’ed) as having worked on arm-related stuff in the recent past:
>
>  Luke Iannini <lukexi@me.com>
>  Ben Gamari <bgamari.foss@gmail.com>
>  Stephen Paul Weber <singpolyma@singpolyma.net>
>  Karel Gardas <karel.gardas@centrum.cz>
>
> They might know better what is supposed to work, and why it does not
> work on Debian yet. And maybe the prospect of hardware access to fast
> build machines can spark renewed enthusiasm in that direction.
>
Thanks for bringing this to my attention, Joachim.

GHC's ARM support has been a pet project of mine for the last few
years. It's definitely a side project though and recently finishing up
my PhD has been taking precendence. That being said, things have been
slowly improving. Last March I wrote an article [1] describing the
state of things. TL;DR: GHC 7.8 (including ghci) should work quite well
at this point except for a few points,

 * Bootstrapping is a bit painful due to various bugs in various linkers

 * There is a bug in the LLVM mangler [3] currently in the 7.8 branch that
   means that GHC can't bootstrap itself. This is fixed in master and
   the fix should make it in to 7.8.4 which will be the last release in
   the 7.8 series

I would be happy to help track down particular issues if you can
provide more details.

Cheers,

- Ben


[1] https://sourceware.org/bugzilla/show_bug.cgi?id=16177
[2] http://smart-cactus.org/~ben/posts/2014-03-06-compiling-ghc-7.8-on-arm.html
[3] https://phabricator.haskell.org/D150

Attachment: pgpCAKZOM6qWu.pgp
Description: PGP signature


Reply to: