LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

HowTo compile with UBsan

Newer CVI releases are based on clang and so I want to use all the power of clang.

How can I enable UndefinedBehaviorSanitizer (UBSan) in CVI?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 5
(2,354 Views)

Hi vix,

 

UndefinedBehaviorSanitizer was introduced in LLVM 3.8 and CVI is using LLVM 3.3 so you cannot use UBSan directly in CVI.

You can try to install the version of LLVM you want and use it in CVI through external compiler support.

Message 2 of 5
(2,291 Views)

Hi Razvan_Pora

I try to summarize what I should do to be able to use UBSan in CVI.

  1. download and install a newer release of LLVM (from 3.8 onwards)
    • can you confirm that I can install whatever version I like (up to the latest 8.0.1)?
  2. configure the external compiler in CVI following this document and this one
  3. pass the proper flags to clang command line (-fsanitize=...)

Have you already tried to do this activity, and so I can be almost sure it works?

Or is you suggestion a "should be possible" only?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 5
(2,282 Views)

Hi vix,

 

You can use whatever LLVM version you want as long as you pass proper flags to clang. But you need to know that the compiler is used only for release configuration and you cannot debug your applications built with external compiler from within CVI environment.

 

To answer your other question, I have not tried this idea personally but if you pass proper flags to clang I think you have a pretty good chance to get it working.

0 Kudos
Message 4 of 5
(2,259 Views)

But you need to know that the compiler is used only for release configuration and you cannot debug your applications built with external compiler from within CVI environment.

Not so useful, as an option.

 


I have not tried this idea personally but if you pass proper flags to clang I think you have a pretty good chance to get it working.

I have no time now for a new beta testing phase, sorry

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 5
(2,247 Views)