Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp89722imm; Thu, 7 Jun 2018 14:22:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI5LMh45gn8UnPUV6dPqfAOlYmOtuqY7yDD4fxx4e2pSz0SAf3HD4mN1cuHulVIkzUifSuF X-Received: by 2002:a17:902:4483:: with SMTP id l3-v6mr3663600pld.282.1528406566926; Thu, 07 Jun 2018 14:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528406566; cv=none; d=google.com; s=arc-20160816; b=X0JI6bRDDngetTPlyKUgGFNplnYG+Uwk6e27GixGzRwlhv01k1oKPKi1Ovz646qSq8 0LocwYdmisZyUF4pDFZ1HLXCVT887Oossr0RuBETucgLh5kmtrws7cPgM4qVlP30CYwo 4AFBsjpWH5g1OyuCfxFoAtiV9iT6gvJyDs9axX6QxAxC4x04fGX3NoUI3MJSgAZJBIKT OvEoVLlSlhy4xX7kBCMJkJQp7RIyLbXX+hiQV11odmzNhb4P1wIciB4Uw+OYYkofmWcn O21vapesJ+lseE/1x3PV2uSYNoD91w+RRr7f6l3XPJt0a6WkdXTzXPr06Q3MwDLfq++m 05dQ== 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=A4DMgyyzKc+oC1zcKxYlyWdtTZBCToBO7GELQdZvUzw=; b=zm+JU645QC0rKtHmKlUZPCUAgBbFsCg4VlMRlhvcV12TSyRh7Y1tVebbGorgNk2PlF swUyU3CRYggvg2Q+91Xlzs9a0HBdv+3KuIUwbqZ0j469Tcuq6aEj1VN03FwQNQb7XqhN jbgxXFSb5+NVFx6KRiS35aFjGDfxT7tcj0ihVYFj8eyjVPxq93GGFG/IEkE7S0fSnu8D 0bim/YIpdw5ozgS0aITXAVhEXYhEDuFb68bXL3B8KMIMc1pK+KhwpofzRwy5LoQuWwuG 7m0lootOoK4YLzgPjz37mExwFLDJsJtt01f8jvgogOn76TkMiJw0Z/HgvqmwpSG+ovMH KPAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mtVCr8Gy; 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 v73-v6si25496547pfi.22.2018.06.07.14.22.02; Thu, 07 Jun 2018 14:22:46 -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=mtVCr8Gy; 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 S1752594AbeFGVR7 (ORCPT + 99 others); Thu, 7 Jun 2018 17:17:59 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:45265 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbeFGVR5 (ORCPT ); Thu, 7 Jun 2018 17:17:57 -0400 Received: by mail-ua0-f194.google.com with SMTP id k14-v6so7464578uao.12; Thu, 07 Jun 2018 14:17:57 -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=A4DMgyyzKc+oC1zcKxYlyWdtTZBCToBO7GELQdZvUzw=; b=mtVCr8GyzDlngPcjYDzPlOddID2JFN38tPzIF7UFKGf1DjK1oroKL7K0pdkPw0wgbE xW91ZtIUADAVeI/46Ib/7BYFY2trGxhwKZ0YOIKZT707mgg2Pzv4qatbGvRpTeKS6Vu5 mooampY80ty1iO/WD+ZQz/gOcKz3a2INT/vI1qWeOpwRvUDoI/d7qqWmvhJw0G/QEr9w clNZysIXvi5AmYea0DOb/5UHh7+DxXFVUlEJ1mnAB/UD14E0I7ROgtJ0Zer3qYbY2sPE V5RQTk7zDwShH8AI8r8soSukxXQev3fRz6EUYBDuQTvzNM10pW+//pAbLZTygJIvTQQB ZUQA== 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=A4DMgyyzKc+oC1zcKxYlyWdtTZBCToBO7GELQdZvUzw=; b=jQJy4X5gjblF3N87vMYZEixhddennXKOGamWkfetEpRRJcQnAA2yixonRHM1nFOvjz Szc3PbBMB2gJ9XMrGEdu7neEZQmWUFfjIs9IcrNL5g4YaGm0toPRrVRYAvn4WsU50M+5 yeCowm8EFmJXsSJBmnZM+4A2wgku+Uft/LesojYKXzL0EYiU5VyNAbMQBzErfj7omJyW sUxZgM63l+byDhaZh3iHQu2bdYMJZ6yeAAEqHSGymD30Yh9Pr9rKdyacCPHUgWM6JiHB 1ORiIUcx3Y8x25SZeD6XFz4HittTQw3U3mS2bKF5Hls1KMiVbvwDldzP3QxQScjaC9v3 akIg== X-Gm-Message-State: APt69E2KTYJkBxSo45MBf+e1UYv1dsDxtJnB6HtMM8u5YXhNdhOYoPPs QsyEh78sspme2XuufijKxa/lGIY0YpFtpo+j86c= X-Received: by 2002:a9f:2266:: with SMTP id 93-v6mr2405400uad.142.1528406276577; Thu, 07 Jun 2018 14:17:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:5494:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 14:17:16 -0700 (PDT) In-Reply-To: References: <20180607105712.553-1-anders.roxell@linaro.org> From: Y Song Date: Thu, 7 Jun 2018 14:17:16 -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 12:07 PM, Anders Roxell w= rote: > 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/selftests/b= pf' 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/bp= f' [yhs@localhost bpf-next]$ Could you still make the above command work? > > 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_B= UILD_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/selft= ests/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_= lpm_map test_progs \ >>> -- >>> 2.17.1 >>>