llvm错误:搬迁尚未实施!在orcjit或lli中运行RxCpp时

Gae*_*ano 7 c++ llvm clang rxcpp lli

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

不幸的是,在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
Run Code Online (Sandbox Code Playgroud)

错误信息:

Relocation type not implemented yet!
UNREACHABLE executed at llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:232!
Run Code Online (Sandbox Code Playgroud)

问题:

这个错误究竟意味着什么? - 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
Run Code Online (Sandbox Code Playgroud)

Gae*_*ano 1

thread_local似乎是/的问题__thread

用空格替换#define RXCPP_THREAD_LOCAL __threadin可“修复”此问题。rx-utils.hpp

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