llvm / llvm/llvm-project

clang-repl fails to resolve __emutls_v symbols when using <future> (std::call_once)

Open
#190,625 0 comments 0 reactions 0 assignees View on GitHub
clang-repl
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.