On 10/31/2018 09:49 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 31, 2018 at 12:57:18PM -0700, Andrey Ignatov escreveu: >> Arnaldo Carvalho de Melo reported build error in libbpf when clang >> version 3.8.1-24 (tags/RELEASE_381/final) is used: >> >> libbpf.c:2201:36: error: comparison of constant -22 with expression of >> type 'const enum bpf_attach_type' is always false >> [-Werror,-Wtautological-constant-out-of-range-compare] >> if (section_names[i].attach_type == -EINVAL) >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~ >> 1 error generated. >> >> Fix the error by keeping "is_attachable" property of a program in a >> separate struct field instead of trying to use attach_type itself. > > Thanks, now it builds in all the previously failing systems: > > # export PERF_TARBALL=http://192.168.86.4/perf/perf-4.19.0.tar.xz > # dm debian:9 fedora:25 fedora:26 fedora:27 ubuntu:16.04 ubuntu:17.10 > 1 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 > clang version 3.8.1-24 (tags/RELEASE_381/final) > 2 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) > clang version 3.9.1 (tags/RELEASE_391/final) > 3 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2) > clang version 4.0.1 (tags/RELEASE_401/final) > 4 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6) > clang version 5.0.2 (tags/RELEASE_502/final) > 5 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 > 20160609 clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) > 6 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0 > clang version 4.0.1-6 (tags/RELEASE_401/final) > # > > Tested-by: Arnaldo Carvalho de Melo <a...@redhat.com>
Thanks everyone, applied to bpf tree.