[all-commits] [llvm/llvm-project] 0e4cf8: [clang] [MinGW] Don't mark emutls variables as DSO...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Thu May 27 13:51:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e4cf807aeaf54a10e02176498a7df13ac722b37
      https://github.com/llvm/llvm-project/commit/0e4cf807aeaf54a10e02176498a7df13ac722b37
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGen/dso-local-executable.c

  Log Message:
  -----------
  [clang] [MinGW] Don't mark emutls variables as DSO local

These actually can be automatically imported from another DLL. (This
works properly as long as the actual implementation of emutls is
linked dynamically from e.g. libgcc; if the implementation comes from
compiler-rt or a statically linked libgcc, it doesn't work as intended.)

This fixes PR50146 and https://github.com/msys2/MINGW-packages/issues/8706
(fixing calling std::call_once in a dynamically linked libstdc++);
since f73183958482602c4588b0f4a1c3a096e7542947 the dso_local attribute
on the TLS variable affected the actual generated code for accessing
the emutls variable.

The dso_local attribute on the emutls variable made those accesses to
use 32 bit relative addressing in code, which requires runtime pseudo
relocations in the text section, and breaks entirely if the actual
other variable ends up loaded too far away in the virtual address
space.

Differential Revision: https://reviews.llvm.org/D102970


  Commit: b3ceffdf35e5018958891215000b010ac614dbcc
      https://github.com/llvm/llvm-project/commit/b3ceffdf35e5018958891215000b010ac614dbcc
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M libcxx/test/libcxx/debug/extern-templates.sh.cpp

  Log Message:
  -----------
  [libcxx] [test] Convert an XFAIL LIBCXX-WINDOWS-FIXME into UNSUPPORTED with explanation

Differential Revision: https://reviews.llvm.org/D103149


Compare: https://github.com/llvm/llvm-project/compare/aad878f11279...b3ceffdf35e5


More information about the All-commits mailing list