Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp494608imm; Thu, 7 Jun 2018 23:47:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI63oEzD/VwV9uoXzpk31APlvBDnr981FmgLWtbAsjuo3u8UyREB2btYfFFVFndcPMOhAIK X-Received: by 2002:a62:9bc9:: with SMTP id e70-v6mr4704055pfk.15.1528440427100; Thu, 07 Jun 2018 23:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528440427; cv=none; d=google.com; s=arc-20160816; b=pfKGMni0Gcu5ZH97coGhjUUSRg0zxoKYw7ZM+uLh1/hhetGZHAZLKVL1cknmT45irG SytywLvjxOs7YXfgGQXbcXZpNdYtfdMaFLLom5jLKYtVtCh+NEhhZjcInrhagYrvx8Jl 8qBHwN2MsQ6XPwtcM2ATuum7+gzaqVpZ9JbTTnyHYC+yCovnUJ+yq5wUKDzcbI56RmK/ H3dMPkVgammJFtcQyqDoIh+D4WjbK7oTM52Q+a60+UnE4BYituuTpt84AcZSPQRpHGpe Y10dObcUgveRjcijcwb9h/h2ZFTc5N8Bf6gfZYC9TTsRajkhXpJ8CPUuvHDLrZCgky5l i6eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=GbC4LEzMFLHSLMlkpBvphN8IMpRZIZ+S3/CmwaQxefo=; b=nnc9RFu0SYlt8HReLx9o+YHDp4SeYazpx20ur7W+qXQFk87EZ45VCu0AOSMVLuB4+u DG5htshzoJ5RHAyEuBKK7EiQWGTVvjVUTd0nwtq8H03urN1pPzhT4XZkX2BEmYUF7FWX h8yP9vTqkGuSq4SlK4m/upi7GdXg5c2AcLRnIkOBhJJpGQdNOjc2OvxX/Y6aVYuUicU1 j5Z9x+M99XRKktTBE0b62/216hwGKat5AbV7D41OwTPTNDG6gRtT8FDGNm8Rm75FZihv kNf1bqW6vnTtdrTGdbRzGIQ5ry5iJeTXEUIiAsTL7hZIHYpYR3v7puvDYXxI5FBEVLzI amnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AJy5JzYW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si44361642pgp.10.2018.06.07.23.46.52; Thu, 07 Jun 2018 23:47:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AJy5JzYW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598AbeFHGpa (ORCPT + 99 others); Fri, 8 Jun 2018 02:45:30 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:37905 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbeFHGp2 (ORCPT ); Fri, 8 Jun 2018 02:45:28 -0400 Received: by mail-pl0-f68.google.com with SMTP id b14-v6so7711119pls.5 for ; Thu, 07 Jun 2018 23:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GbC4LEzMFLHSLMlkpBvphN8IMpRZIZ+S3/CmwaQxefo=; b=AJy5JzYW3yZ09gs4XflPYFYOdgDEy+C8StbRTRmXAImL2maoHvrgbbQtQB9KL0Z/EK l31pzI3OwhnKpWgmeLVAi7+gUGZ9jO43NhR64Sni7+gZshtSrMF5I4iLLgdURhliAk5y 0FonktMqsGzGFMjVDMT5GEHd9mQKcFudeOWh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GbC4LEzMFLHSLMlkpBvphN8IMpRZIZ+S3/CmwaQxefo=; b=naVITnV2TpcsbIkmpw74OTf1Fs8rVcyQwK2kpe6b4xeBx4dWrg3HnJF4VQlRll496Y MTFqLP9YarO/RXv968pmRsSxIgHfHqY9VQIuov8EP3InF7+8MpDBgwM6AYEjUFkEZKrv UxS/2mqqRxbFQVE5JaTIJwyjsnWsdVj3HVDeTQTJmdFpXHlGc+TCs38drZrkP4mrZVtE PBTBeP7TtCMrkjV1FSi8Oqn7KRNEV31kekFX0ZQ56BK8gt8r9BvmabS/nhpvio6W8wmM qrQSUmY7jiB+EjVjWdF5KpieNtyoi7//QunCwbU4v/Fg684olnzVqaPKg9prazPgTG+t xZDg== X-Gm-Message-State: APt69E2MkolfeDX4rrOJp8A8ddtqJRq2HSfdRNkvMmiaKTMYy3igrWZE 1y095rRhq+91mzstIEh8WrY82aNOXKxcwfdGZCxTQg== X-Received: by 2002:a17:902:26a:: with SMTP id 97-v6mr5289431plc.367.1528440328296; Thu, 07 Jun 2018 23:45:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:178d:0:0:0:0 with HTTP; Thu, 7 Jun 2018 23:45:27 -0700 (PDT) In-Reply-To: References: <20180607105712.553-1-anders.roxell@linaro.org> From: Anders Roxell Date: Fri, 8 Jun 2018 08:45:27 +0200 Message-ID: Subject: Re: [PATCH] selftests: bpf: fix urandom_read build issue To: Y Song Cc: Alexei Starovoitov , Daniel Borkmann , Shuah Khan , netdev , LKML , linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8 June 2018 at 07:08, Y Song wrote: > On Thu, Jun 7, 2018 at 2:43 PM, Anders Roxell = wrote: >> On 7 June 2018 at 23:17, Y Song wrote: >>> On Thu, Jun 7, 2018 at 12:07 PM, Anders Roxell wrote: >>>> On 7 June 2018 at 19:52, Y Song wrote: >>>>> On Thu, Jun 7, 2018 at 3:57 AM, Anders Roxell 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 >>>>>> =E2=80=98tools/testing/selftests/bpf/urandom_read=E2=80=99 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@localhost bpf-next]$ make -C tools/testing/selftests/bpf >>> make: Entering directory '/home/yhs/work/bpf-next/tools/testing/selftes= ts/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/selftest= s/bpf' >>> [yhs@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 Thank you for your time reviewing this. I will send that out shortly. Cheers, Anders