lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Apr 2022 01:29:03 -0700
From:   Yury Norov <yury.norov@...il.com>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Maxim Kuvyrkov <maxim.kuvyrkov@...aro.org>
Subject: Re: linux-next: build warning after merge of the bitmap tree

Hi Stephen,

(Adding Maxim Kuvyrkov from linaro/TCWG as he might be interested in
arm part of this.

On Wed, Apr 20, 2022 at 12:55 AM Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>
> Hi all,
>
> After merging the bitmap tree, today's linux-next build (htmldocs)
> produced this warning:
>
> Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:425: WARNING: Unexpected indentation.
> Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:426: WARNING: Block quote ends without a blank line; unexpected unindent.
> Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:431: WARNING: Unexpected indentation.
>
> Introduced by commit
>
>   6f46c24da767 ("bitmap: add bitmap_weight_{cmp, eq, gt, ge, lt, le} functions")

I'll build docs and fix those warnings. Thanks for pointing this out.

>From previous linux-next build message:

> ../lib/bitmap.c:21:5: error: conflicting types for '__bitmap_weight_cmp'; have 'int(const long unsigned int *, unsigned int,  int)'
>    21 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits, int num)
>       |     ^~~~~~~~~~~~~~~~~~~
> In file included from ../lib/bitmap.c:6:
> tools/include/linux/bitmap.h:15:5: note: previous declaration of '__bitmap_weight_cmp' with type 'int(const long unsigned int *, unsigned int,  unsigned int)'
>    15 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits,
>       |     ^~~~~~~~~~~~~~~~~~~
> ../lib/bitmap.c: In function '__bitmap_weight_cmp':
> ../lib/bitmap.c:26:50: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
>    26 |                 if (w + bits - k * BITS_PER_LONG < num)
>       |                                                  ^
> ../lib/bitmap.c:31:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
>    31 |                 if (w > num)
>       |                       ^
> cc1: all warnings being treated as errors
> tools/perf/../lib/bitmap.c:21:5: error: conflicting types for '__bitmap_weight_cmp'; have 'int(const long unsigned int *, unsigned int,  int)'
>    21 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits, int num)
>       |     ^~~~~~~~~~~~~~~~~~~
> In file included from tools/perf/../lib/bitmap.c:6:
> tools/include/linux/bitmap.h:15:5: note: previous declaration of '__bitmap_weight_cmp' with type 'int(const long unsigned int *, unsigned int,  unsigned int)'
>    15 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits,
>       |     ^~~~~~~~~~~~~~~~~~~
> tools/perf/../lib/bitmap.c: In function '__bitmap_weight_cmp':
> tools/perf/../lib/bitmap.c:26:50: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
>    26 |                 if (w + bits - k * BITS_PER_LONG < num)
>       |                                                  ^
> tools/perf/../lib/bitmap.c:31:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
>    31 |                 if (w > num)
>       |                       ^
> cc1: all warnings being treated as errors

I fixed tools build error and updated the bitmap-for-next branch. The
problem is that tools/perf
enables -Werror=sign-compare, and main kernel not. So direct copying
of functions from kernel
to tools doesn't work. This might be an issue by itself because I
think it would be better to keep
kernel and tools code consistent whenever possible.

Another problem is that the tools lacks testing from (obviously) me,
0-day and TCWG. I added
tools/perf to my testing build suite, and found that the build fails
for arm and s390 on v5.18-rc2.
See tools/perf build log attached.

Thanks,
Yury

s390:
  PERF_VERSION = 5.18.rc2.gce522ba9ef7e
In file included from /usr/s390x-linux-gnu/include/stdio.h:866,
                 from
/home/yury/work/linux/tools/lib/perf/include/perf/cpumap.h:7,
                 from util/session.c:13:
In function ‘printf’,
    inlined from ‘dump_event’ at util/session.c:1292:2,
    inlined from ‘machines__deliver_event’ at util/session.c:1502:2,
    inlined from ‘perf_session__deliver_synth_event’ at util/session.c:1703:9:
/usr/s390x-linux-gnu/include/bits/stdio2.h:112:10: error: ‘%s’
directive argument is null [-Werror=format-overflow=]
  112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt,
__va_arg_pack ());
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util/session.c: In function ‘perf_session__deliver_synth_event’:
util/session.c:1292:25: note: format string is defined here
 1292 |  printf("\n%#" PRIx64 "@%s [%#x]: event: %d\n",
      |                         ^~
cc1: all warnings being treated as errors

arm:
  PERF_VERSION = 5.18.rc2.gce522ba9ef7e
/tmp/ccHIlKZJ.s: Assembler messages:
/tmp/ccHIlKZJ.s:541: Error: selected processor does not support `ldrd
r0,r1,[r2]' in ARM mode
/tmp/ccHIlKZJ.s:630: Error: selected processor does not support `strd
r4,r5,[r3]' in ARM mode
make[9]: *** [/home/yury/work/linux/tools/build/Makefile.build:96:
/home/yury/work/linux/build/arm/tools/perf/arch/arm/util/auxtrace.o]
Error 1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ