question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suppress MS-style inline assembly clang-tidy error

See original GitHub issue

Hi,

I am getting the following error from clang pretty often: MS-style inline assembly is not available: Unable to find target for this triple (no targets are registered) [clang-diagnostic-error]

I know this is a problem from clang, see https://reviews.llvm.org/D17981. They don’t seem to want to fix this anytime soon… It would be pretty annoying for people to compile LLVM + Clang from scratch and apply the above patch locally just to remove this error. Would it be possible to just filter this one out?

Kind regards,

Jacob

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jcagemancommented, Feb 2, 2018

The only way to resolve it is building llvm and clang-tidy from source and applying the patch described at https://reviews.llvm.org/D17981. The side effect is that your binaries are a bit larger (/care)

1reaction
jcagemancommented, Dec 21, 2017

The error more specifically:

:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um\winnt.h(949): error: MS-style inline assembly is not available: Unable to find target for this triple (no targets are registered) [clang-diagnostic-error]
    __asm    {
    ^

This is on visual studio 2017 by the way, but i also had this on my own tooling on earlier versions. This probably requires a windows.h include.

Edit:

I found the cause, its related to passing -m32 as additional compile flag. Our code only compiles with 32bit, due to some code static_asserting we are actually compiling 32 bit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignore inline assembly related diagnostic errors in clang-tidy
I am trying to use clang-tidy (version 6.0.0) to run some static analysis on a code base that is supposed to run on...
Read more >
Clang-tidy and Clazy analyzer does not work with MSVC ...
With clang-tidy, it fails with errors like: C:\Program Files ... error: MS-style inline assembly is not available: Unable to find target for ...
Read more >
⚙ D17981 [clang-tidy] Fix clang-tidy to support parsing of ...
Summary: Clang-tidy fails when parsing MSVC inline assembly statements. The native target and asm parser aren't initialized.
Read more >
⚙ D149579 [X86][MC] Fix parsing Intel syntax indirect ...
I'm aware of the check-clang failure in CodeGen/ms-inline-asm-functions.c. It seems to be caused by the MS inline assembly being translated ...
Read more >
[llvm-dev] [inline-asm][asm-goto] Supporting ...
Analyzing symbols defined/references in the inline assembly (Bug 28970), taking into account module/file-scope inline assembly. 3. Provide some information ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found