CFLAGS="-D_FORTIFY_SOURCE=3" emerge =asterisk-18.13.0 produces something like: gcc -o chan_unistim.o -c chan_unistim.c -MD -MT chan_unistim.o -MF .chan_unistim.o.d -MP -pthread -I/var/tmp/portage/net-misc/asterisk-18.13.0/work/asterisk-18.13.0/include -D_FORTIFY_SOURCE=3 -I/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -DAST_MODULE=\"chan_unistim\" -DAST_MODULE_SELF_SYM=__internal_chan_unistim_self -Wno-format-truncation -D_FORTIFY_SOURCE=2 is the latest used and overwrites my setting.
sed "s:-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2::" -i configure.ac || die fixes the issue for me unless you want to dig more into why they are there.
This is fixed locally by adding AST_FORTIFY_SOURCE= to _make_opts. This is the simpler approach and the way I already sort much of the braindeadness. Just looking to also figure out https://bugs.gentoo.org/903913
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0141572cd12dcf374a9c2a3d982f0afb895a43fa commit 0141572cd12dcf374a9c2a3d982f0afb895a43fa Author: Jaco Kroon <jaco@uls.co.za> AuthorDate: 2023-05-10 21:36:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-11 01:28:39 +0000 net-misc/asterisk: add 20.2.1 Closes: https://bugs.gentoo.org/903912 Closes: https://bugs.gentoo.org/903913 Closes: https://bugs.gentoo.org/903775 Signed-off-by: Jaco Kroon <jaco@uls.co.za> Signed-off-by: Sam James <sam@gentoo.org> net-misc/asterisk/Manifest | 1 + net-misc/asterisk/asterisk-20.2.1.ebuild | 373 +++++++++++++++++++++++++++++++ 2 files changed, 374 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cc5bb67b6b0a2b5b8351a233508ad83aafc62a2 commit 2cc5bb67b6b0a2b5b8351a233508ad83aafc62a2 Author: Jaco Kroon <jaco@uls.co.za> AuthorDate: 2023-05-10 21:32:07 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-11 01:28:39 +0000 net-misc/asterisk: add 18.17.1 Bug: https://bugs.gentoo.org/903912 Bug: https://bugs.gentoo.org/903913 Bug: https://bugs.gentoo.org/903775 Signed-off-by: Jaco Kroon <jaco@uls.co.za> Signed-off-by: Sam James <sam@gentoo.org> net-misc/asterisk/Manifest | 1 + net-misc/asterisk/asterisk-18.17.1.ebuild | 377 +++++++++++++++++++++ ...ix-test-code-to-match-gethostbyname_r-pro.patch | 71 ++++ .../asterisk/files/asterisk_wrapper-18.17.1-20.2.1 | 227 +++++++++++++ net-misc/asterisk/files/initd-18.17.1-20.2.1 | 311 +++++++++++++++++ 5 files changed, 987 insertions(+)