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.
This commit is contained in:
Oliver Tappe 2014-07-26 14:59:47 +02:00
parent 61eac7b933
commit a36fd6667a

View File

@ -213,23 +213,23 @@ rule ArchitectureSetup architecture
;
HAIKU_LIBRARY_BEGIN_GLUE_CODE_$(architecture) =
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
<$(architecture)>crtbegin.o
<$(architecture)>crtbeginS.o
<src!system!glue!$(architecture)>init_term_dyn.o
;
HAIKU_LIBRARY_END_GLUE_CODE_$(architecture) =
<$(architecture)>crtend.o
<$(architecture)>crtendS.o
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crtn.o
;
HAIKU_EXECUTABLE_BEGIN_GLUE_CODE_$(architecture) =
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
<$(architecture)>crtbegin.o
<$(architecture)>crtbeginS.o
<src!system!glue!$(architecture)>start_dyn.o
<src!system!glue!$(architecture)>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
<src!system!glue!$(architecture)>haiku_version_glue.o ;
HAIKU_KERNEL_ADDON_END_GLUE_CODE
= $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtend.o ;
= $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtendS.o ;
}