Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1679231

Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS
Date 2017-07-01 03:50 +0200
Message-ID <tYfHP-4FB-1@gated-at.bofh.it> (permalink)
References <tXBAK-4e8-9@gated-at.bofh.it> <tXDCy-5Ff-19@gated-at.bofh.it> <tXG7n-71O-1@gated-at.bofh.it> <tXTR0-7Ni-21@gated-at.bofh.it> <tXX8f-1pk-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Fathi Boudra <fathi.boudra@linaro.org> writes:

> On 30 June 2017 at 05:20, Bamvor Zhang Jian <bamvor.zhangjian@linaro.org> wrote:
>> On 29 June 2017 at 19:39, Fathi Boudra <fathi.boudra@linaro.org> wrote:
>>> On 29 June 2017 at 12:01, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>>> Fathi Boudra <fathi.boudra@linaro.org> writes:
>>>>
>>>>> Fix hardcoded and misplaced libmount headers. Use pkg-config instead to
>>>>> figure out CFLAGS/LDLIBS, fixing also their value for cross-compilation.
>>>>
>>>> Can you explain how it fixes the values for cross-compilation?
>>>
>>> When pkg-config is invoked in a cross-build environment, it will
>>> return your sysroot headers path instead of the hardcoded
>>> -I/usr/include/libmount
>>>
>>> For example in my oe environment, when I invoke "pkg-config --cflags
>>> mount", it returns:
>>> -I/build/tmp-rpb-glibc/sysroots/hikey/usr/include/libmount
>> I suppose we could also pass the extra CFLAGS and LDFLAGS directly to
>> make it work. correct?
>
> or use the appropriate tool for getting CFLAGS/LDFLAGS instead of:
> 1. hardcoding it and potentially get them wrong
> 2. expecting the user will have to take extra steps, while he can just run make

Sure. But by using the "appropriate tool" you create a new dependency on
that tool.

For folks building natively it's probably not a big deal, they probably
already have pkg-config installed, but for cross building it's another
thing to get working.

Currently most of the selftests build, and cross-build, with nothing but
a C compiler and libc, and we should try to maintain that as much as
possible.

cheers

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Fathi Boudra <fathi.boudra@linaro.org> - 2017-06-29 09:00 +0200
  Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Michael Ellerman <mpe@ellerman.id.au> - 2017-06-29 11:10 +0200
    Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Fathi Boudra <fathi.boudra@linaro.org> - 2017-06-29 13:50 +0200
      Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Bamvor Zhang Jian <bamvor.zhangjian@linaro.org> - 2017-06-30 04:30 +0200
        Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Fathi Boudra <fathi.boudra@linaro.org> - 2017-06-30 08:00 +0200
          Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Michael Ellerman <mpe@ellerman.id.au> - 2017-07-01 03:50 +0200
            Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Fathi Boudra <fathi.boudra@linaro.org> - 2017-07-03 13:30 +0200
      Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS Michael Ellerman <mpe@ellerman.id.au> - 2017-06-30 13:10 +0200

csiph-web