【问题标题】:LuaJIT build failed with NDK, CentOSLuaJIT 构建失败,NDK、CentOS
【发布时间】:2017-12-28 16:45:19
【问题描述】:

我尝试使用 Android NDK 作为 official guide 构建 LuaJIT。但是发生了一些问题。我已经搜索了 2 天,但无法解决。

这是我的 build.sh:

NDK=/opt/android/ndk
NDKABI=14
NDKVER=$NDK/toolchains/arm-linux-androideabi-4.9
NDKP=$NDKVER/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
NDKARCH="-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF $NDKARCH"

我确定 NDK 路径是正确的,并且已添加到环境变量中。此外,build.sh 位于正确的位置。并且 gcc 已经安装。当我运行build.sh 时,发生了一些错误:

==== Building LuaJIT 2.0.5 ====
make -C src
gcc: Command not found/bin/arm-linux-androideabi-
make[1]: Entering directory `/root/LuaJIT-2.0.5/src'
gcc: Command not found/bin/arm-linux-androideabi-
gcc: Command not found/bin/arm-linux-androideabi-
gcc: Command not found/bin/arm-linux-androideabi-
gcc: Command not found/bin/arm-linux-androideabi-
gcc: Command not found/bin/arm-linux-androideabi-
Makefile:254: *** Unsupported target architecture.  Stop.
make[1]: Leaving directory `/root/LuaJIT-2.0.5/src'
make: *** [default] Error 2

我已经尽力了,但不知道。请帮助我,谢谢。

【问题讨论】:

    标签: android-ndk luajit


    【解决方案1】:

    我已经解决了。看起来像是由变量引用引起的错误。我只是尝试将所有参数写在一行中,并且成功了。

    make HOST_CC="gcc -m32" CROSS=/opt/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- TARGET_FLAGS="--sysroot=/opt/android/ndk/platforms/android-14/arch-arm -march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8"
    

    我不是很擅长shell,所以我现在也不知道如何使用变量。幸运的是,我已经成功构建了 LuaJIT。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-16
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 2019-12-06
      • 2013-12-12
      相关资源
      最近更新 更多