在armeabi-v7a上编译Boot.Context时的指令无效

时间:2018-11-28 00:35:05

标签: android-ndk boost-context

我正在尝试在Android上使用Boost.Coroutine2,但遇到了一些困难。

使用NDK r18时,从Hunter信息库编译Boost.Context失败,并显示以下“无效指令”错误(r19-beta1根本不起作用,原因是由于缺少cstddef标头伪造的--sysroot值)。

  • 我定位到armeabi-v7a
  • 我使用以下bjam参数:abi=aapcs architecture=arm binary-format=elf
  • 定位arm64-v8a似乎可以工作,但是堆栈指针似乎有点混乱,因为它在某些情况下从调用asm实现的函数返回后就出现了段错误(在其他系统上不会发生) 。我还无法确定哪些指令无效。

您知道为什么无法识别指令集吗?

gcc.compile.asm bin.v2/libs/context/build/gcc-ndk/debug/abi-aapcs/address-model-64/link-static/target-os-android/threading-multi/asm/make_arm64_aapcs_elf_gas.o
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:60:5: error: invalid instruction
    and x0, x0, ~0xF
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:63:5: error: invalid instruction
    sub x0, x0, #0xb0
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:67:14: error: register expected
    str x2, [x0, #0xa0]
             ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:71:9: error: operand must be a register in range [r0, r15]
    adr x1, finish
        ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:72:14: error: register expected
    str x1, [x0, #0x98]
             ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:74:5: error: invalid instruction, did you mean: rev?
    ret x30
    ^
libs/context/src/asm/make_arm64_aapcs_elf_gas.S:78:9: error: operand must be a register in range [r0, r15]
    mov x0, #0
        ^

    "/home/arcanis/android-ndk-r18-beta2/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" "-isystem" "/home/arcanis/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi" "-g" "-DANDROID" "-ffunction-sections" "-funwind-tables" "-fstack-protector-strong" "-no-cano
nical-prefixes" "-march=armv7-a" "-mfloat-abi=softfp" "-mfpu=vfpv3-d16" "-mthumb" "-Wa,--noexecstack" "-Wformat" "-Werror=format-security" "-std=c++11" "--sysroot=/home/arcanis/android-ndk-r18b/sysroot" "-isystem" "/home/arcanis/android-ndk-r18b/sources/cxx-stl/llvm-libc
++/include" "-isystem" "/home/arcanis/android-ndk-r18b/sources/android/support/include" "-isystem" "/home/arcanis/android-ndk-r18b/sources/cxx-stl/llvm-libc++abi/include" "-std=gnu++17" "--target=armv7-none-linux-androideabi16" "--gcc-toolchain=/home/arcanis/android-ndk-
r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64" "-fPIC" -x assembler-with-cpp -O0 -fno-inline -Wall -g  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -I"." -c -o "bin.v2/libs/context/build/gcc-ndk/debug/abi-aapcs/address-model-64/link-static/target-os-andr
oid/threading-multi/asm/make_arm64_aapcs_elf_gas.o" "libs/context/src/asm/make_arm64_aapcs_elf_gas.S"

...failed gcc.compile.asm bin.v2/libs/context/build/gcc-ndk/debug/abi-aapcs/address-model-64/link-static/target-os-android/threading-multi/asm/make_arm64_aapcs_elf_gas.o...

0 个答案:

没有答案