===> 7-zip-21.06 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by 7-zip-21.06 for building ===> Extracting for 7-zip-21.06 => SHA256 Checksum OK for 7z2106-src.7z. ===> Patching for 7-zip-21.06 ===> Converting DOS text files to UNIX text files ===> Applying FreeBSD patches for 7-zip-21.06 from /usr/ports/archivers/7-zip/files echo > /usr/ports/archivers/7-zip/work/7-zip-21.06/CPP/7zip/warn_clang.mak ===> 7-zip-21.06 depends on package: gmake>=4.3 - found ===> 7-zip-21.06 depends on shared library: libsysinfo.so - found (/usr/local/lib/libsysinfo.so) ===> Configuring for 7-zip-21.06 ===> Building for 7-zip-21.06 gmake[2]: Entering directory '/usr/ports/archivers/7-zip/work/7-zip-21.06/CPP/7zip/Bundles/Alone2' mkdir -p b/c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/7zBuf2.o ../../../../C/7zBuf2.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/7zStream.o ../../../../C/7zStream.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Alloc.o ../../../../C/Alloc.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Bcj2.o ../../../../C/Bcj2.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Bcj2Enc.o ../../../../C/Bcj2Enc.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Blake2s.o ../../../../C/Blake2s.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Bra.o ../../../../C/Bra.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Bra86.o ../../../../C/Bra86.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/BraIA64.o ../../../../C/BraIA64.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/BwtSort.o ../../../../C/BwtSort.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/CpuArch.o ../../../../C/CpuArch.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/Delta.o ../../../../C/Delta.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/HuffEnc.o ../../../../C/HuffEnc.c clang -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -O2 -c -Wall -Werror -Wextra -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -O2 -pipe -mcpu=cortex-a53 -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o b/c/LzFind.o ../../../../C/LzFind.c ../../../../C/CpuArch.c:424:10: fatal error: 'asm/hwcap.h' file not found #include <asm/hwcap.h> ^~~~~~~~~~~~~ 1 error generated. gmake[2]: *** [../../7zip_gcc.mak:1049: b/c/CpuArch.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: Leaving directory '/usr/ports/archivers/7-zip/work/7-zip-21.06/CPP/7zip/Bundles/Alone2' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/archivers/7-zip *** Error code 1 Stop. make: stopped in /usr/ports/archivers/7-zip
This port appears to essentially be a duplicate of archivers/p7zip If archivers/p7zip works for you (as it should). This port a moot. :-)
Hi Chris, p7zip is based on a several years old code base that has known vulns and is abandoned. This is the "current" upstream and "official" code base.
(In reply to Daniel Engberg from comment #2) Ahh. OK fair enough. It was easy to get the impression this was just another version of the same. I now see p7zip has also been abandoned in the ports tree. Maybe this version might add a comment to the effect that this is a replacement for archivers/p7zip. Users might also benefit from having p7zip being removed from the tree. I'll submit a pr with an expiration date for it. Thanks for the heads-up, Dan. :-) --Chris
Created attachment 230136 [details] v0 Try the attached patch.
Seems to work although I'm not sure if we should enforce the cflags instead of encouraging people to use CPUTYPE variable instead?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b6bf306d87ea3b01bbdeb47688b2456fdca04ad7 commit b6bf306d87ea3b01bbdeb47688b2456fdca04ad7 Author: Max Brazhnikov <makc@FreeBSD.org> AuthorDate: 2021-12-28 14:32:52 +0000 Commit: Max Brazhnikov <makc@FreeBSD.org> CommitDate: 2021-12-28 14:32:57 +0000 archivers/7-zip: Update to 21.07 Merge patches to fix build on arm64 [1]. PR: 260329 [1] Reported by: diizzy@ Submitted by: mikael@ archivers/7-zip/Makefile | 6 ++-- archivers/7-zip/distinfo | 6 ++-- .../7-zip/files/patch-CPP_Windows_SystemInfo.cpp | 11 ++++++- archivers/7-zip/files/patch-C_CpuArch.c (new) | 34 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 7 deletions(-)
(In reply to Daniel Engberg from comment #5) Daniel, Mikael could you enlighten me on this CPUTYPE/CFLAGS topic? I've just committed the patch without CFLAGS_aarch64 bits.
I think trying to handle CPU specific features within a port unless autodetection is broken and the amount of work to fix it is unreasonable should be avoided as it can easily become a mess when you have ports hardsetting CPU specific optimizations. While I haven't specifically looked into 7-zip it may cause the application/library to be broken if there's no run-time detection in place for said feature(s) and we do have global variable to define a specific CPU these called CPUTYPE which gets passed on as -mcpu=XXX https://cgit.freebsd.org/src/tree/share/examples/etc/make.conf#n25
(In reply to Max Brazhnikov from comment #7) It's required because IIRC clang doesn't understand some attributes and fails to build 7zip: ../../../../C/7zCrc.c:158:1: warning: unknown architecture 'armv8-a+crc' in the 'target' attribute string; 'target' attribute ignored [-Wignored-attributes] ATTRIB_CRC snip ../../../../C/Sha256Opt.c:329:5: error: assigning to 'v128' (aka 'uint32x4_t') from incompatible type 'int' R16 ( 0, NNN, NNN, SM1, NNN, SM1, SM2, SM1, SM2 );
*** Bug 261384 has been marked as a duplicate of this bug. ***
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3d0da7220ca950600c5ddaf70797c27b00803a5c commit 3d0da7220ca950600c5ddaf70797c27b00803a5c Author: Max Brazhnikov <makc@FreeBSD.org> AuthorDate: 2022-01-30 17:29:49 +0000 Commit: Max Brazhnikov <makc@FreeBSD.org> CommitDate: 2022-01-30 17:29:49 +0000 archivers/7-zip: set CFLAGS to fix build on aarch64 The code will use CRC instructions at runtime if available. PR: 260329 archivers/7-zip/Makefile | 1 + 1 file changed, 1 insertion(+)
Fixed now, thanks!
Created attachment 231450 [details] Patch for C/7zCrc.c Please try dropping the attached patch into archivers/7-zip/files, and recompiling for aarch64.
Folks, rollback CFLAGS changes and test Dimitry's patch please.
(In reply to Dimitry Andric from comment #13) The issue is the same.
I confirm the patch in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260329#c13 coes not fix the problem
Compiles on aarch64 for a few months by now