mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: "Daniel Díaz" <daniel.diaz@linaro.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Bamvor Zhang Jian" <bamvor.zhangjian@linaro.org>
Cc: linux-kselftest@vger.kernel.org,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Shuah Khan <shuah@kernel.org>,
	"open list:GPIO MOCKUP DRIVER" <linux-gpio@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] selftests/gpio: Fix OUTPUT directory in Makefile
Date: Wed, 21 Feb 2018 16:11:16 -0700	[thread overview]
Message-ID: <634e5fb7-4f2b-7313-e8f3-17a2eec112ef@osg.samsung.com> (raw)
In-Reply-To: <8e7b8d40-99ac-3f4f-a25d-e0df0dd104d5@linaro.org>

On 02/21/2018 04:04 PM, Daniel Díaz wrote:
> Hello!
> 
> 
> On 02/21/2018 04:09 PM, Andy Shevchenko wrote:
>> On Wed, Feb 21, 2018 at 11:52 PM, Daniel Díaz <daniel.diaz@linaro.org> wrote:
>>> When simply running `make' from the selftests top dir, this
>>> error shows up:
>>>
>>>   cc -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid    gpio-mockup-chardev.c ../../../gpio/gpio-utils.o  -lmount -o gpio-mockup-chardev
>>>   cc: error: ../../../gpio/gpio-utils.o: No such file or directory
>>>   <builtin>: recipe for target 'gpio-mockup-chardev' failed
>>>   make[1]: *** [gpio-mockup-chardev] Error 1
>>>
>>> because the output directory is set to "selftests/gpio" and
>>> all binaries built from ../../../gpio/ end up there. In fact,
>>> they appear as, exempli gratia:
>>> * gpiogpio-event-mon
>>> * gpiogpio-hammer
>>> * gpioinclude/
>>> * gpiolsgpio
>>> which is wrong, as it's missing directory separator somewhere.
>>>
>>> This patch sets straight the output directory when building
>>> ../../../gpio/ so that binaries don't cross paths.
>>
>> This patch doesn't sound right like previous one.
>> Does selftest infrastructure have it's own build system like tools?
> 
> Yes. See linux/Documentation/dev-tools/kselftest.rst § "Contributing new
> tests (details)" or linux/tools/testing/selftests/lib.mk itself, which
> starts saying:
> # This mimics the top-level Makefile. We do it explicitly here so that this
> # Makefile can operate with or without the kbuild infrastructure.
> 
> 
>> Does it use tools' one?
> 
> No, as far as I can tell. If anything, it uses it only to build inside
> tools/gpio/ whatever is needed.
> 
> 
>> What's wrong with the current approach?
> 
> When building from the tools/testing/selftests/ directory, binaries end
> up in the current directory (and with an improper name), which is
> undesirable. The gpio/ selftest fails to build when make'ing from there.
> 
> This is with current master:
>   /linux/tools/testing/selftests$ make
>   make[1]: Entering directory '/linux/tools/testing/selftests/gpio'
>   [...]
>   gcc -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
> gpio-mockup-chardev.c ../../../gpio/gpio-utils.o
> ../../../../usr/include/linux/gpio.h  -lmount -I/usr/include/libmount -o
> gpio-mockup-chardev
>   gcc: error: ../../../gpio/gpio-utils.o: No such file or directory
>   <builtin>: recipe for target 'gpio-mockup-chardev' failed
>   make[1]: *** [gpio-mockup-chardev] Error 1
>   make[1]: Leaving directory '/linux/tools/testing/selftests/gpio'
>   Makefile:32: recipe for target 'all' failed
>   make: *** [all] Error 2
> 
> 
>> Why do you need tools in selftests?
> 
> I'll leave that to the test author to answer, as this is only a fix in
> the Makefile, but the only part of tools needed here is tools/gpio/*,
> for make'ing the object files this test will be built against.
> 

This test depends on tools/libs built in tools/gpio. The original
commit has details on the benefits of adding this test. Adding author
to the thread for further comments.

22f6592b23ef8a0c09283bcb13087340721e1154
commit 22f6592b23ef8a0c09283bcb13087340721e1154
Author: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>

thanks,
-- Shuah

  reply	other threads:[~2018-02-21 23:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 21:52 [PATCH 1/2] selftests: gpio: restructure Makefile Daniel Díaz
2018-02-21 21:52 ` [PATCH 2/2] selftests/gpio: Fix OUTPUT directory in Makefile Daniel Díaz
2018-02-21 22:09   ` Andy Shevchenko
2018-02-21 23:04     ` Daniel Díaz
2018-02-21 23:11       ` Shuah Khan [this message]
2018-02-21 22:06 ` [PATCH 1/2] selftests: gpio: restructure Makefile Andy Shevchenko
2018-02-21 22:45   ` Daniel Díaz
2018-02-21 23:22 ` [PATCH v2] " Daniel Díaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=634e5fb7-4f2b-7313-e8f3-17a2eec112ef@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=daniel.diaz@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®