android 交叉编译Haskell

cnjp1d6j  于 2023-08-01  发布在  Android
关注(0)|答案(1)|浏览(79)

如何将Haskell交叉编译到ARM处理器上?
我已经能够交叉编译C,Go和Rust,所以,我想,这在我的工具链中不是问题?
我能够从ghc源代码运行configure脚本,尽管运行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的路径是正确的。
我错过了什么吗?我应该安装其他东西吗?

myzjeezk

myzjeezk1#

看起来你可能只需要忽略特定的Android版本,因为checkOS函数是这样定义的:

checkOS() {
        case [$]1 in
        linux|linux-android)
            test -z "[$]2" || eval "[$]2=OSLinux"
            ;;

字符串

相关问题