From 36f3164c3ec5f536550e443aeec4b0d58a8746b1 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 27 Jul 2014 16:00:53 +0200 Subject: [PATCH] Fix #11076 - build failing on Haiku. * Haiku does not currently provide crtbeginS.o and crtendS.o, so we fall back to crtbegin.o and crtend.o. This should not have any ill-effects, as the available compilers on Haiku do not use __cxa_atexit() yet. --- build/jam/ArchitectureRules | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index cf98620e90..f4e34277f6 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -206,6 +206,18 @@ rule ArchitectureSetup architecture } # library and executable glue code + local crtBegin ; + local crtEnd ; + # TODO: use crtbeginS.o and crtendS.o unconditionally once we have + # switched to new compiler packages + if [ Glob $(HAIKU_GCC_LIB_DIR_$(architecture)) : crtbeginS.o ] { + crtBegin = <$(architecture)>crtbeginS.o ; + crtEnd = <$(architecture)>crtendS.o ; + } else { + crtBegin = <$(architecture)>crtbegin.o ; + crtEnd = <$(architecture)>crtend.o ; + } + local commonGlueCode = init_term_dyn.o crti.o @@ -213,24 +225,23 @@ rule ArchitectureSetup architecture ; HAIKU_LIBRARY_BEGIN_GLUE_CODE_$(architecture) = crti.o - <$(architecture)>crtbeginS.o + $(crtBegin) init_term_dyn.o ; HAIKU_LIBRARY_END_GLUE_CODE_$(architecture) = - <$(architecture)>crtendS.o + $(crtEnd) crtn.o ; HAIKU_EXECUTABLE_BEGIN_GLUE_CODE_$(architecture) = crti.o - <$(architecture)>crtbeginS.o + $(crtBegin) start_dyn.o init_term_dyn.o ; HAIKU_EXECUTABLE_END_GLUE_CODE_$(architecture) = $(HAIKU_LIBRARY_END_GLUE_CODE_$(architecture)) ; - SEARCH on <$(architecture)>crtbeginS.o <$(architecture)>crtendS.o - = $(HAIKU_GCC_LIB_DIR_$(architecture)) ; + SEARCH on $(crtBegin) $(crtEnd) = $(HAIKU_GCC_LIB_DIR_$(architecture)) ; # init library name map local libraryGrist = "" ; @@ -472,10 +483,21 @@ rule KernelArchitectureSetup architecture # compiling (part of) the boot loader. # kernel add-on glue code - HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = <$(architecture)>crtbeginS.o + local crtBegin ; + local crtEnd ; + # TODO: use crtbeginS.o and crtendS.o unconditionally once we have + # switched to new compiler packages + if [ Glob $(HAIKU_GCC_LIB_DIR_$(architecture)) : crtbeginS.o ] { + crtBegin = <$(architecture)>crtbeginS.o ; + crtEnd = <$(architecture)>crtendS.o ; + } else { + crtBegin = <$(architecture)>crtbegin.o ; + crtEnd = <$(architecture)>crtend.o ; + } + HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = $(crtBegin) haiku_version_glue.o ; HAIKU_KERNEL_ADDON_END_GLUE_CODE - = $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtendS.o ; + = $(HAIKU_GCC_LIBGCC_$(architecture)) $(crtEnd) ; }