lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7fc7ffe-1672-437d-8a45-13590f5a1c2d@arm.com>
Date: Fri, 12 Jul 2024 11:13:19 +0100
From: Leo Yan <leo.yan@....com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
 Ian Rogers <irogers@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
 Mark Rutland <mark.rutland@....com>, Adrian Hunter
 <adrian.hunter@...el.com>, "Liang, Kan" <kan.liang@...ux.intel.com>,
 Nick Terrell <terrelln@...com>, Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
 Thomas Richter <tmricht@...ux.ibm.com>, Changbin Du
 <changbin.du@...wei.com>, James Clark <james.clark@...aro.org>,
 amadio@...too.org, linux-kernel@...r.kernel.org,
 linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v3 1/7] perf: build: Setup PKG_CONFIG_LIBDIR for cross
 compilation

Hi Namhyung,

On 7/12/24 05:52, Namhyung Kim wrote:

[...]

>> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
>> index ed54cef450f5..65fd2b2cfacb 100644
>> --- a/tools/build/feature/Makefile
>> +++ b/tools/build/feature/Makefile
>> @@ -82,7 +82,31 @@ FILES=                                          \
>>
>>   FILES := $(addprefix $(OUTPUT),$(FILES))
>>
>> -PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
>> +# Some distros provide the command $(CROSS_COMPILE)pkg-config for
>> +# searching packges installed with Multiarch. Use it for cross
>> +# compilation if it is existed.
>> +ifneq (, $(shell which $(CROSS_COMPILE)pkg-config))
>> +  PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
>> +else
>> +  PKG_CONFIG ?= pkg-config
>> +
>> +  # PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR is required for the cross
> 
> And PKG_CONFIG_SYSROOT_DIR too.

I will refine the comment as:

   # PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR, alongside PKG_CONFIG_SYSROOT_DIR
   # for modified system root, is required for the cross compilation.
   # If these PKG_CONFIG environment variables are not set, Multiarch library
   # paths are used instead.

>> +  # compilation. If both is not set, try to set the lib paths installed
>> +  # by multiarch.
>> +  ifdef CROSS_COMPILE
>> +    ifeq ($(PKG_CONFIG_LIBDIR)$(PKG_CONFIG_PATH)$(PKG_CONFIG_SYSROOT_DIR),)
>> +      CROSS_ARCH = $(shell $(CC) -dumpmachine)
>> +      PKG_CONFIG_LIBDIR := /usr/local/$(CROSS_ARCH)/lib/pkgconfig/
>> +      PKG_CONFIG_LIBDIR := $(PKG_CONFIG_LIBDIR):/usr/local/lib/$(CROSS_ARCH)/pkgconfig/
>> +      PKG_CONFIG_LIBDIR := $(PKG_CONFIG_LIBDIR):/usr/lib/$(CROSS_ARCH)/pkgconfig/
>> +      PKG_CONFIG_LIBDIR := $(PKG_CONFIG_LIBDIR):/usr/local/share/pkgconfig/
>> +      PKG_CONFIG_LIBDIR := $(PKG_CONFIG_LIBDIR):/usr/share/pkgconfig/
>> +      export PKG_CONFIG_LIBDIR
>> +      $(warning Missing PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH for cross compilation,)
> 
> Probably you need to add it here too.

Will do.

>> +      $(warning set PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) for building with Multiarch libs.)
> 
> I guess the message would get too long.  Maybe it's ok to hide the
> actual value..

Will do.

> In addition, I think this message will be displayed multiple times -
> once here and later in Makefile.perf.  Maybe we can show it once in
> the latter only?

Will polish for this.

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ