From e29a6c4cd44f1b189b4938beea2b7ef1d0ce65f0 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 11 Aug 2014 22:28:44 +0200 Subject: [PATCH] Introduce stage0 into the bootstrap process. * This stage builds the gcc packages to get the shared syslibs, which only requires the Haiku glue code. * Add separate declaration section for stage0 packages to HaikuPortsCross repository files. * For the bootstrap_stage0 platform, fall back to the gcc headers provided by the cross-compiler. --- build/jam/RepositoryRules | 19 +++- build/jam/SystemLibraryRules | 7 ++ build/jam/packages/HaikuCrossDevel | 88 +++++++++++-------- build/jam/repositories/HaikuPortsCross/arm | 6 +- build/jam/repositories/HaikuPortsCross/m68k | 2 + build/jam/repositories/HaikuPortsCross/ppc | 6 +- build/jam/repositories/HaikuPortsCross/x86 | 12 ++- build/jam/repositories/HaikuPortsCross/x86_64 | 6 +- .../jam/repositories/HaikuPortsCross/x86_gcc2 | 12 ++- 9 files changed, 112 insertions(+), 46 deletions(-) diff --git a/build/jam/RepositoryRules b/build/jam/RepositoryRules index 54d504be18..491e43bbc5 100644 --- a/build/jam/RepositoryRules +++ b/build/jam/RepositoryRules @@ -421,10 +421,11 @@ EOF rule BootstrapPackageRepository repository : architecture - : anyPackages : packagesStage1 : packagesStage2 : sourcePackages - : debugInfoPackages + : anyPackages : packagesStage0 : packagesStage1 : packagesStage2 + : sourcePackages : debugInfoPackages { repository = $(repository:G=repository) ; + packagesStage0 = [ FFilterByBuildFeatures $(packagesStage0) ] ; packagesStage1 = [ FFilterByBuildFeatures $(packagesStage1) ] ; packagesStage2 = [ FFilterByBuildFeatures $(packagesStage2) ] ; sourcePackages = [ FFilterByBuildFeatures $(sourcePackages) ] ; @@ -435,6 +436,18 @@ rule BootstrapPackageRepository repository : architecture SetRepositoryMethod $(repository) : FetchPackage : BootstrapRepositoryFetchPackage ; + # register repository with stage 0 packages + local stage0PackageTargets = [ PackageRepository $(repository) + : $(architecture) : $(anyPackages) : $(packagesStage0) + : $(sourcePackages) : $(debugInfoPackages) ] ; + if ! $(stage0PackageTargets) { + return ; + } + local crossDevelPackageSuffixes = $(architecture) + $(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ; + HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage0PackageTargets) + = haiku_cross_devel_sysroot_stage0_$(crossDevelPackageSuffixes).hpkg ; + # register repository with stage 1 packages local stage1PackageTargets = [ PackageRepository $(repository) : $(architecture) : $(anyPackages) : $(packagesStage1) @@ -442,8 +455,6 @@ rule BootstrapPackageRepository repository : architecture if ! $(stage1PackageTargets) { return ; } - local crossDevelPackageSuffixes = $(architecture) - $(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ; HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage1PackageTargets) = haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ; diff --git a/build/jam/SystemLibraryRules b/build/jam/SystemLibraryRules index 95da0e5a74..954c4f06a3 100644 --- a/build/jam/SystemLibraryRules +++ b/build/jam/SystemLibraryRules @@ -310,6 +310,8 @@ rule C++HeaderDirectories architecture local c++HeaderDirs ; if $(architecture) = x86_gcc2 { c++HeaderDirs = [ FDirName $(HAIKU_TOP) headers cpp ] ; + } else if $(PLATFORM) = bootstrap_stage0 { + # Currently, no c++-headers are needed for stage0 of the boostrap. } else { local baseDir = [ BuildFeatureAttribute gcc_syslibs_devel : c++-headers : path @@ -336,6 +338,11 @@ rule GccHeaderDirectories architecture local gccHeaderDirs ; if $(architecture) = x86_gcc2 { gccHeaderDirs = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ; + } else if $(PLATFORM) = bootstrap_stage0 { + gccHeaderDirs = + [ FDirName $(HAIKU_GCC_LIB_DIR_$(architecture)) include ] + [ FDirName $(HAIKU_GCC_LIB_DIR_$(architecture)) include-fixed ] + ; } else { local baseDir = [ BuildFeatureAttribute gcc_syslibs_devel : gcc-headers : path diff --git a/build/jam/packages/HaikuCrossDevel b/build/jam/packages/HaikuCrossDevel index b5c6c4cef5..1a6405b1ab 100644 --- a/build/jam/packages/HaikuCrossDevel +++ b/build/jam/packages/HaikuCrossDevel @@ -20,7 +20,7 @@ local additionalLibraries = [ MultiArchDefaultGristFiles libbe.so libnetwork.so libpackage.so ] ; local stage ; -for stage in _stage1 "" { +for stage in _stage0 _stage1 "" { # first create the actual cross development package local haikuCrossDevelSysrootPackage @@ -29,38 +29,54 @@ for stage in _stage1 "" { local developCrossLibDirTokens = develop lib $(architectureSubDir) ; - # glue code - AddFilesToPackage $(developCrossLibDirTokens) : - crti.o - crtn.o - init_term_dyn.o - start_dyn.o - haiku_version_glue.o - ; + if $(stage) = _stage0 { + # glue code + AddFilesToPackage $(developCrossLibDirTokens) : + crti.o + crtn.o + init_term_dyn.o + start_dyn.o + haiku_version_glue.o + ; - # kernel - if $(isPrimaryArchitecture) { - AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ; + # libraries + AddLibrariesToPackage $(developCrossLibDirTokens) : + [ MultiArchDefaultGristFiles libroot.so : stubbed ] + ; + } else { + # glue code + AddFilesToPackage $(developCrossLibDirTokens) : + crti.o + crtn.o + init_term_dyn.o + start_dyn.o + haiku_version_glue.o + ; + + # kernel + if $(isPrimaryArchitecture) { + AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ; + } + + # libraries + AddLibrariesToPackage $(developCrossLibDirTokens) : + [ MultiArchDefaultGristFiles libbsd.so ] + [ MultiArchDefaultGristFiles libroot.so : revisioned ] + [ MultiArchDefaultGristFiles libnetwork.so ] + [ TargetLibstdc++ ] + [ TargetLibsupc++ ] + $(additionalLibraries$(stage)) + ; + + # static libraries + AddFilesToPackage $(developCrossLibDirTokens) + : <$(architecture)>liblocalestub.a ; + + # the POSIX error code mapper library + AddFilesToPackage $(developCrossLibDirTokens) + : [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ; } - # libraries - AddLibrariesToPackage $(developCrossLibDirTokens) : - [ MultiArchDefaultGristFiles libbsd.so ] - [ MultiArchDefaultGristFiles libroot.so : revisioned ] - [ MultiArchDefaultGristFiles libnetwork.so ] - [ TargetLibstdc++ ] - [ TargetLibsupc++ ] - $(additionalLibraries$(stage)) - ; - - # static libraries - AddFilesToPackage $(developCrossLibDirTokens) - : <$(architecture)>liblocalestub.a ; - - # the POSIX error code mapper library - AddFilesToPackage $(developCrossLibDirTokens) - : [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ; - # headers local developCrossHeadersDirTokens = develop headers ; local headerDir ; @@ -75,11 +91,13 @@ for stage in _stage1 "" { : [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ; } - # cpp headers - if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 { - # GCC 2 only -- for GCC 4 they come with the DevelopmentBase package - CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++ - : [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ; + if $(stage) != _stage0 { + # cpp headers + if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 { + # GCC 2 only -- for GCC 4 they come with the DevelopmentBase package + CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++ + : [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ; + } } BuildHaikuPackage $(haikuCrossDevelSysrootPackage) diff --git a/build/jam/repositories/HaikuPortsCross/arm b/build/jam/repositories/HaikuPortsCross/arm index e06cc5e881..e3af09a042 100644 --- a/build/jam/repositories/HaikuPortsCross/arm +++ b/build/jam/repositories/HaikuPortsCross/arm @@ -4,6 +4,11 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + gcc_bootstrap-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs_devel-4.8.3_2014_08_03-1 + : # repository architecture packages (stage 1) autoconf_bootstrap-2.69-2 automake_bootstrap-1.13.1-1 @@ -17,7 +22,6 @@ BootstrapPackageRepository HaikuPortsCross freetype_bootstrap-2.4.9-1 freetype_bootstrap_devel-2.4.9-1 gawk_bootstrap-3.1.8-2 - gcc_bootstrap-4.8.3_2014_05_28-2 grep_bootstrap-2.14-1 icu_bootstrap-4.8.1.1-1 icu_bootstrap_devel-4.8.1.1-1 diff --git a/build/jam/repositories/HaikuPortsCross/m68k b/build/jam/repositories/HaikuPortsCross/m68k index b55386a8e7..d984bb7f56 100644 --- a/build/jam/repositories/HaikuPortsCross/m68k +++ b/build/jam/repositories/HaikuPortsCross/m68k @@ -4,6 +4,8 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + : # repository architecture packages (stage 1) zlib_bootstrap-1.2.8-2 zlib_bootstrap_devel-1.2.8-2 diff --git a/build/jam/repositories/HaikuPortsCross/ppc b/build/jam/repositories/HaikuPortsCross/ppc index f17a8e9097..16ed387c18 100644 --- a/build/jam/repositories/HaikuPortsCross/ppc +++ b/build/jam/repositories/HaikuPortsCross/ppc @@ -4,6 +4,11 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + gcc_bootstrap-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs_devel-4.8.3_2014_08_03-1 + : # repository architecture packages (stage 1) autoconf_bootstrap-2.69-2 automake_bootstrap-1.13.1-1 @@ -12,7 +17,6 @@ BootstrapPackageRepository HaikuPortsCross flex_bootstrap-2.5.35-1 icu_bootstrap-4.8.1.1-1 icu_bootstrap_devel-4.8.1.1-1 - gcc_bootstrap-4.8.3_2014_05_28-2 grep_bootstrap-2.14-1 freetype_bootstrap-2.4.9-1 freetype_bootstrap_devel-2.4.9-1 diff --git a/build/jam/repositories/HaikuPortsCross/x86 b/build/jam/repositories/HaikuPortsCross/x86 index 88b3defb4d..ab1ab207b4 100644 --- a/build/jam/repositories/HaikuPortsCross/x86 +++ b/build/jam/repositories/HaikuPortsCross/x86 @@ -4,6 +4,16 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + gcc_bootstrap-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs_devel-4.8.3_2014_08_03-1 + + secondary_x86_gcc2 @{ + gcc_bootstrap_x86_gcc2-2.95.3_2014_08_03-1 + gcc_bootstrap_x86_gcc2_syslibs_devel-2.95.3_2014_08_03-1 + }@ # secondary_x86_gcc2 + : # repository architecture packages (stage 1) autoconf_bootstrap-2.69-2 automake_bootstrap-1.13.1-1 @@ -14,7 +24,6 @@ BootstrapPackageRepository HaikuPortsCross freetype_bootstrap-2.4.9-1 freetype_bootstrap_devel-2.4.9-1 gawk_bootstrap-3.1.8-2 - gcc_bootstrap-4.8.3_2014_05_28-2 grep_bootstrap-2.14-1 icu_bootstrap-4.8.1.1-1 icu_bootstrap_devel-4.8.1.1-1 @@ -34,7 +43,6 @@ BootstrapPackageRepository HaikuPortsCross binutils_bootstrap_x86_gcc2-2.17_2013_04_21-3 freetype_bootstrap_x86_gcc2-2.4.9-1 freetype_bootstrap_x86_gcc2_devel-2.4.9-1 - gcc_bootstrap_x86_gcc2-2.95.3_2013_08_15-1 icu_bootstrap_x86_gcc2-4.8.1.1-1 icu_bootstrap_x86_gcc2_devel-4.8.1.1-1 ncurses_bootstrap_x86_gcc2-5.9-1 diff --git a/build/jam/repositories/HaikuPortsCross/x86_64 b/build/jam/repositories/HaikuPortsCross/x86_64 index fe50064de3..2daf1eaf20 100644 --- a/build/jam/repositories/HaikuPortsCross/x86_64 +++ b/build/jam/repositories/HaikuPortsCross/x86_64 @@ -4,6 +4,11 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + gcc_bootstrap-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs-4.8.3_2014_08_03-1 + gcc_bootstrap_syslibs_devel-4.8.3_2014_08_03-1 + : # repository architecture packages (stage 1) autoconf_bootstrap-2.69-2 automake_bootstrap-1.13.1-1 @@ -16,7 +21,6 @@ BootstrapPackageRepository HaikuPortsCross freetype_bootstrap-2.4.9-1 freetype_bootstrap_devel-2.4.9-1 gawk_bootstrap-3.1.8-2 - gcc_bootstrap-4.8.3_2014_05_28-2 grep_bootstrap-2.14-1 icu_bootstrap-4.8.1.1-1 icu_bootstrap_devel-4.8.1.1-1 diff --git a/build/jam/repositories/HaikuPortsCross/x86_gcc2 b/build/jam/repositories/HaikuPortsCross/x86_gcc2 index 1bb125be62..8a623f36d5 100644 --- a/build/jam/repositories/HaikuPortsCross/x86_gcc2 +++ b/build/jam/repositories/HaikuPortsCross/x86_gcc2 @@ -4,6 +4,16 @@ BootstrapPackageRepository HaikuPortsCross # architecture "any" packages haikuporter-0-1 : + # repository architecture packages (stage 0) + gcc_bootstrap-2.95.3_2014_08_03-1 + gcc_bootstrap_syslibs_devel-2.95.3_2014_08_03-1 + + secondary_x86_gcc2 @{ + gcc_bootstrap_x86-4.8.3_2014_08_03-1 + gcc_bootstrap_x86_syslibs-4.8.3_2014_08_03-1 + gcc_bootstrap_x86_syslibs_devel-4.8.3_2014_08_03-1 + }@ # secondary_x86_gcc2 + : # repository architecture packages (stage 1) autoconf_bootstrap-2.69-2 automake_bootstrap-1.13.1-1 @@ -14,7 +24,6 @@ BootstrapPackageRepository HaikuPortsCross freetype_bootstrap-2.4.9-1 freetype_bootstrap_devel-2.4.9-1 gawk_bootstrap-3.1.8-2 - gcc_bootstrap-2.95.3_2013_08_15-1 grep_bootstrap-2.14-1 icu_bootstrap-4.8.1.1-1 icu_bootstrap_devel-4.8.1.1-1 @@ -34,7 +43,6 @@ BootstrapPackageRepository HaikuPortsCross binutils_bootstrap_x86-2.23.2_2013_04_09-3 freetype_bootstrap_x86-2.4.9-1 freetype_bootstrap_x86_devel-2.4.9-1 - gcc_bootstrap_x86-4.7.3_2013_08_12-1 icu_bootstrap_x86-4.8.1.1-1 icu_bootstrap_x86_devel-4.8.1.1-1 ncurses_bootstrap_x86-5.9-1