Opened 5 years ago

Closed 5 years ago

#60027 closed defect (fixed)

clang-9.0: static analyzer variant can't be disabled. Error: Cannot disable static analyzer while enabling ARCMT or Z3

Reported by: kencu (Ken) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia)
Port: clang-9.0

Description

We haven't built clang without the static analyzer in a long time, it appears. On clang-9.0, it can't be disabled due to the above error.

It can be disabled on clang-3.7. Somewhere along the line the cmake build system made it so that it can't be disabled, and yet there is an option still to disable it.

Likely have to enable and disable the relevant options as a group (which I suppose suggests an upstream bug to fix, as if you turn off the analyzer, you shouldn't error out if you don't turn off ARCMT as well).

I am not sure at present how far back this "error" goes -- possibly all the way back to the start of the cmake build system that we defaulted to in clang-3.8, but will have to check. In the standard cmake build of clang, both the analyzer and ARCMT default to ON, so perhaps nobody has built clang with the analyzer OFF in a long time...

Change History (3)

comment:1 Changed 5 years ago by kencu (Ken)

Owner: set to kencu
Status: newassigned

comment:2 Changed 5 years ago by kencu (Ken)

Oh, here's a pretty good clue. Jeremy had already turned off CLANG_ENABLE_ARCMT during the lldb build all the way back to llvm-5.0 so that is where it starts:

$ ag CLANG_ENABLE_ARCMT=OFF .
lang/llvm-9.0/Portfile
306:        -DCLANG_ENABLE_ARCMT=OFF \

lang/llvm-7.0/Portfile
290:        -DCLANG_ENABLE_ARCMT=OFF \

lang/llvm-8.0/Portfile
302:        -DCLANG_ENABLE_ARCMT=OFF \

lang/llvm-6.0/Portfile
285:        -DCLANG_ENABLE_ARCMT=OFF \

lang/llvm-devel/Portfile
270:        -DCLANG_ENABLE_ARCMT=OFF \

lang/llvm-5.0/Portfile
295:        -DCLANG_ENABLE_ARCMT=OFF \

Just need to add the same to the clang build, and toggle it on on the +analyzer variant, and we're good to go again I would think.

comment:3 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 7a15ed2d073f57826032e7abd1cb3cef36f2e152/macports-ports (master):

clang-5+: repair analyzer variant toggle

toggling analyzer variant OFF has caused failed builds
since the transition to CMAKE due to a need to also toggle
CLANG_ENABLE_ARCMT in sync with the static analyzer

closes: #60027

Note: See TracTickets for help on using tickets.