Date: Sat, 2 Apr 2022 23:05:12 -0700 From: Xin Li <delphij@delphij.net> To: Peter Jeremy <peterj@freebsd.org>, Xin LI <delphij@freebsd.org>, jfc@mit.edu, Ed Maste <emaste@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: cd8822075a38 - main - MFV c144cc54795d: zlib 1.2.12. Message-ID: <be8f385e-3ef7-cb3a-5dbf-471e69c26991@delphij.net> In-Reply-To: <YkjtEf%2BjP63OiWOo@server.rulingia.com> References: <202203311426.22VEQajW058773@gitrepo.freebsd.org> <YkjtEf%2BjP63OiWOo@server.rulingia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------9gTfJvKUgNwEz70D070Bb609 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/2/22 17:40, Peter Jeremy wrote: > On 2022-Mar-31 14:26:36 +0000, Xin LI <delphij@FreeBSD.org> wrote: >> The branch main has been updated by delphij: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=cd8822075a38d0734e74b1735e4b5dbef9789170 >> >> commit cd8822075a38d0734e74b1735e4b5dbef9789170 >> Merge: e57f6630d9d4 c144cc54795d >> Author: Xin LI <delphij@FreeBSD.org> >> AuthorDate: 2022-03-31 14:25:53 +0000 >> Commit: Xin LI <delphij@FreeBSD.org> >> CommitDate: 2022-03-31 14:25:53 +0000 >> >> MFV c144cc54795d: zlib 1.2.12. > > This breaks the build on my arm64 box: > --- crc32.o --- > /usr/src/sys/contrib/zlib/crc32.c:106:61: error: 'W' is not defined, evaluates to 0 [-Werror,-Wundef] > #if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 > > The code in sys/contrib/zlib/crc32.c:74-99 is rather convoluted but > doing a test compile with '-E -dD', I get: > # 57 "/usr/src/sys/contrib/zlib/crc32.c" > #define N 5 > # 83 "/usr/src/sys/contrib/zlib/crc32.c" > #define W 8 > # 97 "/usr/src/sys/contrib/zlib/crc32.c" > #undef W > > Working through the various tests: > - Z_TESTW is undefined > - MAKECRCH is undefined > - __aarch64__ is defined > - Z_U8 is undefined > - Z_U4 is undefined > > Z_U8 sounds like it should be defined on a 64-bit arch and there's logic in > sys/contrib/zlib/zutil.h:45-54 to do so but: > - Z_U8 is not predefined > - Z_SOLO is defined at sys/contrib/zlib/zconf.h:13 because it's in the kernel. > > The backup Z_U4 definition at sys/contrib/zlib/zconf.h:423:432 is likewise > bypassed because Z_SOLO is defined. > > I believe that the correct fix for arm64 is along the lines of: > #define Z_U8 unsigned long > but I'm not sure how to weave that into the fairly complex mess of > conditionals. Could you please look into the logic for arm64. > > And, whilst I haven't yet checked, I suspect that the lack of Z_U4 and > Z_U8 definitions within the kernel is at least a misconfiguration on all > architecture, even if it only actively breaks the build on arm64. This was reported at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262977 Would you mind sharing additional information about your build? (e.g. are you using some special compiling options, the kernel configuration, etc.) This doesn't appear to be reproducible on ref14-aarch (I've added 'options ZFS' to GENERIC and verified that crc32.c did get compiled during the process), nor does it show up in `make tinderbox` which was part of my testing. In the meantime, could you help to test if the attached patch fixes the issue for you? (Because I can't reproduce the issue, I can only verify that the build would work before and after the patch, but that's not quite useful...) Cheers, --------------9gTfJvKUgNwEz70D070Bb609 Content-Type: text/x-patch; charset=UTF-8; name="zlib.patch" Content-Disposition: attachment; filename="zlib.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3N5cy9jb250cmliL3psaWIvenV0aWwuaCBiL3N5cy9jb250cmliL3ps aWIvenV0aWwuaAppbmRleCA4MzRkMzA2MzRjMTcuLmZmY2QwODgzZjY5YSAxMDA2NDQKLS0t IGEvc3lzL2NvbnRyaWIvemxpYi96dXRpbC5oCisrKyBiL3N5cy9jb250cmliL3psaWIvenV0 aWwuaApAQCAtMjksNiArMjksMTAgQEAKICMgIGluY2x1ZGUgPHN0ZGxpYi5oPgogI2VuZGlm CiAKKyNpZiBkZWZpbmVkKF9fRnJlZUJTRF9fKSAmJiBkZWZpbmVkKFpfU09MTykgJiYgIWRl ZmluZWQoU1REQykKKyMgIGRlZmluZSBaX1U4IF9fdWludDY0X3QKKyNlbmRpZgorCiAjaWZu ZGVmIGxvY2FsCiAjICBkZWZpbmUgbG9jYWwgc3RhdGljCiAjZW5kaWYK --------------9gTfJvKUgNwEz70D070Bb609--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?be8f385e-3ef7-cb3a-5dbf-471e69c26991>