Re: [PATCHv2 00/36] perf tools: New build framework
From: Jiri Olsa
Date: Mon Jan 19 2015 - 07:15:09 EST
On Fri, Jan 16, 2015 at 03:15:52PM +0100, Jiri Olsa wrote:
> On Fri, Jan 16, 2015 at 01:49:10PM +0000, Mark Rutland wrote:
> > Hi,
> >
> > [...]
> >
> > > > > > I just tried a cross-build for arm, and that blew up when trying to do
> > > > > > something with arch/arm/util/libperf-in.o (log below). I bisected that
> > > > > > to f169fbc4c59dd9d4 "perf build: Add arch x86 objects building". I'm
> > > > > > looking into why now.
> > > > >
> > > > > I get a similar failure doing a native arm64 build. I think the problem is
> > > > > because the arch/ files for arm and arm64 aren't always required (i.e. there
> > > > > are configurations where nothing is built under there) and, consequently,
> > > > > libperf-in.o isn't actually needed and we try to link against something that
> > > > > doesn't exist.
> > > >
> > > > exactly ;-) I'll spin v3 shortly..
> > >
> > > this fixes the issue for me
> > >
> > > jirka
> > >
> > >
> > > ---
> > > diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
> > > index d35b66014992..396b33b124d1 100644
> > > --- a/tools/build/Makefile.build
> > > +++ b/tools/build/Makefile.build
> > > @@ -52,7 +52,7 @@ quiet_cmd_cc_s_c = AS $@
> > >
> > > # Link agregate command
> > > quiet_cmd_ld_multi = LD $@
> > > - cmd_ld_multi = $(LD) -r -o $@ $^
> > > + cmd_ld_multi = $(LD) -r -o $@ $(wildcard $^)
> > >
> > > # Build rules
> > > $(OUTPUT)%.o: %.c FORCE
> > >
> >
> > Unfortunately that doesn't seem to be sufficient for me when
> > cross-compiling. It looks like it supresses the warning from Make, but
> > then LD explodes anyway because it wasn't provided any input files (log
> > below).
>
> argh.. right, when there are no source objects at all :-\ fix is comming ;-)
ok, for a minute I forgot I'm stealing this from kbuild..
aaand they have a solution of course ;-)
so I'm now always creating $(obj)-in.o objects (even empty ones),
and it seems to work nicely.. as in kbuild ;-)
the update 'perf/build' branch' with the fix is in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/build
I tried on arm64,ppc64,s390,x86_64,i386
I'll spin v3 shortly (after doc updates), but any testing would be great
thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/