File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 4343
4444SANITIZER_CAPTURE_DIR = "/builddir/gcc-sanitizer-capture"
4545
46+ # use the following flags only if they are supported by gcc in the chroot
47+ GCC_ANALYZER_NEW_FLAGS = [
48+ "-fdiagnostics-text-art-charset=none" ,
49+ ]
50+
51+
4652class PluginProps :
4753 def __init__ (self ):
4854 self .description = "Plugin capturing GCC warnings, optionally with customized compiler flags."
@@ -272,10 +278,13 @@ def csgcca_hook(results, mock):
272278 "disabling the tool" % analyzer_bin , ec = 0 )
273279 return 0
274280
275- # use -fdiagnostics-text-art-charset=none if supported by gcc in the chroot
276- flag = "-fdiagnostics-text-art-charset=none"
277- if 0 == mock .exec_mockbuild_cmd (f"{ cmd } { flag } " ):
278- props .env ["CSGCCA_ADD_OPTS" ] = flag
281+ # check for useful GCC flags that were introduced in newer GCC versions
282+ add_flags = [
283+ flag for flag in GCC_ANALYZER_NEW_FLAGS
284+ if 0 == mock .exec_mockbuild_cmd (f"{ cmd } { flag } " )
285+ ]
286+ if add_flags :
287+ props .env ["CSGCCA_ADD_OPTS" ] = ":" .join (add_flags )
279288
280289 if args .gcc_analyzer_bin :
281290 # create an executable shell script to wrap the custom gcc binary
You can’t perform that action at this time.
0 commit comments