[llvm] [PowerPC][JITLink] Support R_PPC64_GOT_TLSGD_PCREL34 (PR #68660)

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 01:03:11 PDT 2023


bzEq wrote:

Since we don't have pwr10 buildbot, I don't add test in `compiler-rt`. Here's the simple example I create and runs on pwr10 machine successfully.
```c++
#include <stdio.h>
#include <iostream>
#include <thread>
#include <vector>

_Thread_local int id;

int main() {
  std::vector<std::thread> vt;
  for (int i = 0; i < 8; ++i) {
    vt.emplace_back([&]() {
        std::cout << &id << std::endl;
      });
  }
  for (auto &t : vt) t.join();
  return 0;
}
```
```
~/llvm/community/build/bin/clang++ -c -O3 -mcpu=pwr10 -fPIC -ftls-model=global-dynamic tls.cc
~/llvm/community/build/bin/llvm-jitlink tls.o --orc-runtime=$HOME/llvm/community/build/lib/clang/18/lib/powerpc64le-unknown-linux-gnu/liborc_rt.a
0x760540000c70
0x760538000c70
0x760538000c90
0x760530000c70
0x760530000c90
0x760530000be0
0x760530000c70
0x760530000c90

https://github.com/llvm/llvm-project/pull/68660


More information about the llvm-commits mailing list