[all-commits] [llvm/llvm-project] a78816: [clang][driver] Pass `-femulated-tls` through to t...

Paul Kirth via All-commits all-commits at lists.llvm.org
Mon Apr 10 10:44:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a78816a6b6debb548efbf1717aeeb490df42f401
      https://github.com/llvm/llvm-project/commit/a78816a6b6debb548efbf1717aeeb490df42f401
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2023-04-10 (Mon, 10 Apr 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/test/Driver/emulated-tls.cpp

  Log Message:
  -----------
  [clang][driver] Pass `-femulated-tls` through to the linker in LTO mode

Currently the driver does not propagate the `-f[no-]emulated-tls` flags
to the linker under LTO. This can be surprising when the platform
defaults differ from the flags being passed. A related discussion can be
found in https://reviews.llvm.org/D143619. While the focus there was
RISC-V support, the root cause was that setting `-femualted-tls` and
`-flto` when compiling with Clang resulted in missing symbols because
the platform defaults for Android differed from the flags being passed
to Clang.

This patch changes the Clang driver's behavior to pass the emulated-tls
flags through to the linker when compiling with LTO/ThinLTO.

Reviewed By: phosek, vit9696

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




More information about the All-commits mailing list