Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622786 - dev-lang/ghc: arm64 binary request
Summary: dev-lang/ghc: arm64 binary request
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-26 21:55 UTC by Michael Lawrence
Modified: 2022-08-31 21:33 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portage logs... (ghc-logs.7z,7.21 KB, application/x-7z-compressed)
2018-06-13 20:41 UTC, Michael Lawrence
Details
llvm version fix example (ghc-arm-fix.patch,1.44 KB, patch)
2021-01-17 02:12 UTC, Nick Bowler
Details | Diff
ghc 8.10.6 llvm fixes for arm (ghc-8.10.6-arm.patch,1.44 KB, patch)
2022-02-18 04:35 UTC, Nick Bowler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Lawrence 2017-06-26 21:55:32 UTC
https://launchpad.net/ubuntu/+source/ghc/8.0.2-0~build1/+build/11904219
add alt binary as option. might be more useful option on low memory devices.. 

 * Package:    dev-lang/ghc-8.0.2
 * Repository: gentoo
 * Maintainer: haskell@gentoo.org
 * USE:        arm64 binary elibc_glibc gmp kernel_linux profile userland_GNU
 * FEATURES:   compressdebug distcc distcc-pump preserve-libs sandbox splitdebug userpriv usersandbox
>>> ^[[1m^[[37mcfg-update-1.8.2-r1^[[0m^[[0m: Skipping checksum index updating...
>>> Unpacking source...
>>> Unpacking ghc-bin-8.0.2-arm64.tbz2 to /var/tmp/portage/dev-lang/ghc-8.0.2/work

bzip2: /var/tmp/portage/dev-lang/ghc-8.0.2/distdir/ghc-bin-8.0.2-arm64.tbz2: trailing garbage after EOF ignored
>>> Source unpacked in /var/tmp/portage/dev-lang/ghc-8.0.2/work
>>> Preparing source in /var/tmp/portage/dev-lang/ghc-8.0.2/work/ghc-8.0.2 ...
 * PT_PAX marking -m /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc with paxctl
 * PT_PAX marking -m /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc with scanelf
 * XATTR_PAX marking -me /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc with setfattr
 * Failed to set XATTR_PAX markings -me /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc.
>>> Source prepared.
distcc[10116] (dcc_parse_hosts) Warning: /etc/distcc/hosts contained no hosts; can't distribute work
distcc[10116] (dcc_show_hosts) CRITICAL! Failed to get host list
/usr/bin/pump: error: pump mode requested, but distcc hosts list does not contain any hosts with ',cpp' option
>>> Configuring source in /var/tmp/portage/dev-lang/ghc-8.0.2/work/ghc-8.0.2 ...
>>> Source configured.
distcc[10173] (dcc_parse_hosts) Warning: /etc/distcc/hosts contained no hosts; can't distribute work
distcc[10173] (dcc_show_hosts) CRITICAL! Failed to get host list
/usr/bin/pump: error: pump mode requested, but distcc hosts list does not contain any hosts with ',cpp' option
>>> Compiling source in /var/tmp/portage/dev-lang/ghc-8.0.2/work/ghc-8.0.2 ...
>>> Source compiled.
distcc[10231] (dcc_parse_hosts) Warning: /etc/distcc/hosts contained no hosts; can't distribute work
distcc[10231] (dcc_show_hosts) CRITICAL! Failed to get host list
/usr/bin/pump: error: pump mode requested, but distcc hosts list does not contain any hosts with ',cpp' option
>>> Test phase [not enabled]: dev-lang/ghc-8.0.2
distcc[10286] (dcc_parse_hosts) Warning: /etc/distcc/hosts contained no hosts; can't distribute work
distcc[10286] (dcc_show_hosts) CRITICAL! Failed to get host list
/usr/bin/pump: error: pump mode requested, but distcc hosts list does not contain any hosts with ',cpp' option
Comment 1 Jonas Stein gentoo-dev 2017-06-27 12:17:22 UTC
Michael, I have severe difficulties to understand the bug report.
I guess, that you wish a new binary ebuild.

If possible, please discuss the rest if the ticket with someone and add a short, but precise text with complete sentences. 

Hint: Imagine you have only one chance in your life to write this very important bug report and you know only that the recipient can read English, but it is not his native language.

https://wiki.gentoo.org/wiki/Bugzilla/Bug_report_guide#Best_practice
Comment 2 Michael Lawrence 2017-06-27 13:36:47 UTC
I have a https://github.com/sakaki-/gentoo-on-rpi3-64bit
install 

yes a ghc-bin ebuild for embedded  devices would be of use.. or a distfile-bin for arm64-generic.. 

honestly , i need a better RPI clone board. ie bannanpi-64 with more ram or a Softiron Server. as you can use far more ram...

ghc less you have a distcc host the compile will fail. RAM will tax. 
I could rig a usb stick for 8-16 gigs of swap... 


https://launchpad.net/ubuntu/+source/ghc/8.0.2-0~build1/+build/11904219
however there are patches etc. I  possibly could try.  a hand build. 

however  doing an ALIEN run on that dep yields thus. 
 /usr/local and symlink...  nuts... 


/usr/lib/ghc/bin/ghc: /usr/lib64/libtinfo.so.5: no version information available (required by /usr/lib/ghc/bin/../haskeline-0.7.3.0/libHShaskeline-0.7.3.0-ghc8.0.2.so)
/usr/lib/ghc/bin/ghc: /usr/lib64/libtinfo.so.5: no version information available (required by /usr/lib/ghc/bin/../terminfo-0.4.0.2/libHSterminfo-0.4.0.2-ghc8.0.2.so)
/usr/lib/ghc/package.conf.d/package.cache: openBinaryFile: does not exist (No such file or directory)

terminfo-0.4.0.2 is part of ncurses... i have 5.x....
on this one. 

anyhow if the dist-files for gentoo GHC binaries  , might be able to use some of the debian/ubuntu binaries or patches. 

https://launchpad.net/ubuntu/+source/ghc/8.0.2-0~build1  patches.
Comment 3 Jonas Stein gentoo-dev 2017-06-27 17:18:52 UTC
OK I adjusted the title. 
That would fit in 1 to 3 lines. Please prepare the next bug report together with other gentoo users. 

If you see me on IRC #gentoo, you may contact me and we will optimize your next report together before submission.
Comment 5 Michael Lawrence 2018-06-13 20:41:54 UTC
Created attachment 535826 [details]
portage logs...
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-10-26 06:09:40 UTC
The original bug report was a bit unclear but it'd be great to have an arm64 binary added to SRC_URI for bootstrap.

Upstream seem to provide them for both armv7 and arm64 here: https://www.haskell.org/ghc/download_ghc_8_10_2.html (for Debian, anyway).

If those aren't suitable, it is possible we could sort out access to a VM to prepare these binaries, or the arm{,64} team could help out.
Comment 7 Michael Lawrence 2020-10-27 13:39:56 UTC
Haskell overlay has bins pinned on a few. 

Rpi4 with 4 gigs ram doable,  however slow..

Thus you could compile a newer ghc w/o bins..

However 8 gigs or an arm64 server recommended.


Mainline gentoo,  however often hasn't had the bin uri available on many more modern ghc releases,  least historically (hx)
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-10-27 19:21:13 UTC
Gentoo provides gentoo-built binaries of ghc for various reasons including non-default toolchain setup. arm/arm64 specifically adds into the mix very specific version of llvm needed to be used for ghc.

The binaries can be built but I expect high maintenance burden for arm64.

I'm fine with adding Gentoo-built ghc into SRC_URI built with https://github.com/gentoo-haskell/gentoo-haskell/blob/master/projects/build-ghc-bin.sh on a default chroot but i'll probably not get to it building binaries myself.

Cross-building ghc to get initial seed should be very simple: https://trofi.github.io/posts/200-ghc-as-a-crosscompiler-update.html

Tying llvm into it will complicate the task somewhat but should be achievable.
Comment 9 Nick Bowler 2021-01-17 02:12:29 UTC
Created attachment 683227 [details, diff]
llvm version fix example

(In reply to Sergei Trofimovich from comment #8)
> Gentoo provides gentoo-built binaries of ghc for various reasons including
> non-default toolchain setup. arm/arm64 specifically adds into the mix very
> specific version of llvm needed to be used for ghc.
[...]
> Tying llvm into it will complicate the task somewhat but should be
> achievable.

It seems to me that all that needs to be done is to configure GHC with
LLC=/path/to/correct/version and OPT=/path/to/correct/version, using
absolute paths.  These paths get baked into the installed GHC settings
file, and it will continue to use them.

With that I was able to bootstrap 8.10.3 on ARMv7 without too much
trouble, using the uptstream-provided ARMv7 binaries as a starting
point.  (ghc-8.8.x, currently keyworded on other arches, unfortunately
requires an llvm version which is not in the tree).

The only real problem encountered was that the stage2 compiler segfaults
in the ebuild environment, commenting out BOTH the --disable-ld-override
and the LD=blah configure option in the ebuild corrected this problem
(configure script seems to do the right thing automatically: not sure
what's up there).

Then modulo a handful of packages that need minor updates to build with
GHC 8.10.3, I was able to install pandoc and git-annex no problem (and
also rebootstrap GHC).
Comment 10 Larry the Git Cow gentoo-dev 2021-02-05 00:27:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb9f9f4fb59e743120eb54d32ee450ae0c56cb33

commit fb9f9f4fb59e743120eb54d32ee450ae0c56cb33
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-02-05 00:26:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-02-05 00:27:38 +0000

    profiles/arch/arm64: mask media-sound/bluez-alsa[man]
    
    Neeeds pandoc but we don't yet have Haskell on arm64.
    
    Bug: https://bugs.gentoo.org/622786
    Bug: https://bugs.gentoo.org/768738
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/arm64/package.use.mask | 5 +++++
 1 file changed, 5 insertions(+)
Comment 11 Nick Bowler 2022-02-18 04:35:10 UTC
Created attachment 765328 [details, diff]
ghc 8.10.6 llvm fixes for arm

since ghc 8.10.3 doesn't support any llvm version of the tree, I updated the patch against ghc 8.10.6 which (according to the release notes) supports llvm versions up to 12.

I built this one with llvm:11 installed and everything seems fully functional on ARMv7.
Comment 12 Marcus Comstedt 2022-08-16 20:30:27 UTC
Please find binpkgs of ghc 8.10.6 and 9.0.2 for arm64 here:
https://mc.pp.se/ghc-packages-arm64.tar.xz
They were built natively with USE=ghcbootstrap and the llvm
used was sys-devel/llvm:14

8.10.6 was bootstrapped using 8.10.6, but 9.0.2 was bootsrapped using 9.0.1-r1.  Both boostrap compilers were in turn built from the ebuilds with USE=ghcbootstrap.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-31 21:33:11 UTC
All done in https://github.com/gentoo/gentoo/pull/27048.

commit 4f2b75c28da601e734f44f93381b88b59f0233ca
Author: matoro <matoro@users.noreply.github.com>
Date:   Wed Aug 24 13:11:45 2022 -0400

    dev-lang/ghc: keyword 9.0.2 for ~arm64

    Thanks-to: Marcus Comstedt <marcus@mc.pp.se>
    Signed-off-by: Sam James <sam@gentoo.org>