Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5327216ybv; Tue, 11 Feb 2020 13:35:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxCQl17UocILfQnoW4XisLStvDPC4J6UQVj8mtO2OSTEHK4CHjfieHcO86oNlNjWyd45B1R X-Received: by 2002:a9d:7357:: with SMTP id l23mr6529655otk.10.1581456909610; Tue, 11 Feb 2020 13:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581456909; cv=none; d=google.com; s=arc-20160816; b=UfDg3P+32J7fdCPBFtjEpHK+/IRTV48S+yB4gLzcF17dh2K6w4wyj6OwaQ0POj8QCw z7wjTOJYsvhXyFBsQzhwxjKscfA5vLBmRYR7l3j20J76MTtrzRLpCVqZE+Y3y6Z6d8Yg 5VwiTPWNiyHSJY2QvLR8p8Yr9PCM4dZt9qYUTJnwQFi024UkMX1Ar0TTnP5GyoHHJn70 OXAxfP/VXvtaR4szKzCozHCz10HFEb/cOsVmYhPNE3lpD2r8IS4BYjieZbd09ynZ0u+S PnytJg4nA1pODFpe141HPqu2ggwynIxflKl2YUKRGtPzRa0HDshektRAHU+myT/kXM9q 6wkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4OgG0hetIsP1V38kbC307zOjczZWs0KOp5Ez5Rl0KME=; b=C0OFNcPe4vqAMVVCR0VruHgfZV4NHIaLVlDw/cqe6hXg3OgoQk0y36m2v2xBu9xtKK eF3mK1VmOd5jBK905wecqyYp8s/GWuG2osF2DecqEalw1MxtddHwnycB8iJPF5hE2KLR mQGLgOMT/1QmHpUKs6wH3L5VHIgL1sKWxjIY8Z1qRbBajrkkp4Wt+xlchYsjFZE2/ce0 TCJ/+w7Zak3qCLAy6mIjccf3C2lAnMnC/AHqWPYMgrvRN1jZIPjyqUBf3LgM6zfHlhGf H8qqsHWHGL2RR93t7L9SZW/H+6wuUf0fK8Ctz6IsFcfM2HrE8gD1+TUZ4/4hycVIiCji lbDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lDSRjevb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si2683649otk.80.2020.02.11.13.34.58; Tue, 11 Feb 2020 13:35:09 -0800 (PST) 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=@google.com header.s=20161025 header.b=lDSRjevb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731315AbgBKSUx (ORCPT + 99 others); Tue, 11 Feb 2020 13:20:53 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33185 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731309AbgBKSUu (ORCPT ); Tue, 11 Feb 2020 13:20:50 -0500 Received: by mail-pf1-f195.google.com with SMTP id n7so5902556pfn.0 for ; Tue, 11 Feb 2020 10:20:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4OgG0hetIsP1V38kbC307zOjczZWs0KOp5Ez5Rl0KME=; b=lDSRjevbxM40tz/93zZtEf0l5hvgAJaYkwnSWnpl1y1J058EWn71+v9gGdFqjyE+LM 1s4OIdw7yTpcWQTOq78Kzb/qRXieUEXKhZD1e2no6c6b8LIKHiCiOhHk5IQ7CvjD+4ZG iamdeGk/eC+W3+8zZ3SoHfWNLug+eDxbO22PGJxFXTjmO3FyBy9bpuBT9fAD+SJoPWRy swmj5LdJkecykIqqY9Xqa+ITTp8kIdfwQlM67qbKEfKq2cmKZSsVZ+Ghx1T9cJJCeA3s sPO8DhjPO+7NsB6lmFx1DVTzfI3s0fn2XPRQlZb5shxgKYa3Qgijkc12NseHBQcRqo+R LdDw== 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=4OgG0hetIsP1V38kbC307zOjczZWs0KOp5Ez5Rl0KME=; b=D1Bb316KZ263NmUUWpKPfRAYG4KZHDcUSH++J6N1cHlTmqsYPf2OjX7BjIigSv1ir9 G7XwMpLnly4Y3YIpsd87H6EpWGFHfF6IHaolhAT+Z6ZtueI2lfi6vT1Wfo0R4L6ltMvA C5EoxBYT4y/8jlkO/bzu0O6Xojz/4EbzuLtkSAnH1wXb38NwQ5IvRogcgiA73h+0FQFA gzQFmH92JXVHFzUbeb1YbJZ/rErxZJxIcxoXJvPHrM6zIlAuGudysoixqtX46BxLnLH6 wIsw9WNuOX+sir8BcIhc7AKBN/hKlqSD4OhINuFa9SKMpxW93LVWfRAbCtbfBE+qGA0k mFAw== X-Gm-Message-State: APjAAAWLmzwsKAWJOWETTOPzuVGFHpAJ5/GlnVPCcHNBraXq+NhU0PY9 9KNsyhjS7ILSjOTKMZpXy9eS06VCe79moImEQkv4Sw== X-Received: by 2002:a62:1615:: with SMTP id 21mr4402234pfw.84.1581445249952; Tue, 11 Feb 2020 10:20:49 -0800 (PST) MIME-Version: 1.0 References: <20200128021145.36774-1-palmerdabbelt@google.com> <20200128021145.36774-2-palmerdabbelt@google.com> In-Reply-To: <20200128021145.36774-2-palmerdabbelt@google.com> From: Nick Desaulniers Date: Tue, 11 Feb 2020 18:20:39 +0000 Message-ID: Subject: Re: [PATCH 1/4] selftests/bpf: Elide a check for LLVM versions that can't compile it To: Palmer Dabbelt Cc: Bjorn Topel , Daniel Borkmann , Alexei Starovoitov , zlim.lnx@gmail.com, Catalin Marinas , Will Deacon , Martin KaFai Lau , Song Liu , Yonghong Song , andriin@fb.com, Shuah Khan , Network Development , bpf@vger.kernel.org, Linux ARM , LKML , "open list:KERNEL SELFTEST FRAMEWORK" , clang-built-linux , kernel-team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 6:14 PM 'Palmer Dabbelt' via Clang Built Linux wrote: > > The current stable LLVM BPF backend fails to compile the BPF selftests > due to a compiler bug. The bug has been fixed in trunk, but that fix > hasn't landed in the binary packages I'm using yet (Fedora arm64). > Without this workaround the tests don't compile for me. > > This patch triggers a preprocessor warning on LLVM versions that > definitely have the bug. The test may be conservative (ie, I'm not sure > if 9.1 will have the fix), but it should at least make the current set > of stable releases work together. Do older versions of clang still work? Should there be a lower bounds? > > See https://reviews.llvm.org/D69438 for more information on the fix. I > obtained the workaround from > https://lore.kernel.org/linux-kselftest/aed8eda7-df20-069b-ea14-f06628984566@gmail.com/T/ > > Fixes: 20a9ad2e7136 ("selftests/bpf: add CO-RE relocs array tests") > Signed-off-by: Palmer Dabbelt > --- > .../testing/selftests/bpf/progs/test_core_reloc_arrays.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c b/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c > index bf67f0fdf743..c9a3e0585a84 100644 > --- a/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c > +++ b/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c > @@ -40,15 +40,23 @@ int test_core_arrays(void *ctx) > /* in->a[2] */ > if (BPF_CORE_READ(&out->a2, &in->a[2])) > return 1; > +#if defined(__clang__) && (__clang_major__ < 10) && (__clang_minor__ < 1) > +# warning "clang 9.0 SEGVs on multidimensional arrays, see https://reviews.llvm.org/D69438" > +#else > /* in->b[1][2][3] */ > if (BPF_CORE_READ(&out->b123, &in->b[1][2][3])) > return 1; > +#endif > /* in->c[1].c */ > if (BPF_CORE_READ(&out->c1c, &in->c[1].c)) > return 1; > +#if defined(__clang__) && (__clang_major__ < 10) && (__clang_minor__ < 1) > +# warning "clang 9.0 SEGVs on multidimensional arrays, see https://reviews.llvm.org/D69438" > +#else > /* in->d[0][0].d */ > if (BPF_CORE_READ(&out->d00d, &in->d[0][0].d)) > return 1; > +#endif > > return 0; > } > -- > 2.25.0.341.g760bfbb309-goog > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200128021145.36774-2-palmerdabbelt%40google.com. -- Thanks, ~Nick Desaulniers