From a36fd6667aaf019b382bca32db97c8354998bfe4 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 26 Jul 2014 14:59:47 +0200 Subject: [PATCH] Use crtbeginS.o and crtendS.o everywhere. * Gcc is now using __cxa_atexit, so we need to use the crtbegin and crtend implementations that are meant to be used for shared libraries. This avoids crashes of servers that load add-ons (Media-Addon-Server and Print-Server) when shutting down Haiku. * As executable are shared on Haiku, we use crtbeginS.o and crtendS.o for those, too. * To simplify, we even use crtbeginS.o and crtendS.o in the kernel, but there they don't currently make a difference, as the respective initialization and cleanup functions are not being invoked by the kernel. --- build/jam/ArchitectureRules | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 629d45fc45..cf98620e90 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -213,23 +213,23 @@ rule ArchitectureSetup architecture ; HAIKU_LIBRARY_BEGIN_GLUE_CODE_$(architecture) = crti.o - <$(architecture)>crtbegin.o + <$(architecture)>crtbeginS.o init_term_dyn.o ; HAIKU_LIBRARY_END_GLUE_CODE_$(architecture) = - <$(architecture)>crtend.o + <$(architecture)>crtendS.o crtn.o ; HAIKU_EXECUTABLE_BEGIN_GLUE_CODE_$(architecture) = crti.o - <$(architecture)>crtbegin.o + <$(architecture)>crtbeginS.o start_dyn.o init_term_dyn.o ; HAIKU_EXECUTABLE_END_GLUE_CODE_$(architecture) = $(HAIKU_LIBRARY_END_GLUE_CODE_$(architecture)) ; - SEARCH on <$(architecture)>crtbegin.o <$(architecture)>crtend.o + SEARCH on <$(architecture)>crtbeginS.o <$(architecture)>crtendS.o = $(HAIKU_GCC_LIB_DIR_$(architecture)) ; # init library name map @@ -472,10 +472,10 @@ rule KernelArchitectureSetup architecture # compiling (part of) the boot loader. # kernel add-on glue code - HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = <$(architecture)>crtbegin.o + HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = <$(architecture)>crtbeginS.o haiku_version_glue.o ; HAIKU_KERNEL_ADDON_END_GLUE_CODE - = $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtend.o ; + = $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtendS.o ; }