[CRIU] [PATCH] make: allow to change a compiler

Andrew Vagin avagin at parallels.com
Fri Jun 21 04:16:21 EDT 2013


Sorry guys. The CRIU code is correct. Looks like a bug is in the scan-build script.

diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build
index 22d5289..cb79903 100755
--- a/tools/scan-build/scan-build
+++ b/tools/scan-build/scan-build
@@ -1017,10 +1017,10 @@ sub RunBuildCommand {
     shift @$Args;
     unshift @$Args, $CXXAnalyzer;
   }
-  elsif ($IgnoreErrors) {
-    if ($Cmd eq "make" or $Cmd eq "gmake") {
-      AddIfNotPresent($Args, "CC=$CCAnalyzer");
-      AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+  elsif ($Cmd eq "make" or $Cmd eq "gmake") {
+    AddIfNotPresent($Args, "CC=$CCAnalyzer");
+    AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+    if ($IgnoreErrors) {
       AddIfNotPresent($Args,"-k");
       AddIfNotPresent($Args,"-i");
     }

Thanks All for the help.

On Fri, Jun 21, 2013 at 02:26:34PM +0400, Cyrill Gorcunov wrote:
> On Fri, Jun 21, 2013 at 02:10:14PM +0400, Cyrill Gorcunov wrote:
> > On Fri, Jun 21, 2013 at 01:46:17PM +0400, Andrew Vagin wrote:
> > > 
> > > Looks-ugly-for: Andrew Vagin <avagin at parallels.com> ;)
> > 
> > Guys, would one below work for all? (untested)
> 
> As Andrew said me -- it won't work for all. So lets shrink
> workable patch to bring very little ugly snippet.

> From 2a00c7e0cc9d43863240df3920f431975f8e7034 Mon Sep 17 00:00:00 2001
> From: Andrey Vagin <avagin at openvz.org>
> Date: Fri, 21 Jun 2013 05:02:57 +0400
> Subject: [PATCH] make: Allow to change a compiler if no CROSS_COMPILE prefix
>  defined
> 
> For clang-analyzer we need to redefine CC variable, but then
> it become imposibble to use CROSS_COMPILE prefix, thus make
> a little trick to be able to use both.
> 
> Reported-by: Andrew Vagin <avagin at parallels.com>
> CC: Chanho Park <chanho61.park at samsusng.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 125b5b3..edbaf9b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -26,8 +26,13 @@ include Makefile.config
>  FIND		:= find
>  CSCOPE		:= cscope
>  RM		:= rm -f
> -LD		:= $(CROSS_COMPILE)ld
> +
> +ifeq ($(CROSS_COMPILE),)
> +CC		?= gcc
> +else
>  CC		:= $(CROSS_COMPILE)gcc
> +endif
> +LD		:= $(CROSS_COMPILE)ld
>  NM		:= $(CROSS_COMPILE)nm
>  SH		:= bash
>  MAKE		:= make
> -- 
> 1.8.1.4
> 



More information about the CRIU mailing list