Trying to build ghc on arm64, I get: * Package: dev-lang/ghc-8.0.2 * Repository: gentoo * Maintainer: haskell@gentoo.org * USE: arm64 elibc_glibc gmp kernel_linux profile userland_GNU * FEATURES: distcc preserve-libs sandbox userpriv usersandbox * Checking for at least 8 GiB disk space at "/var/tmp/portage/dev-lang/ghc-8.0.2/temp" ... [ !! ] * There is NOT at least 8 GiB disk space at "/var/tmp/portage/dev-lang/ghc-8.0.2/temp" * Checking for at least 2 GiB disk space at "//usr" ... [ ok ] * * Space constraints set in the ebuild were not met! * The build will most probably fail, you should enhance the space * as per failed tests. * >>> Unpacking source... >>> Unpacking ghc-8.0.2-src.tar.xz to /var/tmp/portage/dev-lang/ghc-8.0.2/work >>> 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 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. * Relocating 'lib' to 'lib64' (bug #476998) /var/tmp/portage/dev-lang/ghc-8.0.2/temp/ghc-pkg-8.0.2-orig: line 11: /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg: No such file or directory * ERROR: dev-lang/ghc-8.0.2::gentoo failed (prepare phase): * failed to update cache after relocation * * Call stack: * ebuild.sh, line 115: Called src_prepare * environment, line 4136: Called relocate_ghc '/var/tmp/portage/dev-lang/ghc-8.0.2/work' * environment, line 3900: Called die * The specific snippet of code: * "$gp_back" recache || die "failed to update cache after relocation"; * * If you need support, post the output of `emerge --info '=dev-lang/ghc-8.0.2::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-lang/ghc-8.0.2::gentoo'`. * The complete build log is located at '/var/tmp/portage/dev-lang/ghc-8.0.2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-lang/ghc-8.0.2/temp/environment'. * Working directory: '/var/tmp/portage/dev-lang/ghc-8.0.2/work/ghc-8.0.2' * S: '/var/tmp/portage/dev-lang/ghc-8.0.2/work/ghc-8.0.2' # /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg -bash: /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg: No such file or directory # file /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, stripped Compare to: # file /bin/ls /bin/ls: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped
Note: I don't see arm64 here https://ghc.haskell.org/trac/ghc/wiki/Platforms
> # file /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg /var/tmp/portage/dev-lang/ghc-8.0.2/work/usr/lib64/ghc-8.0.2/bin/ghc-pkg: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, stripped Oh, that's a shame. It's a user-provided build. I guess user has 32-bit userland on 64-bit ARM. ghc-8.2.1 will have cross-compilation and cross-building support. Would you like to try a cross-built binary from ::haskell overlay for ghc-8.2.1_rc3? I'm building the binary package right now against unstable ~arm64 crossdev. I think it will require llvm-3.9 or higher on the target. Can you also post your `emerge --info`? Mostly for my curiosity on how those systems look like. > Note: I don't see arm64 here https://ghc.haskell.org/trac/ghc/wiki/Platforms It's a bit outdated and depends a lot how you squint at the support (use llvm codegen or not, etc.). unregisterised more should work on any arch.
(In reply to Sergei Trofimovich from comment #2) > Can you also post your `emerge --info`? Mostly for my curiosity on how those > systems look like. going for the easy part now: emerge --info Portage 2.3.6 (python 3.4.6-final-0, default/linux/arm64/13.0, gcc-7.1.0, glibc-2.24-r3, 4.9.36-v8+ aarch64) ================================================================= System uname: Linux-4.9.36-v8+-aarch64-with-gentoo-2.4.1 KiB Mem: 740896 total, 34936 free KiB Swap: 2097148 total, 2068868 free Timestamp of repository gentoo: Tue, 11 Jul 2017 08:30:01 +0000 sh bash 4.4_p12 ld GNU ld (Gentoo 2.28 p1.2) 2.28 distcc 3.2rc1 aarch64-unknown-linux-gnu [enabled] app-shells/bash: 4.4_p12::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.1-r2::gentoo dev-lang/python: 2.7.13::gentoo, 3.4.6::gentoo dev-util/cmake: 3.8.2::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1::gentoo sys-apps/openrc: 0.27.2::gentoo sys-apps/sandbox: 2.10-r4::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r3::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.15.1::gentoo sys-devel/binutils: 2.28-r2::gentoo sys-devel/gcc: 7.1.0-r1::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r4::gentoo sys-devel/make: 4.2.1-r1::gentoo sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.24-r3::gentoo
Built aarch64 binary in ::haskell as: https://github.com/gentoo-haskell/gentoo-haskell/commit/444c46bd909a5647d9824559293144723024f191 The easy ways to test if it works at all it to install the binary: $ USE=binary emerge -1 =dev-lang/ghc-8.2.1_rc3 It won't try to compile anything, should only install ghc binary. This cross-compiled binary lacks ghci support thus the easiest way to check if it works is to build a hello world (or 'app-admin/haskell-updater'). More serious test is to build native ghc itself: $ emerge -1 =dev-lang/ghc-8.2.1_rc3 Both GHCs require llvm-3.9 or llvm-4.0 present.