Re: libbpf build failure on debian:9 with clang

2018-10-31 Thread Andrey Ignatov
Arnaldo Carvalho de Melo  [Wed, 2018-10-31 07:12 -0700]:
>   1740.66 debian:9  : FAIL gcc (Debian 
> 6.3.0-18+deb9u1) 6.3.0 20170516
> 
> The failure was with clang tho:
> 
> clang version 3.8.1-24 (tags/RELEASE_381/final)
> 
> With:
> 
>   gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) 
> 
> it built without any warnings/errors.
> 
>   CC   /tmp/build/perf/libbpf.o
> 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.

Hi Arnaldo,

I have a clang version that I can reproduce this error with. Working on
patch.

Thank you for report!


>   CC   /tmp/build/perf/help.o
> mv: cannot stat '/tmp/build/perf/.libbpf.o.tmp': No such file or directory
> /git/linux/tools/build/Makefile.build:96: recipe for target 
> '/tmp/build/perf/libbpf.o' failed
> make[4]: *** [/tmp/build/perf/libbpf.o] Error 1
> 
> This is the cset:
> 
> commit 956b620fcf0b64de403cd26a56bc41e6e4826ea6
> Author: Andrey Ignatov 
> Date:   Wed Sep 26 15:24:53 2018 -0700
> 
> libbpf: Introduce libbpf_attach_type_by_name
> 
> 
> 
> Tests are continuing, so far:
> 
>143.53 alpine:3.4: Ok   gcc (Alpine 5.3.0) 5.3.0
>258.62 alpine:3.5: Ok   gcc (Alpine 6.2.1) 6.2.1 
> 20160822
>351.62 alpine:3.6: Ok   gcc (Alpine 6.3.0) 6.3.0
>451.68 alpine:3.7: Ok   gcc (Alpine 6.4.0) 6.4.0
>549.38 alpine:3.8: Ok   gcc (Alpine 6.4.0) 6.4.0
>679.07 alpine:edge   : Ok   gcc (Alpine 6.4.0) 6.4.0
>763.35 amazonlinux:1 : Ok   gcc (GCC) 4.8.5 20150623 
> (Red Hat 4.8.5-28)
>859.65 amazonlinux:2 : Ok   gcc (GCC) 7.3.1 20180303 
> (Red Hat 7.3.1-5)
>947.39 android-ndk:r12b-arm  : Ok   arm-linux-androideabi-gcc 
> (GCC) 4.9.x 20150123 (prerelease)
>   1050.64 android-ndk:r15c-arm  : Ok   arm-linux-androideabi-gcc 
> (GCC) 4.9.x 20150123 (prerelease)
>   1128.75 centos:5  : Ok   gcc (GCC) 4.1.2 20080704 
> (Red Hat 4.1.2-55)
>   1233.26 centos:6  : Ok   gcc (GCC) 4.4.7 20120313 
> (Red Hat 4.4.7-23)
>   1343.16 centos:7  : Ok   gcc (GCC) 4.8.5 20150623 
> (Red Hat 4.8.5-28)
>   1473.61 clearlinux:latest : FAIL gcc (Clear Linux OS for 
> Intel Architecture) 8.2.1 20180502
>   1545.56 debian:7  : Ok   gcc (Debian 4.7.2-5) 4.7.2
>   1645.53 debian:8  : Ok   gcc (Debian 
> 4.9.2-10+deb8u1) 4.9.2
>   1740.66 debian:9  : FAIL gcc (Debian 
> 6.3.0-18+deb9u1) 6.3.0 20170516
>   18   113.19 debian:experimental   : Ok   gcc (Debian 8.2.0-8) 8.2.0
>   1941.48 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc 
> (Debian 8.2.0-7) 8.2.0
>   2041.51 debian:experimental-x-mips: Ok   mips-linux-gnu-gcc (Debian 
> 8.2.0-7) 8.2.0
>   2140.09 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc 
> (Debian 8.1.0-12) 8.1.0
>   2242.17 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc 
> (Debian 8.2.0-7) 8.2.0
>   2340.02 fedora:20 : Ok   gcc (GCC) 4.8.3 20140911 
> (Red Hat 4.8.3-7)
>   2445.47 fedora:21 : Ok   gcc (GCC) 4.9.2 20150212 
> (Red Hat 4.9.2-6)
>   2541.64 fedora:22 : Ok   gcc (GCC) 5.3.1 20160406 
> (Red Hat 5.3.1-6)
>   2643.60 fedora:23 : Ok   gcc (GCC) 5.3.1 20160406 
> (Red Hat 5.3.1-6)
>   2744.04 fedora:24 : Ok   gcc (GCC) 6.3.1 20161221 
> (Red Hat 6.3.1-1)
>   2837.21 fedora:24-x-ARC-uClibc: Ok   arc-linux-gcc (ARCompact 
> ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
> 
> The problem with clearlinux is unrelated:
> 
> clang-7: error: unknown argument: '-fno-semantic-interposition'
> clang-7: error: unsupported argument '4' to option 'flto='
> clang-7: error: optimization flag '-ffat-lto-objects' is not supported 
> [-Werror,-Wignored-optimization-argument]
> 

-- 
Andrey Ignatov


libbpf build failure on debian:9 with clang

2018-10-31 Thread Arnaldo Carvalho de Melo
  1740.66 debian:9  : FAIL gcc (Debian 6.3.0-18+deb9u1) 
6.3.0 20170516

The failure was with clang tho:

clang version 3.8.1-24 (tags/RELEASE_381/final)

With:

  gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) 

it built without any warnings/errors.

  CC   /tmp/build/perf/libbpf.o
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.
  CC   /tmp/build/perf/help.o
mv: cannot stat '/tmp/build/perf/.libbpf.o.tmp': No such file or directory
/git/linux/tools/build/Makefile.build:96: recipe for target 
'/tmp/build/perf/libbpf.o' failed
make[4]: *** [/tmp/build/perf/libbpf.o] Error 1

This is the cset:

commit 956b620fcf0b64de403cd26a56bc41e6e4826ea6
Author: Andrey Ignatov 
Date:   Wed Sep 26 15:24:53 2018 -0700

libbpf: Introduce libbpf_attach_type_by_name



Tests are continuing, so far:

   143.53 alpine:3.4: Ok   gcc (Alpine 5.3.0) 5.3.0
   258.62 alpine:3.5: Ok   gcc (Alpine 6.2.1) 6.2.1 
20160822
   351.62 alpine:3.6: Ok   gcc (Alpine 6.3.0) 6.3.0
   451.68 alpine:3.7: Ok   gcc (Alpine 6.4.0) 6.4.0
   549.38 alpine:3.8: Ok   gcc (Alpine 6.4.0) 6.4.0
   679.07 alpine:edge   : Ok   gcc (Alpine 6.4.0) 6.4.0
   763.35 amazonlinux:1 : Ok   gcc (GCC) 4.8.5 20150623 
(Red Hat 4.8.5-28)
   859.65 amazonlinux:2 : Ok   gcc (GCC) 7.3.1 20180303 
(Red Hat 7.3.1-5)
   947.39 android-ndk:r12b-arm  : Ok   arm-linux-androideabi-gcc 
(GCC) 4.9.x 20150123 (prerelease)
  1050.64 android-ndk:r15c-arm  : Ok   arm-linux-androideabi-gcc 
(GCC) 4.9.x 20150123 (prerelease)
  1128.75 centos:5  : Ok   gcc (GCC) 4.1.2 20080704 
(Red Hat 4.1.2-55)
  1233.26 centos:6  : Ok   gcc (GCC) 4.4.7 20120313 
(Red Hat 4.4.7-23)
  1343.16 centos:7  : Ok   gcc (GCC) 4.8.5 20150623 
(Red Hat 4.8.5-28)
  1473.61 clearlinux:latest : FAIL gcc (Clear Linux OS for 
Intel Architecture) 8.2.1 20180502
  1545.56 debian:7  : Ok   gcc (Debian 4.7.2-5) 4.7.2
  1645.53 debian:8  : Ok   gcc (Debian 4.9.2-10+deb8u1) 
4.9.2
  1740.66 debian:9  : FAIL gcc (Debian 6.3.0-18+deb9u1) 
6.3.0 20170516
  18   113.19 debian:experimental   : Ok   gcc (Debian 8.2.0-8) 8.2.0
  1941.48 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc 
(Debian 8.2.0-7) 8.2.0
  2041.51 debian:experimental-x-mips: Ok   mips-linux-gnu-gcc (Debian 
8.2.0-7) 8.2.0
  2140.09 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc 
(Debian 8.1.0-12) 8.1.0
  2242.17 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 
8.2.0-7) 8.2.0
  2340.02 fedora:20 : Ok   gcc (GCC) 4.8.3 20140911 
(Red Hat 4.8.3-7)
  2445.47 fedora:21 : Ok   gcc (GCC) 4.9.2 20150212 
(Red Hat 4.9.2-6)
  2541.64 fedora:22 : Ok   gcc (GCC) 5.3.1 20160406 
(Red Hat 5.3.1-6)
  2643.60 fedora:23 : Ok   gcc (GCC) 5.3.1 20160406 
(Red Hat 5.3.1-6)
  2744.04 fedora:24 : Ok   gcc (GCC) 6.3.1 20161221 
(Red Hat 6.3.1-1)
  2837.21 fedora:24-x-ARC-uClibc: Ok   arc-linux-gcc (ARCompact ISA 
Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710

The problem with clearlinux is unrelated:

clang-7: error: unknown argument: '-fno-semantic-interposition'
clang-7: error: unsupported argument '4' to option 'flto='
clang-7: error: optimization flag '-ffat-lto-objects' is not supported 
[-Werror,-Wignored-optimization-argument]