[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXQXSV7yWLbnrV-KY4M=bgUwKJtn1sxH7MShz7KLNJ3yQ@mail.gmail.com>
Date: Thu, 26 Jan 2023 09:50:44 -0800
From: Ian Rogers <irogers@...gle.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
Stephane Eranian <eranian@...gle.com>,
Andrii Nakryiko <andrii@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH v3 1/3] objtool: Install libsubcmd in build
On Wed, Jan 25, 2023 at 5:46 PM Josh Poimboeuf <jpoimboe@...nel.org> wrote:
>
> On Thu, Jan 05, 2023 at 01:01:53AM -0800, Ian Rogers wrote:
> > Including from tools/lib can create inadvertent dependencies. Install
> > libsubcmd in the objtool build and then include the headers from
> > there.
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
> > Tested-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> After a make, "git status" shows:
>
> Untracked files:
> (use "git add <file>..." to include in what will be committed)
> tools/objtool/libsubcmd/
>
> So tools/objtool/.gitignore needs an update.
Done.
> > --- a/tools/objtool/Makefile
> > +++ b/tools/objtool/Makefile
> > @@ -12,9 +12,15 @@ srctree := $(patsubst %/,%,$(dir $(CURDIR)))
> > srctree := $(patsubst %/,%,$(dir $(srctree)))
> > endif
> >
> > -SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
> > -LIBSUBCMD_OUTPUT = $(or $(OUTPUT),$(CURDIR)/)
> > -LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
> > +LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/
> > +ifneq ($(OUTPUT),)
> > + LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd
> > +else
> > + LIBSUBCMD_OUTPUT = $(CURDIR)/libsubcmd
> > +endif
> > +LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT)
>
> Similar to Nicolas' comment, it's confusing to have two variables with
> the same value. Please s/LIBSUBCMD_DESTDIR/LIBSUBCMD_OUTPUT/
Done. I feel this is more of a meta question for the standard in the
current build. DESTDIR is related to installation, in this case header
files, OUTPUT is a build directory. Anyway, LIBSUBCMD_DESTDIR is gone
in v4.
> > +LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a
> > +CFLAGS += -I$(LIBSUBCMD_OUTPUT)/include
>
> As far as I can tell, this CFLAGS addition is both ineffective (it's
> overwritten later) and unnecessary (it's made redundant by the same
> addition to the INCLUDES variable).
Agreed, removed in v4.
> --
> Josh
Powered by blists - more mailing lists