Zig doesn't support strip(1) until bug 258872. Instead one can use llvm-strip(1) or builtin strip via build.zig e.g., ports 1406a61cc813. $ ncdu2 pid 12345 comm ncdu2 has trashed its stack, killing Illegal instruction
I've confirmed that it works fine on 12.4 but not on 13.2. I'll use llvm-strip instead. Thanks.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e09856245353723cad581eaabb653a4c97d35460 commit e09856245353723cad581eaabb653a4c97d35460 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2023-09-04 09:07:32 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2023-09-04 09:08:04 +0000 sysutils/ncdu2: Use llvm-strip instead of strip - Bump PORTREVISION for package change PR: 273277 Reported by: jbeich sysutils/ncdu2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Committed. Thanks!
(In reply to commit-hook from comment #2) With this commit ncdu2 will now get unconditionally stripped, which shouldn't happen, for example when setting WITH_DEBUG (see https://docs.freebsd.org/en/books/porters-handbook/makefiles/#install-strip). So that is at most a partial fix. Additionally it seems like zig supports a ´--strip´ commandline flag which should result in a stripped binary being build, so using that should be investigated.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1189ae1e7a82f7d3b06a7d9305630e38f38ab2b2 commit 1189ae1e7a82f7d3b06a7d9305630e38f38ab2b2 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2023-09-04 13:16:29 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2023-09-04 13:16:48 +0000 sysutils/ncdu2: Add WITH_DEBUG check PR: 273277 Reported by: Benjamin Takacs <nimaje+fbz@bureaucracy.de> sysutils/ncdu2/Makefile | 2 ++ 1 file changed, 2 insertions(+)
(In reply to Benjamin Takacs from comment #4) I've tried adding --strip but zig 0.10.1 says "Unrecognized argument: --strip". I did not find the official documentation for --strip.