Building world with FORTIFY_SOURCE (contrib/ and sys/contrib/ patches)

From: Dmitry Salychev <dsl_at_FreeBSD.org>
Date: Wed, 25 Jun 2025 20:13:43 UTC
Hi,

I was trying to build world for arm64 with FORTIFY_SOURCE and several
additional parameters:

$ cat /etc/src-env.conf
FORTIFY_SOURCE=2
$ cat /etc/src.conf
WITH_RETPOLINE=yes
WITH_KERNEL_RETPOLINE=yes
WITH_BIND_NOW=yes
OPT_INIT_ALL=zero

but got several errors and patched contrib/ and sys/contrib/:

https://reviews.freebsd.org/D51047

I'm going wrong direction, it seems. I'm not sure whether I've to patch
that code at all. And if so, how to do it correctly in order not to
override those changes later on when new versions will be imported into
the repository?

Regards,
Dmitry

--
https://wiki.freebsd.org/DmitrySalychev