linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: unbreak 'make tools/*'
@ 2015-01-29  4:47 Brian Norris
  2015-02-02 23:43 ` Brian Norris
  2015-03-19 13:39 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 6+ messages in thread
From: Brian Norris @ 2015-01-29  4:47 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kernel, linux-kbuild, Brian Norris, David Howells,
	Borislav Petkov, Arnaldo Carvalho de Melo, Sam Ravnborg

The following targets should be supported from the top-level source
directory, but were broken by commit 7e1c04779efd ("kbuild: Use relative
path for $(objtree)"):

 $ make tools/
 $ make tools/perf
 $ make O=$(BUILDDIR) tools/perf

The tools/ and tools/% targets are passing the top-level build directory
as an O= argument, so we need a full path, not a relative one, as the
$(O) variable will be reinterpreted by the sub-makefile.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Michal Marek <mmarek@suse.cz>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 95a0e827ecd3..59033c8bf93a 100644
--- a/Makefile
+++ b/Makefile
@@ -1496,11 +1496,11 @@ image_name:
 # Clear a bunch of variables before executing the submake
 tools/: FORCE
 	$(Q)mkdir -p $(objtree)/tools
-	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/
+	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/
 
 tools/%: FORCE
 	$(Q)mkdir -p $(objtree)/tools
-	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/ $*
+	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/ $*
 
 # Single targets
 # ---------------------------------------------------------------------------
-- 
2.3.0.rc1


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

* Re: [PATCH] tools: unbreak 'make tools/*'
  2015-01-29  4:47 [PATCH] tools: unbreak 'make tools/*' Brian Norris
@ 2015-02-02 23:43 ` Brian Norris
  2015-02-03  0:07   ` Arnaldo Carvalho de Melo
  2015-03-19 13:39 ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 6+ messages in thread
From: Brian Norris @ 2015-02-02 23:43 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kernel, linux-kbuild, David Howells, Borislav Petkov,
	Arnaldo Carvalho de Melo, Sam Ravnborg

Ping?

On Wed, Jan 28, 2015 at 08:47:36PM -0800, Brian Norris wrote:
> The following targets should be supported from the top-level source
> directory, but were broken by commit 7e1c04779efd ("kbuild: Use relative
> path for $(objtree)"):
> 
>  $ make tools/
>  $ make tools/perf
>  $ make O=$(BUILDDIR) tools/perf
> 
> The tools/ and tools/% targets are passing the top-level build directory
> as an O= argument, so we need a full path, not a relative one, as the
> $(O) variable will be reinterpreted by the sub-makefile.
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Michal Marek <mmarek@suse.cz>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 95a0e827ecd3..59033c8bf93a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1496,11 +1496,11 @@ image_name:
>  # Clear a bunch of variables before executing the submake
>  tools/: FORCE
>  	$(Q)mkdir -p $(objtree)/tools
> -	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/
> +	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/
>  
>  tools/%: FORCE
>  	$(Q)mkdir -p $(objtree)/tools
> -	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/ $*
> +	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/ $*
>  
>  # Single targets
>  # ---------------------------------------------------------------------------
> -- 
> 2.3.0.rc1
> 

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

* Re: [PATCH] tools: unbreak 'make tools/*'
  2015-02-02 23:43 ` Brian Norris
@ 2015-02-03  0:07   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-02-03  0:07 UTC (permalink / raw)
  To: Brian Norris
  Cc: Michal Marek, linux-kernel, linux-kbuild, David Howells,
	Borislav Petkov, Sam Ravnborg

Em Mon, Feb 02, 2015 at 03:43:09PM -0800, Brian Norris escreveu:
> Ping?

Thanks for submitting the patch, its just that I am busy at the moment,
preparing for travel, I will process this patch eventually.

- Arnaldo
 
> On Wed, Jan 28, 2015 at 08:47:36PM -0800, Brian Norris wrote:
> > The following targets should be supported from the top-level source
> > directory, but were broken by commit 7e1c04779efd ("kbuild: Use relative
> > path for $(objtree)"):
> > 
> >  $ make tools/
> >  $ make tools/perf
> >  $ make O=$(BUILDDIR) tools/perf
> > 
> > The tools/ and tools/% targets are passing the top-level build directory
> > as an O= argument, so we need a full path, not a relative one, as the
> > $(O) variable will be reinterpreted by the sub-makefile.
> > 
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > Cc: Michal Marek <mmarek@suse.cz>
> > ---
> >  Makefile | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 95a0e827ecd3..59033c8bf93a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1496,11 +1496,11 @@ image_name:
> >  # Clear a bunch of variables before executing the submake
> >  tools/: FORCE
> >  	$(Q)mkdir -p $(objtree)/tools
> > -	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/
> > +	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/
> >  
> >  tools/%: FORCE
> >  	$(Q)mkdir -p $(objtree)/tools
> > -	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(objtree) subdir=tools -C $(src)/tools/ $*
> > +	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(CURDIR) subdir=tools -C $(src)/tools/ $*
> >  
> >  # Single targets
> >  # ---------------------------------------------------------------------------
> > -- 
> > 2.3.0.rc1
> > 

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

* Re: [PATCH] tools: unbreak 'make tools/*'
  2015-01-29  4:47 [PATCH] tools: unbreak 'make tools/*' Brian Norris
  2015-02-02 23:43 ` Brian Norris
@ 2015-03-19 13:39 ` Arnaldo Carvalho de Melo
  2015-03-19 14:20   ` Jiri Olsa
  1 sibling, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-19 13:39 UTC (permalink / raw)
  To: Brian Norris, Jiri Olsa
  Cc: Michal Marek, linux-kernel, linux-kbuild, David Howells,
	Borislav Petkov, Sam Ravnborg

Em Wed, Jan 28, 2015 at 08:47:36PM -0800, Brian Norris escreveu:
> The following targets should be supported from the top-level source
> directory, but were broken by commit 7e1c04779efd ("kbuild: Use relative
> path for $(objtree)"):
 
>  $ make tools/
>  $ make tools/perf
>  $ make O=$(BUILDDIR) tools/perf
 
> The tools/ and tools/% targets are passing the top-level build directory
> as an O= argument, so we need a full path, not a relative one, as the
> $(O) variable will be reinterpreted by the sub-makefile.
 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Michal Marek <mmarek@suse.cz>

After this patch:

$ make mrproper
[acme@ssdandy linux]$ make tools/
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
Possible targets:

  acpi       - ACPI tools
  cgroup     - cgroup tools
  cpupower   - a tool for all things x86 CPU power
<SNIP>
  vm         - misc vm tools
  x86_energy_perf_policy - Intel energy policy tool
  tmon       - thermal monitoring and tuning tool

You can do:
 $ make -C tools/ <tool>_install

  from the kernel command line to build and install one of
  the tools above

  $ make tools/install

  installs all tools.

Cleaning targets:

  all of the above with the "_clean" string appended cleans
    the respective build directory.
  clean: a summary clean target to clean _all_ folders
[acme@ssdandy linux]$

[acme@ssdandy linux]$ make allyesconfig
scripts/kconfig/conf --allyesconfig Kconfig
#
# configuration written to .config
#
[acme@ssdandy linux]$ make tools/
scripts/kconfig/conf --silentoldconfig Kconfig
scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler
Possible targets:

  acpi       - ACPI tools
  cgroup     - cgroup tools
  cpupower   - a tool for all things x86 CPU power
<SNIP>
  vm         - misc vm tools
  x86_energy_perf_policy - Intel energy policy tool
  tmon       - thermal monitoring and tuning tool

You can do:
 $ make -C tools/ <tool>_install

  from the kernel command line to build and install one of
  the tools above

  $ make tools/install

  installs all tools.

Cleaning targets:

  all of the above with the "_clean" string appended cleans
    the respective build directory.
  clean: a summary clean target to clean _all_ folders
[acme@ssdandy linux]$

--------------------------------------------------------

Better than before, but can't we avoid these two lines:

scripts/kconfig/conf --silentoldconfig Kconfig
scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler

--------------------------------------------------------

And the need for a .config file to be present in the build dir?

Also for this case it didn't improve the situation, I think:

[acme@ssdandy linux]$ make -C tools/perf clean
make: Entering directory `/home/acme/git/linux/tools/perf'
  CLEAN    libtraceevent
<SNIP>
  CLEAN    Documentation
  CLEAN    python
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@ssdandy linux]$ make tools/perf/
scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler
make[1]: Nothing to be done for `perf/'.
[acme@ssdandy linux]$ make -C tools/perf/
make: Entering directory `/home/acme/git/linux/tools/perf'
  BUILD:   Doing 'make -j8' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
<SNIP>
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]

config/Makefile:308: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
config/Makefile:598: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
  CC       arch/common.o
  CC       fd/array.o
  CC       ui/setup.o
  CC       event-parse.o
  CC       util/abspath.o
  CC       scripts/perl/Perf-Trace-Util/Context.o
  CC       fs/fs.o
  LD       fd/libapi-in.o
  CC       event-plugin.o

-------------------------------------------------------

And this I think is related to Jiri's recent move of the feature detection from
tools/perf/ to tools/build/, when we remove that trailing slash:

[acme@ssdandy linux]$ make tools/perf
scripts/kconfig/conf --silentoldconfig Kconfig
scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler
  DESCEND  lib/api
make[3]: tools/build/Makefile.build: No such file or directory
make[3]: *** No rule to make target `tools/build/Makefile.build'.  Stop.
make[2]: *** [/home/acme/git/linux/tools/lib/api/libapi-in.o] Error 2
make[1]: *** [libapikfs] Error 2
make: *** [tools/perf] Error 2
[acme@ssdandy linux]$

-------------------------------------------------------

Jiri, can you take a look at the above?

It works if I use 'make -C', with O=, like I usually do, or without it:

-------------------------------------------------------

[acme@ssdandy linux]$ make -C tools/perf
make: Entering directory `/home/acme/git/linux/tools/perf'
  BUILD:   Doing 'make -j8' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
<SNIP>
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]

config/Makefile:308: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
config/Makefile:598: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
  GEN      common-cmds.h
  CC       util/abspath.o
  CC       ui/setup.o
  CC       arch/common.o


-------------------------------------------------------

Can you please check these issues, using my perf/core branch at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git

- Arnaldo

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

* Re: [PATCH] tools: unbreak 'make tools/*'
  2015-03-19 13:39 ` Arnaldo Carvalho de Melo
@ 2015-03-19 14:20   ` Jiri Olsa
  2015-03-19 16:11     ` Brian Norris
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Olsa @ 2015-03-19 14:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Brian Norris, Jiri Olsa, Michal Marek, linux-kernel,
	linux-kbuild, David Howells, Borislav Petkov, Sam Ravnborg

On Thu, Mar 19, 2015 at 10:39:25AM -0300, Arnaldo Carvalho de Melo wrote:

SNIP

> [acme@ssdandy linux]$
> 
> -------------------------------------------------------
> 
> Jiri, can you take a look at the above?
> 
> It works if I use 'make -C', with O=, like I usually do, or without it:
> 
> -------------------------------------------------------
> 
> [acme@ssdandy linux]$ make -C tools/perf
> make: Entering directory `/home/acme/git/linux/tools/perf'
>   BUILD:   Doing 'make -j8' parallel build
> 
> Auto-detecting system features:
> ...                         dwarf: [ on  ]
> ...                         glibc: [ on  ]
> <SNIP>
> ...                     libunwind: [ OFF ]
> ...            libdw-dwarf-unwind: [ on  ]
> ...                          zlib: [ on  ]
> 
> config/Makefile:308: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
> config/Makefile:598: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
>   GEN      common-cmds.h
>   CC       util/abspath.o
>   CC       ui/setup.o
>   CC       arch/common.o
> 
> 
> -------------------------------------------------------
> 
> Can you please check these issues, using my perf/core branch at:

hum, I've never cared about tools/Makefile :-\

so this is what we want to be able to do/use? :

  $ make tools/
  $ make tools/perf
  $ make O=$(BUILDDIR) tools/perf

it ^^^ does not work for me even with this patch
(tools/Makefile still using 'libapikfs' being first issue I saw)

I'll check and send fix

jirka

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

* Re: [PATCH] tools: unbreak 'make tools/*'
  2015-03-19 14:20   ` Jiri Olsa
@ 2015-03-19 16:11     ` Brian Norris
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2015-03-19 16:11 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Michal Marek, linux-kernel,
	linux-kbuild, David Howells, Borislav Petkov, Sam Ravnborg

On Thu, Mar 19, 2015 at 03:20:26PM +0100, Jiri Olsa wrote:
> On Thu, Mar 19, 2015 at 10:39:25AM -0300, Arnaldo Carvalho de Melo wrote:
> 
> SNIP
> 
> > [acme@ssdandy linux]$
> > 
> > -------------------------------------------------------
> > 
> > Jiri, can you take a look at the above?
> > 
> > It works if I use 'make -C', with O=, like I usually do, or without it:
> > 
> > -------------------------------------------------------
> > 
> > [acme@ssdandy linux]$ make -C tools/perf
> > make: Entering directory `/home/acme/git/linux/tools/perf'
> >   BUILD:   Doing 'make -j8' parallel build
> > 
> > Auto-detecting system features:
> > ...                         dwarf: [ on  ]
> > ...                         glibc: [ on  ]
> > <SNIP>
> > ...                     libunwind: [ OFF ]
> > ...            libdw-dwarf-unwind: [ on  ]
> > ...                          zlib: [ on  ]
> > 
> > config/Makefile:308: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
> > config/Makefile:598: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
> >   GEN      common-cmds.h
> >   CC       util/abspath.o
> >   CC       ui/setup.o
> >   CC       arch/common.o
> > 
> > 
> > -------------------------------------------------------
> > 
> > Can you please check these issues, using my perf/core branch at:
> 
> hum, I've never cared about tools/Makefile :-\
> 
> so this is what we want to be able to do/use? :
> 
>   $ make tools/
>   $ make tools/perf
>   $ make O=$(BUILDDIR) tools/perf

Honestly, I only was caring about 'make tools/tmon' but noticed other
things were broken. I'd be OK if we didn't support building from the
top-level directory (it's just confusing things here), but since we
advertise the feature, it'd really better work!

> it ^^^ does not work for me even with this patch
> (tools/Makefile still using 'libapikfs' being first issue I saw)
> 
> I'll check and send fix

Yeah, I'm not likely to spend time on an updated fix real soon. Consider
my patch a bug report, if the suggested fix doesn't work out. I'm not
much of a build system expert here.

Thanks,
Brian

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

end of thread, other threads:[~2015-03-19 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29  4:47 [PATCH] tools: unbreak 'make tools/*' Brian Norris
2015-02-02 23:43 ` Brian Norris
2015-02-03  0:07   ` Arnaldo Carvalho de Melo
2015-03-19 13:39 ` Arnaldo Carvalho de Melo
2015-03-19 14:20   ` Jiri Olsa
2015-03-19 16:11     ` Brian Norris

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).