]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc: On FreeBSD use GCC's crt objects for static linking
authorDimitry Andric <dimitry@andric.com>
Tue, 28 Jan 2025 17:36:16 +0000 (18:36 +0100)
committerGerald Pfeifer <gerald@pfeifer.com>
Thu, 20 Feb 2025 15:10:41 +0000 (16:10 +0100)
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 <dimitry@andric.com>
libgcc/config.host

index 89e3dbc7c8a7d45d0873e4ed6567469138cb1d86..8aa22123addb5f7159917abf5d66805c99a8b99c 100644 (file)
@@ -271,7 +271,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"