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] [day] [month] [year] [list]
Message-ID: <CAGNsrLCnYVd7kp2LkH+o5sdOR72Z4HX1HbD+3vheHX-LvSxtQw@mail.gmail.com>
Date:   Mon, 3 Jul 2017 14:23:40 +0300
From:   Fathi Boudra <fathi.boudra@...aro.org>
To:     Michael Ellerman <mpe@...erman.id.au>
Cc:     Bamvor Zhang Jian <bamvor.zhangjian@...aro.org>,
        linux-kselftest@...r.kernel.org, Shuah Khan <shuah@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] selftests: gpio: use pkg-config to determine libmount CFLAGS/LDLIBS

On 1 July 2017 at 04:48, Michael Ellerman <mpe@...erman.id.au> wrote:
> Fathi Boudra <fathi.boudra@...aro.org> writes:
>
>> On 30 June 2017 at 05:20, Bamvor Zhang Jian <bamvor.zhangjian@...aro.org> wrote:
>>> On 29 June 2017 at 19:39, Fathi Boudra <fathi.boudra@...aro.org> wrote:
>>>> On 29 June 2017 at 12:01, Michael Ellerman <mpe@...erman.id.au> wrote:
>>>>> Fathi Boudra <fathi.boudra@...aro.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.

As you said, most of selftests build. There's a precedent. memfd test
is also using pkg-config. That's why I followed similar approach.

> cheers
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ