Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2531437imm; Thu, 7 Jun 2018 12:13:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKZ6tfei+0xUWteegCvk1JagO2EDHPMsJTZ7ptxILK+ZtOFT0SmdRlTleeqCcUz+C5hrk25 X-Received: by 2002:a62:303:: with SMTP id 3-v6mr2871025pfd.255.1528398808765; Thu, 07 Jun 2018 12:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398808; cv=none; d=google.com; s=arc-20160816; b=Wv4lO3XUOl39+nwBP3txN/a/x5wn76DOFXFlUt68ht8t2BephSV3nouowHNytgEU7Y pmzcXwAy90kSYELHI+EcspBiU7YMgHiZQSMGGaru+0Ca4Rwa8DKRLek0GRlD6WI9vxwc p3bnfjk4VtwXf4eaIqp19mDg/zmcaaI/iTzmdUwq5qXpE1PMtK+ljsLiiRzw3SvfU3Og 0DyPuSEMFryidv4D1PzLIIpwl4W99BVetSlkDrHbkEahouxWHu9g8pYX4nDtA6w1LRcu 0Dui3H2pUZ9YmYBWovHVShjd6Gvg19xIASfaWcZ3/pEpIjfgw7oqnPii0IIR6RnUYPYB Z50A== 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=g/9nCp4TpcX4Thh9XSLbPkzRRvyxCOsX5VnH1nqwMGM=; b=uGew/H4jrslg/gP1CLAC1HOLQcCzLTIxbqesRh5gNburU2Hl5V96CFEsrD8TOJs0bi Uz0dkcsTPQiur1RqOgzBB65ehBMRXR75t9wccrqbOMMfcnpZCT9AMMGoj0Ca91hvwjro LY0XsKUxC1TEXn4i8qmu9irZJu2x57wkLtKHLdKoHYu+2+uK5q8xbJSpb18zxPW1k+Mo PX+i5Th1ihnc2PE+uMYsClo85kZUAchKQiGvQpqw4rrsG6J3Ypk1XUiBgxm33bMbZbc8 uyX/lGyjVAsy6++E8dN6yZeY878hSL/lsIvaRdixNuYjaqt/X9Gd81KdrR7DWxBfRRQ+ pnSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gZZ+cg1a; 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 j187-v6si10857510pgc.552.2018.06.07.12.13.14; Thu, 07 Jun 2018 12:13:28 -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=gZZ+cg1a; 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 S1753673AbeFGTHx (ORCPT + 99 others); Thu, 7 Jun 2018 15:07:53 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:44397 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbeFGTHu (ORCPT ); Thu, 7 Jun 2018 15:07:50 -0400 Received: by mail-pg0-f65.google.com with SMTP id p21-v6so5192850pgd.11 for ; Thu, 07 Jun 2018 12:07:50 -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=g/9nCp4TpcX4Thh9XSLbPkzRRvyxCOsX5VnH1nqwMGM=; b=gZZ+cg1aoCt94UfXUrstx4gTTR3QvUsL90tnRyz5ulj3EHX5MIr2mKV+/2wQ17Yz5D Zllu5k1dXXkQFu0i3XmeJzkB9O/TPCO48L14cYqY/BUfSHii+9UIzmrPhJswfiJbsAZ0 2UkplxcuYUSvxhSW0S1Gm3cg4ksfPeyLIQDGk= 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=g/9nCp4TpcX4Thh9XSLbPkzRRvyxCOsX5VnH1nqwMGM=; b=ShZ2Mz90ZkI12BjpgDF+kbd8Z0tbBxRuLEDg/oUanroaUehquUh9uA1WZYSPTzg0kf ZckvVGsQgnC+ov24lNjCXhpzaxsyVtUZ2o2bO9X0txL2mAXoGY5NAPX2QbVoDDWYJ7QK 19fnONX5o3F1G2jsBIIi9FB3dnHhJT680ky2+1ZqqGkg0QFJp5EYSZVQPSn7P62cqFVW J69Lr67+fXjApxv/qxCEiCZ8O3EsFwloSPyB2jDEefl8TDEKwR+YhxroUNstACV9m5XH bX/zJPUt9K39sFBZrhIqpCt7ehSktU3UgonEvx2MuVpKZiY/ZNkZnzwks1p80Z1fyAR1 DGNg== X-Gm-Message-State: APt69E1c41QXyFLh4aK8/7KnMhtxejvXQq3qCVkmyvyoiQbAKCOAgPI7 aBSxjUMtqvVyw+IMAgFkD9IDHLR4MQYUAzuTolvT1w== X-Received: by 2002:a62:e005:: with SMTP id f5-v6mr2903637pfh.88.1528398469962; Thu, 07 Jun 2018 12:07:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:178d:0:0:0:0 with HTTP; Thu, 7 Jun 2018 12:07:49 -0700 (PDT) In-Reply-To: References: <20180607105712.553-1-anders.roxell@linaro.org> From: Anders Roxell Date: Thu, 7 Jun 2018 21:07:49 +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 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 Cheers, Anders > >> To fix this issue remove the urandom_read target and so target >> TEST_CUSTOM_PROGS gets used. >> >> Fixes: 81f77fd0deeb ("bpf: add selftest for stackmap with BPF_F_STACK_BU= ILD_ID") >> Signed-off-by: Anders Roxell >> --- >> tools/testing/selftests/bpf/Makefile | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selfte= sts/bpf/Makefile >> index 607ed8729c06..67285591ffd7 100644 >> --- a/tools/testing/selftests/bpf/Makefile >> +++ b/tools/testing/selftests/bpf/Makefile >> @@ -16,10 +16,8 @@ LDLIBS +=3D -lcap -lelf -lrt -lpthread >> TEST_CUSTOM_PROGS =3D $(OUTPUT)/urandom_read >> all: $(TEST_CUSTOM_PROGS) >> >> -$(TEST_CUSTOM_PROGS): urandom_read >> - >> -urandom_read: urandom_read.c >> - $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id >> +$(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c >> + $(CC) -o $@ -static $< -Wl,--build-id >> >> # Order correspond to 'make run_tests' order >> TEST_GEN_PROGS =3D test_verifier test_tag test_maps test_lru_map test_l= pm_map test_progs \ >> -- >> 2.17.1 >>