Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2524943imm; Thu, 7 Jun 2018 12:07:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoNugqZfdV6WxBpblBoIUY6YrLMnEZEzK42mPltz2SGx6KBPLgBOBUyoUuioVFZ/K3Hc4j X-Received: by 2002:a62:d146:: with SMTP id t6-v6mr2893789pfl.127.1528398420077; Thu, 07 Jun 2018 12:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398420; cv=none; d=google.com; s=arc-20160816; b=IvvM9OH4SQx9ZNb3Uk34+3vT2bdwk5/4YYpnzUYT3tSESRRGz+1F0SM6mRv5Y+omAM XHaB/pL0oZicaPcnN1lQtk/9UxIdWkrRTEBOEE7s6E/WMB9kkRbUMGsp3Mi2hk5xjfFY h4frk90RUIc4qC9pOV0K4izUZcEwBtzJ6zab9etB43OT5k5My2DLlNhFINsDSMlR3lrk ENSzJNtxxCFJYVW9cv0jT9pgBpCKIPHjeECLWUyk2VcJ5c249Ci/frFg77VLAwbK/xG/ KcZihJ/nwHfYeI7HqUd4ro26K8jyJwujogOvSGmFQmpBkfDkXTj7dV/MRnqeJ9FKAM7S I3Rg== 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=MwLCCVMUA4y0XFNJhkDSjfwkDA5Z0xsgqOG20bebUsw=; b=iz4njT2plbM2C+4K1fkududsrMEzyur8fIf7rwfShENT4eyEYdi4t0+bHKISpWKLuX kuVoHj+R8EYCUb5q94zvi+bwyLTSq014EKsGRYPOeP6mC2NcAY4nUeiRnLd+pm6OAz5n 3KcjO8NWNSxGJU0Nm0WKmxU8teXX2E0eSg7GzHUk7gut0s9ne1ZKo+RWROZRgLioPeYy Aw+54eyBxMnzZG+O7ODmr+hnAXzwDlITCQlusyZJPABZ66MlM8JaVPDTuCXFX1fGFeer 3U0MiMjQrlG/+eiykSfiGGXdM9qfuzSO7LJ7gqHti7Ew5eF0OuobD1Ng7g1xt6YmqYEA r7aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IrPA/D1Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si12716815pgm.306.2018.06.07.12.06.46; Thu, 07 Jun 2018 12:07:00 -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=@gmail.com header.s=20161025 header.b=IrPA/D1Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935096AbeFGRwp (ORCPT + 99 others); Thu, 7 Jun 2018 13:52:45 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:38202 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933071AbeFGRwn (ORCPT ); Thu, 7 Jun 2018 13:52:43 -0400 Received: by mail-vk0-f65.google.com with SMTP id b77-v6so6600074vkb.5; Thu, 07 Jun 2018 10:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MwLCCVMUA4y0XFNJhkDSjfwkDA5Z0xsgqOG20bebUsw=; b=IrPA/D1QQBCmc2EuDJFmzLNhzcH30dv+y8HwDnrK/Y/zWy8a7FJDDyHHXcHD1y3KXN 8q88BO0O+ZlJ8DC0nBAHPE+TVeJWgIOaSWruaTsN4mPj8GL0btnZ3qxx/MbMetqO0egG 4TJiHrPEKWlofb1mL/ByCQ97td5QDHqTze0iaQzzuo25buXxM9q+oph+JzmJYET7v1Db xX1iYV0T8WkQkFw+NeBwGZsfvQpGX3ayJwVGIWKp7+3GqqUD09I38F6rt8ceD7bBRHJ5 YgS2AA8SWLZVNrl1KbxuG2e9ONiYKEzRRuFo+2kej3OHjIUlv5QI4ZioCbn/8cBI/xJD Mq/A== 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=MwLCCVMUA4y0XFNJhkDSjfwkDA5Z0xsgqOG20bebUsw=; b=iJYjm6B3JJiWh/nnR6JT7S/rQc3U0wC6M0lrD1kliLruEF5KEunto6jbYqf9wbcngr AGKJMRV2UNNI+WkedaMqFwgFAzifCsVlXAIk6Ehw8Ak0Sym+kPKBWrp591zziyHqXwjx s9i0M8bL8YzQxPm2sEp04kqJqW2RBOERGkqhjcR8kORo/tion7nuX1ulP65npCvWe2ve WKcVS/V3uBFt4DmmwOM86GPWItzUdD+HlyPzd8bhnemunr6qJ4Kv9PlTQcekL2fKH6H9 0Dp8Ye9lugxVVHhtk0IPE+vHTIMxeGprZLHvT7pjRZZd7saqYDfqk8uZ5z4JN9l8AhlI RVyQ== X-Gm-Message-State: APt69E3PctASWdzD+KCVCFtyBHLwKCICYHrBAGih7xnCtkuu8XN4wfHB v6QUfW0hUDpu02qO8sT3Bqk0FSklzYcXwleNLo0= X-Received: by 2002:a1f:c007:: with SMTP id q7-v6mr1930526vkf.144.1528393962481; Thu, 07 Jun 2018 10:52:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:5494:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 10:52:02 -0700 (PDT) In-Reply-To: <20180607105712.553-1-anders.roxell@linaro.org> References: <20180607105712.553-1-anders.roxell@linaro.org> From: Y Song Date: Thu, 7 Jun 2018 10:52:02 -0700 Message-ID: Subject: Re: [PATCH] selftests: bpf: fix urandom_read build issue To: Anders Roxell 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 Thu, Jun 7, 2018 at 3:57 AM, Anders Roxell wr= ote: > 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? > 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_BUI= LD_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/selftes= ts/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_lp= m_map test_progs \ > -- > 2.17.1 >