From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbdIUPBp (ORCPT ); Thu, 21 Sep 2017 11:01:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbdIUPBn (ORCPT ); Thu, 21 Sep 2017 11:01:43 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E232121EA8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Thu, 21 Sep 2017 12:01:38 -0300 From: Arnaldo Carvalho de Melo To: Li Zhijian Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, philip.li@intel.com Subject: Re: [PATCH] tool/perf: fix perf compiling errors Message-ID: <20170921150138.GB29668@kernel.org> References: <1505973673-2424-1-git-send-email-lizhijian@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1505973673-2424-1-git-send-email-lizhijian@cn.fujitsu.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > #include 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 14 #include 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 **********/ /*