From: Dimitry Andric Date: Tue, 28 Jan 2025 17:36:16 +0000 (+0100) Subject: libgcc: On FreeBSD use GCC's crt objects for static linking X-Git-Tag: releases/gcc-14.3.0~517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=796849274c155d6f3430d94500cfa3c11fb59a1d;p=thirdparty%2Fgcc.git libgcc: On FreeBSD use GCC's crt objects for static linking Add crtbeginT.o to extra_parts on FreeBSD. This ensures we use GCC's crt objects for static linking. Otherwise it could mix crtbeginT.o from the base system with libgcc's crtend.o, possibly leading to segfaults. libgcc: PR target/118685 * config.host (*-*-freebsd*): Add crtbeginT.o to extra_parts. Signed-off-by: Dimitry Andric --- diff --git a/libgcc/config.host b/libgcc/config.host index 73329037044..8ad2f404786 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -289,7 +289,7 @@ case ${host} in # machine-specific sections may refine and add to this # configuration. tmake_file="$tmake_file t-freebsd t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + extra_parts="crtbegin.o crtend.o crtbeginS.o crtbeginT.o crtendS.o" case ${target_thread_file} in posix) tmake_file="${tmake_file} t-freebsd-thread"