On Sun, Aug 18, 2019 at 02:28:16PM -0700, Guenter Roeck wrote:
> On Sun, Aug 18, 2019 at 09:40:32PM +0200, Jiri Olsa wrote:
> > On Sun, Aug 18, 2019 at 07:04:36AM -0700, Guenter Roeck wrote:
> > > On Sun, Jul 21, 2019 at 01:24:15PM +0200, Jiri Olsa wrote:
> > > > Adding perf_cpu_map struct into libperf.
> > > > 
> > > > It's added as a declaration into into:
> > > >   include/perf/cpumap.h
> > > > which will be included by users.
> > > > 
> > > > The perf_cpu_map struct definition is added into:
> > > >   include/internal/cpumap.h
> > > > 
> > > > which is not to be included by users, but shared
> > > > within perf and libperf.
> > > > 
> > > > We tried the total separation of the perf_cpu_map struct
> > > > in libperf, but it lead to complications and much bigger
> > > > changes in perf code, so we decided to share the declaration.
> > > > 
> > > > Link: 
> > > > http://lkml.kernel.org/n/[email protected]
> > > > Signed-off-by: Jiri Olsa <[email protected]>
> > > 
> > > Hi,
> > > 
> > > this patch causes out-of-tree builds (make O=<destdir>) to fail.
> > > 
> > > In file included from tools/include/asm/atomic.h:6:0,
> > >                  from include/linux/atomic.h:5,
> > >            from tools/include/linux/refcount.h:41,
> > >            from cpumap.c:4: 
> > > tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:
> > > fatal error: asm/cmpxchg.h: No such file or directory
> > > 
> > > Bisect log attached.
> > 
> > hi,
> > I dont see any problem with v5.3-rc4, could you please send
> > the full compilation log (after make clean) from:
> > 
> >   $ make V=1 <your options>
> > 
> > also I can't make sense of that bisect, because I can't find
> > some of those commits.. what tree are you in?
> > 
> This is with -next, not with mainline. More specifically, with
> next-20190816, though the problem has been seen since at least
> next-20190801. Mainline builds fine.
> 
> Here is the script I used to bisect the problem:
> 
> make mrproper
> rm -rf /tmp/linux
> mkdir /tmp/linux
> make ARCH=x86_64 O=/tmp/linux defconfig
> make -j40 ARCH=x86_64 O=/tmp/linux tools/perf
> 
> It looks like the problem is related to "ARCH=x86_64". In mainline,
> x86_64 is replaced in the build command with x86. This is no longer
> the case, and make now tries to include from tools/arch/x86_64/include/,
> which doesn't exist. As it turns out, O=<destdir> is not needed to
> reproduce the problem, only ARCH=x86_64 (or ARCH=i386).

aaargh.. you're right ;-) it's the SRCARCH, which should
be used in libperf instead of ARCH

change below fixes that for me

thanks,
jirka


---
diff --git a/tools/perf/lib/Makefile b/tools/perf/lib/Makefile
index 8a9ae50818e4..a67efb8d9d39 100644
--- a/tools/perf/lib/Makefile
+++ b/tools/perf/lib/Makefile
@@ -59,7 +59,7 @@ else
   CFLAGS := -g -Wall
 endif
 
-INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include 
-I$(srctree)/tools/arch/$(ARCH)/include/ 
-I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include 
-I$(srctree)/tools/arch/$(SRCARCH)/include/ 
-I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)

Reply via email to