Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp422017imm; Thu, 7 Jun 2018 22:10:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJvhAJDbFJAS6SDyzhrWDoNp1ADrq7UVVNWVTTYOvY7THpTEZKrLRTVvlu2hrGsjsr3Sb6C X-Received: by 2002:a62:9fd1:: with SMTP id v78-v6mr4481244pfk.233.1528434637436; Thu, 07 Jun 2018 22:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528434637; cv=none; d=google.com; s=arc-20160816; b=ZCd1NKeu7DONO0n1TkSDUIK8X/+g6NS0fo/Osfp3TNn1vcNL5uaXTj0F4DObrhu9yi /9znNYbM7is8oWYs1ocv2DUZYc+Sw2C49p8QxuyZtJh7ILSSRQ2Pq+OZzhbNSZ+679kr ZHG1BaQWiE0Ne02VCuQn6W/Qb9Ggu0+7TeeRQxjNAfK1feWPw6e1ofZAKAQuR/wwT54r Kp1gzSXsIXlCbCY8m14Dp5Hy2s2GmwH/NXNhZpl0THcNPkONC6qHpZiDkDZjfIIxlSmK asgUYyEU4HDfQtrTiZFn0n61F8AKcZH7G1+q4ThzL+Ig+umFgwGn37YKisqsTYaPQmUr P93A== 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=4jkeYeXOhzL/qM8dV2E38BdfyF0jaduBUSfulGwfRT4=; b=BQ/kAz8jyNyLFVPaNblpP0sTb5Ulo/j7mmDTkXrFiCeyRR2racN8f3GMtPfsa20Z82 NBqsMok86s4Wn1wsjxJbdZX3NvxDAVmOCgmU53ws2nWo+org50+S4Wgu+oyh1feBvXNO JeFhS/jDe7XigAfFnL4gFrO39G9b0k/L/SEgA5fQWnjNuHxB1C1U6iDEY0b6NDSlVDuC 3+fl5L6ktZixZD3EkQE808CfrCt/2eujB4CKVyBFD6cDsVEaB37BOKudXOUrsGjWdJHm lDv2KQfP74qpatRUAf8MIHeag+4PjeZKquAM9gc+RTJrC5mXWgU2njK2mRpKV4pl1c6B RvJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TnIG6EX0; 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 y7-v6si20234226pgo.81.2018.06.07.22.10.22; Thu, 07 Jun 2018 22:10:37 -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=TnIG6EX0; 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 S1751116AbeFHFJS (ORCPT + 99 others); Fri, 8 Jun 2018 01:09:18 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:37919 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbeFHFJR (ORCPT ); Fri, 8 Jun 2018 01:09:17 -0400 Received: by mail-ua0-f196.google.com with SMTP id 59-v6so8081868uas.5; Thu, 07 Jun 2018 22:09:16 -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=4jkeYeXOhzL/qM8dV2E38BdfyF0jaduBUSfulGwfRT4=; b=TnIG6EX0EjedZpMc3MEWH/x3RpWJDLsxD3Cu731Wj0ZWs1iR42RZjhOr0+7SCZV7El QUSVtzWGLEWg/rEOU4pLpKdw3uSI4PCMBk9qnj16MHZXTxVtuiZ4Pdk3PYdnnWLF+Ct9 hZbxqUQAd6q3ifVzAlkBTQILXf7V2h8adySvmzBg9ZuSsenjA+ZVuPP4K6if6q6v/L2E oKtieRorP07W8dGOWgcURRdkWvSQOXvAMxDR5DdwNPNJSCdNDmmRJIekTOgln0S3tS5m aFx8V0WXsqnykWQ2+u7XONjTh1egX1E6ySZZO/e7ChmMvvyELEccFaJSvgtuldqrbClY VaAQ== 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=4jkeYeXOhzL/qM8dV2E38BdfyF0jaduBUSfulGwfRT4=; b=fGvt3/m7ZFaLVIodAwnkize+uYXUhHlTF6SwqvGuI6FS7LG63G2Ri38D55ob3PuibJ ppNosZJLEdJEnuOQQ2eXqScK4YcUWx6r6G/6REp1dBsgB7bLDteVQob7UslhzjDpA+ql YNbQfjmbEvGVAwU8ruA5QKsMONY6pCvtvAuv++mX9VgTcQV38duPeIZUWjAafuo6dc1X kCvSNIv7Aggt7LIdFv9bbn6ZniPVrdATbh6paSJnwzSBpamIgnBMd3Mjk7uuHpiGmk/V NBSyN5GFCWfFPAxHhstaj9qGhm6la1ur4fnOlnmdZssyFCt+njQIIpbzQZ5Fya/X3OKi tO8w== X-Gm-Message-State: APt69E3F0dusdN2WXNK05V6zl1j2EIEMCW1ajgCUCunE2kN7ZKHz/PGF M9JP75Vq201N3JlCbNeTCYH/RMOcOBhQfWr/T2Gmiy5v X-Received: by 2002:ab0:3141:: with SMTP id e1-v6mr3356946uam.48.1528434555979; Thu, 07 Jun 2018 22:09:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:5494:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 22:08:35 -0700 (PDT) In-Reply-To: References: <20180607105712.553-1-anders.roxell@linaro.org> From: Y Song Date: Thu, 7 Jun 2018 22:08:35 -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 2:43 PM, Anders Roxell wr= ote: > 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/b= pf >>>>> -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/selftest= s/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@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