[LU-16961] Clang plugin build system integration Created: 13/Jul/23  Updated: 09/Jan/24  Resolved: 31/Aug/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Tim Day Assignee: Tim Day
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-8191 Candidates for conversion to static f... Open
is related to LU-16518 Fix Clang build errors Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Clang has a plugin system. Compiler extension can be created by making a shared library and loading it via the "-fplugin". This allows for custom warnings and static analyzers.

 

In the past, Lustre has used custom compiler plugins in the past - although they haven't been maintained in a while: https://wiki.whamcloud.com/pages/viewpage.action?pageId=18645101

 

I've developed a plugin which detects functions which ought to be static. Since Clang has an easier time reasoning about static functions, the plugin has the side effect of finding some cases of dead code. This ticket tracks implementing build system support for that plugin (and potential future/past plugins).



 Comments   
Comment by Gerrit Updater [ 13/Jul/23 ]

"Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51659
Subject: LU-16961 clang: plugins and build system integration
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e88f731ed9e485dd01eda249cd9b89b118aa082c

Comment by Gerrit Updater [ 31/Aug/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51659/
Subject: LU-16961 clang: plugins and build system integration
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: d684885098c40fee2951feb410bec739717ac9bc

Comment by Peter Jones [ 31/Aug/23 ]

Landed for 2.16

Comment by Gerrit Updater [ 09/Jan/24 ]

"Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53626
Subject: LU-16961 llite: fix new clang error in statahead.c
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c2630dfc05c866024bc0f76ec64faff3558cb54f

Wrong LU

Generated at Sat Feb 10 03:31:26 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.