btrfs on 4.14 throws compile warning in ZSTD_decodeSequenceLong |
||||
Issue description
Enabling CONFIG_BTRFS_FS=y on 4.14 causes a compile warning:
/mnt/host/source/src/third_party/kernel/v4.14/lib/zstd/decompress.c: In function ‘ZSTD_decodeSequenceLong’:
/mnt/host/source/src/third_party/kernel/v4.14/lib/zstd/decompress.c:1195:21: error: array subscript is above array bounds [-Werror=array-bounds]
offset = OF_base[ofCode] + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
^
This doesn't happen with clang or gcc 6.3, just the older gcc 4.9 in the chroot.
,
Jan 31 2018
as long as we're building our kernels w/gcc-4.9 then, we'll have to add a CHROMIUM hack to disable this warning in this file/location ?
,
Jan 31 2018
Decisions have consequences. In this case it is the decision to stick with gcc v4.9.x which has consequences. Kernels for some architectures don't even build anymore with gcc 4.9.x (it bails out with compiler errors, or in some cases due to changes assembler mnemonics), so we have to consider ourselves lucky.
,
Jan 31 2018
So chromium patch it is? I'll put that together. a BUG_ON checking array bounds should do the trick.
,
Feb 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/dd48fe25e65e382dde3f1331f339d0985132d329 commit dd48fe25e65e382dde3f1331f339d0985132d329 Author: Dylan Reid <dgreid@chromium.org> Date: Thu Feb 01 10:41:52 2018 CHROMIUM: lib: zstd: Add check for OF_base array bounds Chrome OS compiles with gcc 4.9.x which doesn't like this code without the check. It isn't a real problem and newer compilers know that, so keep a local chromium patch to work around it until we move to a newer compiler. BUG= 807532 TEST=Build kernel for tatl with brtfs and zstd enabled. Change-Id: Iaed17679f5351616adf5540a07c5b4ba40c0feda Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/895964 Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/dd48fe25e65e382dde3f1331f339d0985132d329/lib/zstd/decompress.c
,
Feb 2 2018
,
May 9 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by groeck@chromium.org
, Jan 31 2018