linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tool/perf: fix perf compiling errors
@ 2017-09-21  5:59 Li Zhijian
  0 siblings, 0 replies; 3+ messages in thread
From: Li Zhijian @ 2017-09-21  5:59 UTC (permalink / raw)
  To: peterz, mingo, acme, alexander.shishkin, linux-kernel
  Cc: philip.li, Li Zhijian

From: Li Zhijian <lizhiijian@cn.fujitsu.com>

since f045b8c, we failed to build perf with LIBCLANGLLVM=1, this patch is to
fix the following compiling errors
--------------
lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/perf$ make LLVM_CONFIG=/usr/bin/llvm-config-3.9 LIBCLANGLLVM=1
  BUILD:   Doing 'make -j8' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ OFF ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Makefile.config:584: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:809: No openjdk development package found, please install JDK package
  CXX      util/c++/clang.o
  CXX      util/c++/clang-test.o
In file included from /home/lizj/linux/tools/include/linux/list.h:5:0,
                 from /home/lizj/linux/tools/perf/util/namespaces.h:13,
                 from /home/lizj/linux/tools/perf/util/util.h:15,
                 from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
                 from util/c++/clang-c.h:5,
                 from util/c++/clang-test.cpp:2:
/home/lizj/linux/tools/include/linux/list.h: In function ‘void list_del(list_head*)’:
/home/lizj/linux/tools/include/linux/poison.h:14:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
 # define POISON_POINTER_DELTA 0
                               ^
/home/lizj/linux/tools/include/linux/poison.h:22:41: note: in expansion of macro ‘POISON_POINTER_DELTA’
 #define LIST_POISON1  ((void *) 0x100 + POISON_POINTER_DELTA)
                                         ^
/home/lizj/linux/tools/include/linux/list.h:107:16: note: in expansion of macro ‘LIST_POISON1’
  entry->next = LIST_POISON1;
                ^
In file included from /home/lizj/linux/tools/perf/util/namespaces.h:13:0,
                 from /home/lizj/linux/tools/perf/util/util.h:15,
                 from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
                 from util/c++/clang-c.h:5,
                 from util/c++/clang-test.cpp:2:
/home/lizj/linux/tools/include/linux/list.h:107:14: error: invalid conversion from ‘void*’ to ‘list_head*’ [-fpermissive]
--------------

Signed-off-by: Li Zhijian <lizhiijian@cn.fujitsu.com>
---
 tools/perf/util/namespaces.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
index 05d8260..2f88435 100644
--- a/tools/perf/util/namespaces.h
+++ b/tools/perf/util/namespaces.h
@@ -10,7 +10,6 @@
 #define __PERF_NAMESPACES_H
 
 #include "../perf.h"
-#include <linux/list.h>
 #include <linux/refcount.h>
 
 struct namespaces_event;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] tool/perf: fix perf compiling errors
@ 2017-09-21  6:01 Li Zhijian
  2017-09-21 15:01 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zhijian @ 2017-09-21  6:01 UTC (permalink / raw)
  To: peterz, mingo, acme, alexander.shishkin, linux-kernel
  Cc: philip.li, Li Zhijian

since f045b8c, we failed to build perf with LIBCLANGLLVM=1, this patch is to
fix the following compiling errors
--------------
lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/perf$ make LLVM_CONFIG=/usr/bin/llvm-config-3.9 LIBCLANGLLVM=1
  BUILD:   Doing 'make -j8' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ OFF ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Makefile.config:584: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:809: No openjdk development package found, please install JDK package
  CXX      util/c++/clang.o
  CXX      util/c++/clang-test.o
In file included from /home/lizj/linux/tools/include/linux/list.h:5:0,
                 from /home/lizj/linux/tools/perf/util/namespaces.h:13,
                 from /home/lizj/linux/tools/perf/util/util.h:15,
                 from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
                 from util/c++/clang-c.h:5,
                 from util/c++/clang-test.cpp:2:
/home/lizj/linux/tools/include/linux/list.h: In function ‘void list_del(list_head*)’:
/home/lizj/linux/tools/include/linux/poison.h:14:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
 # define POISON_POINTER_DELTA 0
                               ^
/home/lizj/linux/tools/include/linux/poison.h:22:41: note: in expansion of macro ‘POISON_POINTER_DELTA’
 #define LIST_POISON1  ((void *) 0x100 + POISON_POINTER_DELTA)
                                         ^
/home/lizj/linux/tools/include/linux/list.h:107:16: note: in expansion of macro ‘LIST_POISON1’
  entry->next = LIST_POISON1;
                ^
In file included from /home/lizj/linux/tools/perf/util/namespaces.h:13:0,
                 from /home/lizj/linux/tools/perf/util/util.h:15,
                 from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
                 from util/c++/clang-c.h:5,
                 from util/c++/clang-test.cpp:2:
/home/lizj/linux/tools/include/linux/list.h:107:14: error: invalid conversion from ‘void*’ to ‘list_head*’ [-fpermissive]
--------------

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/perf/util/namespaces.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/util/namespaces.h b/tools/perf/util/namespaces.h
index 05d8260..2f88435 100644
--- a/tools/perf/util/namespaces.h
+++ b/tools/perf/util/namespaces.h
@@ -10,7 +10,6 @@
 #define __PERF_NAMESPACES_H
 
 #include "../perf.h"
-#include <linux/list.h>
 #include <linux/refcount.h>
 
 struct namespaces_event;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tool/perf: fix perf compiling errors
  2017-09-21  6:01 [PATCH] tool/perf: fix perf compiling errors Li Zhijian
@ 2017-09-21 15:01 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-09-21 15:01 UTC (permalink / raw)
  To: Li Zhijian; +Cc: peterz, mingo, alexander.shishkin, linux-kernel, philip.li

Em Thu, Sep 21, 2017 at 02:01:13PM +0800, Li Zhijian escreveu:
> since f045b8c, we failed to build perf with LIBCLANGLLVM=1, this patch is to
> fix the following compiling errors
> --------------
> lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/perf$ make LLVM_CONFIG=/usr/bin/llvm-config-3.9 LIBCLANGLLVM=1
>   CXX      util/c++/clang-test.o
> In file included from /home/lizj/linux/tools/include/linux/list.h:5:0,
>                  from /home/lizj/linux/tools/perf/util/namespaces.h:13,
>                  from /home/lizj/linux/tools/perf/util/util.h:15,
>                  from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
>                  from util/c++/clang-c.h:5,
>                  from util/c++/clang-test.cpp:2:
> /home/lizj/linux/tools/include/linux/list.h: In function ‘void list_del(list_head*)’:
> /home/lizj/linux/tools/include/linux/poison.h:14:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
>  # define POISON_POINTER_DELTA 0
>                                ^
> /home/lizj/linux/tools/include/linux/poison.h:22:41: note: in expansion of macro ‘POISON_POINTER_DELTA’
>  #define LIST_POISON1  ((void *) 0x100 + POISON_POINTER_DELTA)
>                                          ^
> /home/lizj/linux/tools/include/linux/list.h:107:16: note: in expansion of macro ‘LIST_POISON1’
>   entry->next = LIST_POISON1;
>                 ^
> In file included from /home/lizj/linux/tools/perf/util/namespaces.h:13:0,
>                  from /home/lizj/linux/tools/perf/util/util.h:15,
>                  from /home/lizj/linux/tools/perf/util/util-cxx.h:20,
>                  from util/c++/clang-c.h:5,
>                  from util/c++/clang-test.cpp:2:
> /home/lizj/linux/tools/include/linux/list.h:107:14: error: invalid conversion from ‘void*’ to ‘list_head*’ [-fpermissive]


> +++ b/tools/perf/util/namespaces.h
> @@ -10,7 +10,6 @@
>  #define __PERF_NAMESPACES_H
>  
>  #include "../perf.h"
> -#include <linux/list.h>
>  #include <linux/refcount.h>

Well, you can't do that, as namespaces.h needs list.h, a bit after te
above hunk:

  9 #ifndef __PERF_NAMESPACES_H 
 10 #define __PERF_NAMESPACES_H 
 11  
 12 #include "../perf.h" 
 13 #include <linux/list.h> 
 14 #include <linux/refcount.h> 
 15  
 16 struct namespaces_event; 
 17  
 18 struct namespaces { 
 19         struct list_head list; 
 20         u64 end_time; 
 21         struct perf_ns_link_info link_info[]; 
 22 }; 


Can you try with the following patch instead?


diff --git a/tools/include/linux/poison.h b/tools/include/linux/poison.h
index 51334edec506..f306a7642509 100644
--- a/tools/include/linux/poison.h
+++ b/tools/include/linux/poison.h
@@ -14,6 +14,10 @@
 # define POISON_POINTER_DELTA 0
 #endif
 
+#ifdef __cplusplus
+#define LIST_POISON1  NULL
+#define LIST_POISON2  NULL
+#else
 /*
  * These are non-NULL pointers that will result in page faults
  * under normal circumstances, used to verify that nobody uses
@@ -21,6 +25,7 @@
  */
 #define LIST_POISON1  ((void *) 0x100 + POISON_POINTER_DELTA)
 #define LIST_POISON2  ((void *) 0x200 + POISON_POINTER_DELTA)
+#endif
 
 /********** include/linux/timer.h **********/
 /*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-21 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21  6:01 [PATCH] tool/perf: fix perf compiling errors Li Zhijian
2017-09-21 15:01 ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21  5:59 Li Zhijian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).