From f7653b1b74f0d97b7785f0a323013f8b7f956ce4 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 11 Aug 2014 21:09:22 +0200 Subject: [PATCH] Optionally build glue code for bootstrap_stage0 platform. --- build/jam/MainBuildRules | 28 ++++++++++++++++++++++++++++ src/system/glue/Jamfile | 9 ++++++++- src/system/glue/arch/arm/Jamfile | 10 +++++++++- src/system/glue/arch/m68k/Jamfile | 10 +++++++++- src/system/glue/arch/ppc/Jamfile | 10 +++++++++- src/system/glue/arch/x86/Jamfile | 10 +++++++++- src/system/glue/arch/x86_64/Jamfile | 8 +++++++- 7 files changed, 79 insertions(+), 6 deletions(-) diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index 94af57a186..c497b6ac5c 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -760,3 +760,31 @@ rule BuildPlatformStaticLibraryPIC target : sources : otherObjects BuildPlatformStaticLibrary $(target) : $(sources) : $(otherObjects) ; } + +rule BootstrapStage0PlatformObjects sources : separateFromStandardSiblings +{ + # BootstrapStage0PlatformObjects : + # Builds objects from the given sources for stage0 of the bootstrap process. + # The sources from which objects should be created. + # Pass 'true' if the same objects are built + # in a different context, too, so that a separate grist and target location + # is required. This defaults to ''. + local source ; + for source in $(sources) { + local objectGrist ; + if $(separateFromStandardSiblings) = true { + objectGrist = "bootstrap!$(SOURCE_GRIST)" ; + } else { + objectGrist = $(SOURCE_GRIST) ; + } + local object = $(source:S=$(SUFOBJ):G=$(objectGrist)) ; + PLATFORM on $(object) = bootstrap_stage0 ; + SUPPORTED_PLATFORMS on $(object) = bootstrap_stage0 ; + if $(separateFromStandardSiblings) = true { + MakeLocate $(object) : [ + FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) bootstrap + ] ; + } + Object $(object) : $(source) ; + } +} diff --git a/src/system/glue/Jamfile b/src/system/glue/Jamfile index 607f688aa5..82417d035e 100644 --- a/src/system/glue/Jamfile +++ b/src/system/glue/Jamfile @@ -5,14 +5,21 @@ for architectureObject in [ MultiArchSubDirSetup ] { on $(architectureObject) { UsePrivateSystemHeaders ; - Objects + local sources = init_term_dyn.c start_dyn.c haiku_version_glue.c ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } } + local arch ; for arch in $(TARGET_ARCHS) { SubInclude HAIKU_TOP src system glue arch $(arch) ; diff --git a/src/system/glue/arch/arm/Jamfile b/src/system/glue/arch/arm/Jamfile index 464ecd361f..a61616e9b0 100644 --- a/src/system/glue/arch/arm/Jamfile +++ b/src/system/glue/arch/arm/Jamfile @@ -3,9 +3,17 @@ SubDir HAIKU_TOP src system glue arch arm ; local architectureObject ; for architectureObject in [ MultiArchSubDirSetup arm ] { on $(architectureObject) { - Objects + UsePrivateSystemHeaders ; + + local sources = crti.S crtn.S ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } } diff --git a/src/system/glue/arch/m68k/Jamfile b/src/system/glue/arch/m68k/Jamfile index 82290293bf..8cc2f1214b 100644 --- a/src/system/glue/arch/m68k/Jamfile +++ b/src/system/glue/arch/m68k/Jamfile @@ -3,9 +3,17 @@ SubDir HAIKU_TOP src system glue arch m68k ; local architectureObject ; for architectureObject in [ MultiArchSubDirSetup m68k ] { on $(architectureObject) { - Objects + UsePrivateSystemHeaders ; + + local sources = crti.S crtn.S ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } } diff --git a/src/system/glue/arch/ppc/Jamfile b/src/system/glue/arch/ppc/Jamfile index de6cdb7034..decff45667 100644 --- a/src/system/glue/arch/ppc/Jamfile +++ b/src/system/glue/arch/ppc/Jamfile @@ -3,9 +3,17 @@ SubDir HAIKU_TOP src system glue arch ppc ; local architectureObject ; for architectureObject in [ MultiArchSubDirSetup ppc ] { on $(architectureObject) { - Objects + UsePrivateSystemHeaders ; + + local sources = crti.S crtn.S ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } } diff --git a/src/system/glue/arch/x86/Jamfile b/src/system/glue/arch/x86/Jamfile index 407af4b4da..b87bae5ad3 100644 --- a/src/system/glue/arch/x86/Jamfile +++ b/src/system/glue/arch/x86/Jamfile @@ -3,9 +3,17 @@ SubDir HAIKU_TOP src system glue arch x86 ; local architectureObject ; for architectureObject in [ MultiArchSubDirSetup x86 x86_gcc2 ] { on $(architectureObject) { - Objects + UsePrivateSystemHeaders ; + + local sources = crti.S crtn.S ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } } diff --git a/src/system/glue/arch/x86_64/Jamfile b/src/system/glue/arch/x86_64/Jamfile index 8546426ed9..c7111051c9 100644 --- a/src/system/glue/arch/x86_64/Jamfile +++ b/src/system/glue/arch/x86_64/Jamfile @@ -5,9 +5,15 @@ for architectureObject in [ MultiArchSubDirSetup x86_64 ] { on $(architectureObject) { UsePrivateSystemHeaders ; - Objects + local sources = crti.S crtn.S ; + Objects $(sources) ; + + if $(HAIKU_BUILD_TYPE) = bootstrap { + # build a version for stage0 of the bootstrap process + BootstrapStage0PlatformObjects $(sources) : true ; + } } }