aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2026-05-07 17:30:05 +0000
committerRyan Libby <rlibby@FreeBSD.org>2026-05-07 17:30:05 +0000
commit944a4eb089b33241b21979253e0a373ce0bdf984 (patch)
tree54462a64b183bd60c0a383ddcdee17f3454540dc
parent54625dfb363a4a00841ef7d7ee8e5cc5ea1156e0 (diff)
stand/libsa/zfs: disable ZSTD_TRACE and DYNAMIC_BMI2 code paths
Enabling ZSTD_TRACE leaves behind undefined weak symbols, which causes a problem for gcc builds. The bfd linker emits an obscure error about overlapping FDEs. We don't need ZSTD_TRACE for libsa, so just disable it. Also disable BMI2 instruction optimizations. The addition of the optional BMI2 code paths caused the boot loader binaries to grow larger (28 KiB for clang, 32 KiB for gcc). The boot loader binaries are size constrained, and this pushed the gcc-generated lua_loader.bin over the 500000 byte limit, and the clang one to within 4k of the limit. Fixes: 8a62a2a5659d ("zfs: merge openzfs/zfs@f8e5af53e") Reviewed by: delphij, imp, mm Differential Revision: https://reviews.freebsd.org/D56866
-rw-r--r--stand/libsa/zfs/Makefile.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc
index 3df6779559c9..540635d144ef 100644
--- a/stand/libsa/zfs/Makefile.inc
+++ b/stand/libsa/zfs/Makefile.inc
@@ -75,9 +75,13 @@ CFLAGS.zfs.c+= -DHAS_ZSTD_ZFS \
#
# ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's
# use of BMI instrucitons is broken in this environment, so avoid them.
+# Avoid generating the DYNAMIC_BMI2 code paths because the code duplication
+# inflates the resulting binaries. Disable ZSTD_TRACE because we don't need it
+# and the bfd linker trips over the weak undefined symbols it generates.
#
.for i in ${ZSTD_SRC}
-CFLAGS.$i+= -U__BMI__ ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.$i+= -U__BMI__ -DDYNAMIC_BMI2=0 -DZSTD_TRACE=0 \
+ ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
.endfor
CFLAGS.zfs_zstd.c+= -DIN_BASE -DIN_LIBSA