This is an archive of the discontinued LLVM Phabricator instance.

[clang][driver] Emit error when enabling emulated tls on unsupported architectures
AbandonedPublic

Authored by paulkirth on Feb 9 2023, 4:29 PM.

Details

Summary

LLVM does not support Emulated TLS for some architectures, like RISCV.
This patch issues an error during options parsing to avoid potential
problems during codegen.

Bug: https://github.com/llvm/llvm-project/issues/59500

Depends on D143619

Diff Detail

Event Timeline

paulkirth created this revision.Feb 9 2023, 4:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 4:29 PM
paulkirth requested review of this revision.Feb 9 2023, 4:29 PM
MaskRay accepted this revision.Feb 9 2023, 4:32 PM
MaskRay added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
6170

Use render and remove the previous Args.AddLastArg(CmdArgs, options::OPT_femulated_tls, options::OPT_fno_emulated_tls);

clang/test/Driver/emulated-tls.cpp
32

--target= for new tests

48

delete trailing blank line

This revision is now accepted and ready to land.Feb 9 2023, 4:32 PM
paulkirth updated this revision to Diff 496290.Feb 9 2023, 5:26 PM

Address comments.

  • use render and remove redundant/incorrect call to AddLastArg.
  • add test to make sure we don't issue an error when emulated TLS is disabled on unsupported platforms
paulkirth marked 3 inline comments as done.Feb 9 2023, 5:27 PM
hiraditya accepted this revision.Feb 9 2023, 5:46 PM

LGTM, thanks for putting this patch.

paulkirth updated this revision to Diff 496529.Feb 10 2023, 9:47 AM

Rebase on parent revision

MaskRay accepted this revision.Feb 10 2023, 10:19 AM

With nits

clang/test/Driver/emulated-tls.cpp
48

Prepend error:

For the NOT pattern, use RISCV-NOT: error: or change FileCheck to FileCheck --implicit-check-not=error:

Address comments.

  • improve FileCheck directive in test
paulkirth marked an inline comment as done.Feb 10 2023, 10:57 AM
paulkirth abandoned this revision.Feb 16 2023, 8:22 AM

Based on discussion at the LLVM RISC-V community call, we're going to support emulated TLS in RISC-V, so we can abandon this patch.