linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: anders.roxell@linaro.org (Anders Roxell)
Subject: [PATCH] selftests: bpf: fix urandom_read build issue
Date: Fri, 8 Jun 2018 08:45:27 +0200	[thread overview]
Message-ID: <CADYN=9JEi2=YcC0KD555atZFiJNbP8Y9O0UME+63iTpSSd=ttg@mail.gmail.com> (raw)
Message-ID: <20180608064527.eIexVgnHKy9QRlFp3DYORPmoegKFtKqdWf2miGZ_URw@z> (raw)
In-Reply-To: <CAH3MdRWaVKrYbR14wjn6YjurcHvOFe-=t6g0Me=9=g+GRXqeeg@mail.gmail.com>

On 8 June 2018@07:08, Y Song <ys114321@gmail.com> wrote:
> On Thu, Jun 7, 2018@2:43 PM, Anders Roxell <anders.roxell@linaro.org> wrote:
>> On 7 June 2018@23:17, Y Song <ys114321@gmail.com> wrote:
>>> On Thu, Jun 7, 2018@12:07 PM, Anders Roxell <anders.roxell@linaro.org> wrote:
>>>> On 7 June 2018@19:52, Y Song <ys114321@gmail.com> wrote:
>>>>> On Thu, Jun 7, 2018@3:57 AM, Anders Roxell <anders.roxell@linaro.org> wrote:
>>>>>> gcc complains that urandom_read gets built twice.
>>>>>>
>>>>>> gcc -o tools/testing/selftests/bpf/urandom_read
>>>>>> -static urandom_read.c -Wl,--build-id
>>>>>> gcc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../lib/bpf
>>>>>> -I../../../../include/generated  -I../../../include    urandom_read.c
>>>>>> urandom_read -lcap -lelf -lrt -lpthread -o
>>>>>> tools/testing/selftests/bpf/urandom_read
>>>>>> gcc: fatal error: input file
>>>>>> ‘tools/testing/selftests/bpf/urandom_read’ is the
>>>>>> same as output file
>>>>>> compilation terminated.
>>>>>> ../lib.mk:110: recipe for target
>>>>>> 'tools/testing/selftests/bpf/urandom_read' failed
>>>>>
>>>>> What is the build/make command to reproduce the above failure?
>>>>
>>>> make -C tools/testing/selftests
>>>
>>> Thanks. The patch will break
>>>    make -C tools/testing/selftests/bpf
>>>
>>> [yhs at localhost bpf-next]$ make -C tools/testing/selftests/bpf
>>> make: Entering directory '/home/yhs/work/bpf-next/tools/testing/selftests/bpf'
>>> gcc -o /urandom_read -static urandom_read.c -Wl,--build-id
>>> /usr/bin/ld: cannot open output file /urandom_read: Permission denied
>>> collect2: error: ld returned 1 exit status
>>> make: *** [Makefile:20: /urandom_read] Error 1
>>> make: Leaving directory '/home/yhs/work/bpf-next/tools/testing/selftests/bpf'
>>> [yhs at localhost bpf-next]$
>>
>> urgh, I'm sorry, missed that.
>>
>>>
>>> Could you still make the above command work?
>>
>> $(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c
>>         $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id
>>
>> That worked both with:
>> make -C tools/testing/selftests
>> and
>> make -C tools/testing/selftests/bpf
>>
>> for me.
>>
>> what do you think?
>
> This indeed works. You can submit a revised patch and add my Ack.
> Acked-by: Yonghong Song <yhs at fb.com>

Thank you for your time reviewing this.
I will send that out shortly.


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

  parent reply	other threads:[~2018-06-08  6:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 10:57 [PATCH] selftests: bpf: fix urandom_read build issue anders.roxell
2018-06-07 10:57 ` Anders Roxell
2018-06-07 17:52 ` ys114321
2018-06-07 17:52   ` Y Song
2018-06-07 19:07   ` anders.roxell
2018-06-07 19:07     ` Anders Roxell
2018-06-07 21:17     ` ys114321
2018-06-07 21:17       ` Y Song
2018-06-07 21:43       ` anders.roxell
2018-06-07 21:43         ` Anders Roxell
2018-06-08  5:08         ` ys114321
2018-06-08  5:08           ` Y Song
2018-06-08  6:45           ` anders.roxell [this message]
2018-06-08  6:45             ` Anders Roxell
2018-06-08  6:51             ` [PATCH v2] " anders.roxell
2018-06-08  6:51               ` Anders Roxell
2018-06-11 10:58               ` daniel
2018-06-11 10:58                 ` Daniel Borkmann

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='CADYN=9JEi2=YcC0KD555atZFiJNbP8Y9O0UME+63iTpSSd=ttg@mail.gmail.com' \
    --to=anders.roxell@linaro.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;
as well as URLs for NNTP newsgroup(s).