clang-repl fails to resolve __emutls_v symbols when using <future> (std::call_once)
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Hi, there appears to be an issue in `clang::Interpreter` (and therefore `clang-repl`) where `__emutls_v` symbols cannot be resolved at runtime.
This is reproducible with Clang 22 on at least Ubuntu 24.04, and I can also reproduce it with Clang 20.
### Reproduction steps
Create a file `issue.cpp`:
```cpp
#include
void issue()
{
std::promise ready;
ready.set_value();
}
```
Then run:
```cpp
$ clang-repl
clang-repl> #include "issue.cpp"
clang-repl> issue
```
### Environment
```sh
$ clang-repl --version
LLVM (http://llvm.org/):
LLVM version 22.1.0-rc1
Optimized build.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
```
Thanks!
Contributor guide
Research direction
Start by reproducing the failure with issue.cpp in clang-repl using the commands in the report, then trace symbol resolution from clang::Interpreter when and std::promise are used. Compare the unresolved __emutls_v symbols with the symbols needed by the same code outside clang-repl. Done means the reported reproduction runs without unresolved-symbol errors on the stated environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100