Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3386070pxu; Tue, 8 Dec 2020 10:35:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCiKVRjrIMAIdnBvENLVmR8TK3/c3eAyZ/WYZJdalJFtJ7DtGxQkNm0+4oREDz7VfiKtBW X-Received: by 2002:a17:906:3683:: with SMTP id a3mr6427728ejc.538.1607452515195; Tue, 08 Dec 2020 10:35:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607452515; cv=none; d=google.com; s=arc-20160816; b=mh1eGb6D/yN2X/0PIyRto+VJ5i+Oj/txEyoqDDMpOy4r95naNkvEVAjuP13EuVCByI LHbYwzyVZQc3Y9DRI61gUtHtL+QgauqxohPgfydWV44UApJmTbpotlEeaT/564Fhwqb5 72XlHCLXssq8icBQ+SaR1vjGhhLI7X9CADNMsq/c/MI4CID9Ygthld97XiJx0Q0YGzwz oUZkQbAyBe3RJJoExNiGIXy5MAI104/TBXd5TstwLRXaMpHbGicBy86j7AMoCJlaZr/H uHHz4aT9j+rUYeBTSrVByw47xO0ALgjVaZapUzmjwm8rXlugKfjmrsmgXEWwrl2FdMtE AHmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Yv0AU/YcsITiXZw1huIkAWkR6xhRqThVIfqOGzqf/JQ=; b=pJdxY/Q3TnJKZMlVQT5oCNS0IcHCNnRM+H7wb1odmRHiyfz+reCdaeCdD6WZ6/KSC0 ieyarW13noIyRRIyMV+BgB46rdwAE3tHFgYSYmuz/HqCijed9htzAYoSlqb3/vuEhpog cYZ+cvIcjeNl3eroL8YL0TbnXFyYoEXF/s4yup8YuhhJx+1DypCA//cD4YgmgWwnbq2T OAqAJp5yIS4H0UCnzs8dOIHUjAqJoUktp/qoWrVwPIxOVa5y9fCbKTRvQ7vVfmhwH+e7 6J8Bkwz5o82UB7HQVzdne33WFfRh39sIcNKBquypa0H2p8pbNaDh3PjbT7UApj3o5nrI Ox4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBXqKAqy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u18si8731624ejx.722.2020.12.08.10.34.52; Tue, 08 Dec 2020 10:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBXqKAqy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730963AbgLHSc1 (ORCPT + 99 others); Tue, 8 Dec 2020 13:32:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730492AbgLHSc1 (ORCPT ); Tue, 8 Dec 2020 13:32:27 -0500 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B43BDC061749; Tue, 8 Dec 2020 10:31:46 -0800 (PST) Received: by mail-yb1-xb43.google.com with SMTP id k78so8078541ybf.12; Tue, 08 Dec 2020 10:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yv0AU/YcsITiXZw1huIkAWkR6xhRqThVIfqOGzqf/JQ=; b=CBXqKAqyoMu38WmYGr1Y8k3JfN0eKpaU4LePiRbwo+sA5ZJdjF48VLNM9Xxf5E6ZQo XXNIIx0a2K453Z3vpLxvRlBOMRlO2y8G6FPzDpU0AQcDkrS7P2CWbCsbn+Cb485uNck8 r/xPi3+V6Tjj12uUCV+yaU5qvRvsl/v6AHY9Ml/gpOkSH67Irrsyw8BZF3/nT+W9C590 zfwWrxoNy44WhFqI7FiGpdOSuIOBr59/ervp4+u/KbnvExcquZbKKT9R1hbDa13WHoWp /7yuwcO1LVxlhT2aDHQ0tdSX07J/IxQGRlXjb8BEiAziJtkWYOVvlJqAkpArCBuvSeDu Eb7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yv0AU/YcsITiXZw1huIkAWkR6xhRqThVIfqOGzqf/JQ=; b=Bu5lT6qIwf5PX2A5vR1j1sLU2ebDiFj63LPJltPZD3JV9Lp0iZ6+etWi5t010xhlzh 1ruuxhl5Wg7EjolzURqHuEv4rgx9BLSYLvxrRCqtSZmeyDPOim/Tz+1KaxES3MpHvfoG dyxGgSOzZPFDZ+tG183lj3lalJ1cIORgwBsJLB3ykQHacZUW7y2QULsGhLA3MCLLwVf1 zwwVuIl25XVn3+T3dIll/0eLdg+Oxgmpdseft1SzPrHOSsK8ZI15trV0JRs3GxFj9DD5 biFvMdZT/fE+bs0cEOXbKbZUNQDx4H+Xy9vxW43OI6CBaQFIVp+WO7Fs+c6YxF8nHoI1 +yNg== X-Gm-Message-State: AOAM5318A5mtzjEJYXOaKxkFwb733fjCAgrJbisj/79MP2AjZktvnoO8 +Y5X2Kh9cJ2ZRDcZJajAjQg+Y9QTrFJvp+4ocGTOl3KfOuI= X-Received: by 2002:a25:aea8:: with SMTP id b40mr13150562ybj.347.1607452306014; Tue, 08 Dec 2020 10:31:46 -0800 (PST) MIME-Version: 1.0 References: <20201203160245.1014867-1-jackmanb@google.com> <20201203160245.1014867-13-jackmanb@google.com> In-Reply-To: From: Andrii Nakryiko Date: Tue, 8 Dec 2020 10:31:35 -0800 Message-ID: Subject: Re: [PATCH bpf-next v3 12/14] bpf: Pull tools/build/feature biz into selftests Makefile To: Brendan Jackman Cc: bpf , Alexei Starovoitov , Yonghong Song , Daniel Borkmann , KP Singh , Florent Revest , open list , Jann Horn Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 8, 2020 at 9:04 AM Brendan Jackman wrote: > > On Mon, Dec 07, 2020 at 06:19:12PM -0800, Andrii Nakryiko wrote: > > On Mon, Dec 7, 2020 at 3:00 AM Brendan Jackman wrote: > > > > > > On Fri, Dec 04, 2020 at 11:00:24AM -0800, Andrii Nakryiko wrote: > > > > On Fri, Dec 4, 2020 at 1:41 AM Brendan Jackman wrote: > > > > > > > > > > On Thu, Dec 03, 2020 at 01:01:27PM -0800, Andrii Nakryiko wrote: > > > > > > On Thu, Dec 3, 2020 at 8:07 AM Brendan Jackman wrote: > > > > > > > > [...] > > > > > > Ah right gotcha. Then yeah I think we can do this: > > > > > > BPF_ATOMICS_SUPPORTED = $(shell \ > > > echo "int x = 0; int foo(void) { return __sync_val_compare_and_swap(&x, 1, 2); }" \ > > > | $(CLANG) -x cpp-output -S -target bpf -mcpu=v3 - -o /dev/null && echo 1 || echo 0) > > > > Looks like it would work, yes. > / > > Curious what "-x cpp-output" does? > > That's just to tell Clang what language to expect, since it can't infer > it from a file extension: > > $ echo foo | clang -S - > clang-10: error: -E or -x required when input is from standard input > > Yonghong pointed out that we can actually just use `-x c`. yeah, that's what confused me, as we don't really write C++ for BPF code :) All good.