交叉编译Haskell

问题描述 投票:0回答:1

如何将 Haskell 交叉编译到 ARM 处理器?

我已经能够交叉编译 C、Go 和 Rust,所以,我想,这在我的工具链中不是问题?

我能够从 ghc 源代码运行配置脚本,尽管运行 hadrian 时出现错误。为了尝试实现我的目标,我执行了以下命令:

export CXX=/home/username/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++
export CC=/home/username/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang
export LD=/home/username/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
export AR=/home/username/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar

./configure --target aarch64-linux-android29
hadrian/build -j --verbose

最后一条指令给了我以下错误:

| Run Ghc LinkHs (Stage0 InTreeLibs): _build/stage0/utils/haddock/build/Main.o (and 49 more) => _build/stage0/bin/aarch64-linux-android29-haddock
configure: WARNING: unrecognized options: --with-compiler, --with-cc
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-android
Unknown OS android
# _build/stage1/rts/build/include/ghcautoconf.h
| ContextData oracle: resolving data for 'rts' (Stage1, v)...
| ContextData oracle: resolving data for 'rts' (Stage1, v)...
Error when running Shake build system:
  at action, called at src/Rules.hs:39:19 in main:Rules
  at need, called at src/Rules.hs:61:5 in main:Rules
* Depends on: _build/stage1/lib/package.conf.d/rts-1.0.2.conf
  at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.7-d5ed83c858bf166c2267f32ca7608d79b8ca2402f05e75acba55d9c6a59cf591:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "rts", pkgPath = "rts"}, way = v, iplace = Final}))
* Depends on: _build/stage1/rts/setup-config
* Raised the exception:
ExitFailure 1

Build failed.

我已经验证了,CXX、CC、LD 和 AR 的路径是正确的。

我错过了什么吗? 我应该安装其他东西吗?

android android-ndk arm cross-compiling ghc
1个回答
0
投票

看来你可能只需要省略特定的android版本,因为

checkOS
函数是这样定义的

    checkOS() {
        case [$]1 in
        linux|linux-android)
            test -z "[$]2" || eval "[$]2=OSLinux"
            ;;
© www.soinside.com 2019 - 2024. All rights reserved.