gpt4 book ai didi

c++ - 在 orcjit 或 lli 中运行 RxCpp 时出现 llvm 错误 : Relocation not implemented yet!

转载 作者:可可西里 更新时间:2023-11-01 18:39:27 27 4
gpt4 key购买 nike

我想在 llvm 的 IR 解释器 lli 中运行 RxCpp 示例。

不幸的是,在 lli 中运行任何 RxCpp 示例都失败了:

git clone https://github.com/Reactive-Extensions/RxCpp.git --depth 1
cd RxCpp/Rx/v2/examples/pythogerian
clang++ -S -emit-llvm -fno-use-cxa-exit -I../../src main.cpp
lli main.ll

错误信息:

Relocation type not implemented yet!
UNREACHABLE executed at llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:232!

问题:

这个错误到底是什么意思? - 在 llvm 的 orc-jit 中做了哪些不满足的假设?

有解决办法吗? - 是否有我可以应用的任何 LLVM-IR 转换来使这项工作(例如通过编译器标志)?

RxCpp 使用了哪些特殊功能导致 llvm 的 orcjit 出现此问题?

测试于:

clang version 5.0.0 (https://github.com/llvm-mirror/clang.git 6c9e299494de2a5b0425e46bc937f29a05128252) 
clang version 4.0.0-+rc1-1 (tags/RELEASE_400/rc1)
clang version 3.9.0-1 (tags/RELEASE_390/final)
clang version 3.8.1-12 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

最佳答案

似乎是 thread_local/__thread 的问题。

rx-utils.hpp 中的 #define RXCPP_THREAD_LOCAL __thread 替换为空格“修复”了这个问题。

原因是 LLVM 后端出现故障,因为它尚不支持 TLS。这与 Bug 21431 有关以及 llvm 的 RuntimeDyld 中缺少一些重定位策略这一事实。

关于c++ - 在 orcjit 或 lli 中运行 RxCpp 时出现 llvm 错误 : Relocation not implemented yet!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42024276/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com