我在oh社区也发现有人碰到这样的问题,但是没有解决。

该模块使用riscv架构编译时会报错`LLVM ERROR: Unsupported architecture for jump tables` · Issue #I6VBCQ · OpenHarmony/communication_bluetooth - Gitee.com

[OHOS ERROR] /usr/bin/env "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-readobj" --nm="../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-nm"  --sofile="communication/bluetooth/libbtframework.z.so"  --output="communication/bluetooth/libbtframework.z.so" -- ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -shared -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos/c++ -Wl,--fatal-warnings -Wl,--build-id=md5 -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,-z,max-page-size=16384 -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-undefined -Wl,--exclude-libs=libunwind_llvm.a -Wl,--exclude-libs=libc++_static.a -Wl,--exclude-libs=libvpx_assembly_arm.a --target=loongarch64-linux-ohos -Werror -Wl,--warn-shared-textrel -Wl,-O2 -Wl,--gc-sections -Wl,--gdb-index --sysroot=obj/third_party/musl -Wl,--allow-shlib-undefined -nostdlib -Lobj/third_party/musl/usr/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos/c++ -Wl,--warn-shared-textrel -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos -o "communication/bluetooth/libbtframework.z.so" @"communication/bluetooth/libbtframework.z.so.rsp" -Wl,-soname="libbtframework.z.so"
[OHOS ERROR] LLVM ERROR: Unsupported architecture for jump tables
[OHOS ERROR] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
[OHOS ERROR] Stack dump:
[OHOS ERROR] 0. Program arguments: /home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld --sysroot=obj/third_party/musl -z now -z relro -z max-page-size=4096 --hash-style=both --enable-new-dtags --eh-frame-hdr -m elf64loongarch -shared -o communication/bluetooth/libbtframework.z.so -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos/c++ -Lobj/third_party/musl/usr/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/12.0.1/lib/loongarch64-linux-ohos -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos/c++ -L../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/loongarch64-linux-ohos -Lobj/third_party/musl/usr/lib/ --fatal-warnings --build-id=md5 -z noexecstack -z now -z relro -z defs --as-needed -z max-page-size=16384 --icf=all --color-diagnostics --no-undefined --exclude-libs=libunwind_llvm.a --exclude-libs=libc++_static.a --exclude-libs=libvpx_assembly_arm.a --warn-shared-textrel -O2 --gc-sections --gdb-index --allow-shlib-undefined --warn-shared-textrel --whole-archive obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_adapter_utils.o obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_gap.o obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_gatt.o obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_gatt_client.o obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_gatt_server.o obj/foundation/communication/bluetooth/frameworks/inner/c_adapter/btframework/ohos_bt_spp.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_a2dp_snk.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_a2dp_src.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_avrcp_ct.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_avrcp_tg.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_ble_advertiser.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_ble_central_manager.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_device_class.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_characteristic.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_client.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_descriptor.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_manager.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_server.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_gatt_service.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_hfp_ag.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_hfp_hf.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_hid_host.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_host.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_map_mce.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_map_mse.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_opp.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_pan.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_pbap_pce.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_pbap_pse.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_proxy_manager.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_remote_device.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_socket.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_socket_inputstream.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_socket_outputstream.o obj/foundation/communication/bluetooth/frameworks/inner/src/btframework/bluetooth_utils.o obj/foundation/communication/bluetooth/services/bluetooth/ipc/libbtipc_static.a commonlibrary/c_utils/libutils.z.so hiviewdfx/hisysevent_native/libhisysevent.z.so hiviewdfx/hilog_native/libhilog.so communication/ipc/libipc_core.z.so systemabilitymgr/samgr/libsamgr_proxy.z.so obj/foundation/communication/bluetooth/services/bluetooth/common/libbtcommon.a thirdparty/bounds_checking_function/libsec_shared.z.so obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libc.so obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libcrypt.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libdl.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libm.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libpthread.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libresolv.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/librt.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libutil.a obj/third_party/musl/usr/lib/loongarch64-linux-ohos/libxnet.a --no-whole-archive obj/third_party/musl/usr/lib/loongarch64-linux-ohos/crti.o ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/18/lib/loongarch64-linux-ohos/clang_rt.crtbegin.o -lunwind -lc++ ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/18/lib/loongarch64-linux-ohos/libclang_rt.builtins.a -lc -lc++abi -ldl -lm ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/18/lib/loongarch64-linux-ohos/libclang_rt.ubsan_minimal.so obj/third_party/musl/usr/lib/loongarch64-linux-ohos/crtn.o ../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/18/lib/loongarch64-linux-ohos/clang_rt.crtend.o -soname=libbtframework.z.so
[OHOS ERROR]  #0 0x000055d0a16e2e48 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x7e7e48)
[OHOS ERROR]  #1 0x000055d0a16e0dbe llvm::sys::RunSignalHandlers() (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x7e5dbe)
[OHOS ERROR]  #2 0x000055d0a16e378d SignalHandler(int) Signals.cpp:0:0
[OHOS ERROR]  #3 0x00007f15a5b3d420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
[OHOS ERROR]  #4 0x00007f15a541600b raise /build/glibc-BHL3KM/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
[OHOS ERROR]  #5 0x00007f15a53f5859 abort /build/glibc-BHL3KM/glibc-2.31/stdlib/abort.c:81:7
[OHOS ERROR]  #6 0x000055d0a1696f7c llvm::report_fatal_error(llvm::Twine const&, bool) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x79bf7c)
[OHOS ERROR]  #7 0x000055d0a1696da6 (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x79bda6)
[OHOS ERROR]  #8 0x000055d0a388b1ee (anonymous namespace)::LowerTypeTestsModule::lower() LowerTypeTests.cpp:0:0
[OHOS ERROR]  #9 0x000055d0a3882c8b llvm::LowerTypeTestsPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x2987c8b)
[OHOS ERROR] #10 0x000055d0a32a339d llvm::detail::PassModel<llvm::Module, llvm::LowerTypeTestsPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x23a839d)
[OHOS ERROR] #11 0x000055d0a4757922 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x385c922)
[OHOS ERROR] #12 0x000055d0a2fb83c6 llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char>> const&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x20bd3c6)
[OHOS ERROR] #13 0x000055d0a2fb87cd llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x20bd7cd)
[OHOS ERROR] #14 0x000055d0a2fad349 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x20b2349)
[OHOS ERROR] #15 0x000055d0a2facc1d llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::function<llvm::Expected<std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>> (unsigned int, llvm::StringRef, llvm::Twine const&)>) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x20b1c1d)
[OHOS ERROR] #16 0x000055d0a184d54c lld::elf::BitcodeCompiler::compile() (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x95254c)
[OHOS ERROR] #17 0x000055d0a17d9794 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::support::endianness)1, true>>(bool) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x8de794)
[OHOS ERROR] #18 0x000055d0a17d59d2 lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x8da9d2)
[OHOS ERROR] #19 0x000055d0a17c9754 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x8ce754)
[OHOS ERROR] #20 0x000055d0a17c7f43 lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x8ccf43)
[OHOS ERROR] #21 0x000055d0a17141a6 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x8191a6)
[OHOS ERROR] #22 0x000055d0a167db72 lld_main(int, char**, llvm::ToolContext const&) (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x782b72)
[OHOS ERROR] #23 0x000055d0a167e021 main (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x783021)
[OHOS ERROR] #24 0x00007f15a53f7083 __libc_start_main /build/glibc-BHL3KM/glibc-2.31/csu/../csu/libc-start.c:342:3
[OHOS ERROR] #25 0x000055d0a167d79e _start (/home/water/openharmony_v3.2.2/out/pi2/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/ld.lld+0x78279e)
[OHOS ERROR] clang++: error: unable to execute command: Aborted (core dumped)
[OHOS ERROR] clang++: error: linker command failed due to signal (use -v to see invocation)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

参考openharmony社区的issue,问题得以解决:

[R&D][RISC_V] llvm12 compile bluetooth fail in risc-v · Issue #I75J9V · OpenHarmony/third_party_llvm-project - Gitee.com

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐