added 2 changesets to branch 'refs/remotes/HaikuPM-github/package-management' old head: 12629b106ee37df7495eb9e3b463bd2119762867 new head: 49f8422a0dfa93243c407350a5795fcc6ddcd611 overview: https://github.com/haiku/HaikuPM/compare/12629b1...49f8422 ---------------------------------------------------------------------------- de2188e: Fix #7824: failure to build a cross-compiler on Haiku. * force creation of a cross-compiler for both gcc2 and gcc4 when building on Haiku (by suffixing the build and host machine with '_buildhost') (cherry picked from commit df69e209bbacd07fdfea9d9efcfc8e1c0dfedaa0) Conflicts: build/scripts/build_cross_tools_gcc4 49f8422: Remove whole sys-include folder when cross-compiler has been built. * at least for gcc2, we used to leave the 'os' subfolder in there, which may have caused problems when Haiku's headers have changed since the last time the compiler was built. (cherry picked from commit 92bb2fb33e2d0f4aa766be095057fe63ff17bc8e) [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 28 insertions(+), 17 deletions(-) build/scripts/build_cross_tools | 21 ++++++++++++--------- build/scripts/build_cross_tools_gcc4 | 24 ++++++++++++++++-------- ############################################################################ Commit: de2188e9647102dd73933c219589481ae3871e01 Author: Oliver Tappe <zooey@xxxxxxxxxxxxxxx> Date: Fri Jun 14 14:04:26 2013 UTC Ticket: https://dev.haiku-os.org/ticket/7824 Fix #7824: failure to build a cross-compiler on Haiku. * force creation of a cross-compiler for both gcc2 and gcc4 when building on Haiku (by suffixing the build and host machine with '_buildhost') (cherry picked from commit df69e209bbacd07fdfea9d9efcfc8e1c0dfedaa0) Conflicts: build/scripts/build_cross_tools_gcc4 ---------------------------------------------------------------------------- diff --git a/build/scripts/build_cross_tools b/build/scripts/build_cross_tools index e637c48..b35bd81 100755 --- a/build/scripts/build_cross_tools +++ b/build/scripts/build_cross_tools @@ -20,6 +20,11 @@ additionalMakeArgs=$* # additional flags for the binutils build. Should there ever be any other # flags than -jN, we need to handle this differently. +if [ `uname -o` = 'Haiku' ]; then + # force cross-build if building on Haiku: + buildhostMachine=i586-pc-haiku_buildhost + buildHostSpec="--build=$buildhostMachine --host=$buildhostMachine" +fi if [ ! -d $haikuSourceDir ]; then echo "ERROR: No such directory: \"$haikuSourceDir\"" >&2 @@ -101,8 +106,8 @@ fi # build binutils cd $binutilsObjDir CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \ - --prefix=$installDir --target=i586-pc-haiku --disable-nls \ - --enable-shared=yes --disable-werror || exit 1 + --prefix=$installDir $buildHostSpec --target=i586-pc-haiku \ + --disable-nls --enable-shared=yes --disable-werror || exit 1 make $additionalMakeArgs || exit 1 make $additionalMakeArgs install || exit 1 @@ -146,10 +151,10 @@ case `uname` in ;; esac CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" $buildToolsDir/gcc/configure \ - --prefix=$installDir \ - --target=i586-pc-haiku --disable-nls --enable-shared=yes \ - --enable-languages=c,c++ --with-headers=$tmpIncludeDir \ - --with-libs=$tmpLibDir || exit 1 + --prefix=$installDir $buildHostSpec --target=i586-pc-haiku \ + --disable-nls --enable-shared=yes --enable-languages=c,c++ \ + --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \ + || exit 1 unset CC # hack the Makefile to avoid trouble with stuff we don't need anyway @@ -192,4 +197,3 @@ rm -rf $objDir echo "binutils and gcc for cross compilation have been built successfully!" - diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4 index 9837feb..8e6c732 100755 --- a/build/scripts/build_cross_tools_gcc4 +++ b/build/scripts/build_cross_tools_gcc4 @@ -50,6 +50,12 @@ arm-*) ;; esac +if [ `uname -o` = 'Haiku' ]; then + # force cross-build if building on Haiku: + buildhostMachine=${haikuMachine}_buildhost + buildHostSpec="--build=$buildhostMachine --host=$buildhostMachine" +fi + if [ ! -d $haikuSourceDir ]; then echo "No such directory: \"$haikuSourceDir\"" >&2 exit 1 @@ -135,10 +141,11 @@ export LC_ALL=POSIX # build binutils cd $binutilsObjDir CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \ - --prefix=$installDir --target=$haikuMachine --disable-nls \ - --disable-shared --disable-werror \ + --prefix=$installDir $buildHostSpec --target=$haikuMachine \ + --disable-nls --disable-shared --disable-werror \ --with-sysroot=$sysrootDir \ - $binutilsConfigureArgs || exit 1 + $binutilsConfigureArgs \ + || exit 1 $MAKE $additionalMakeArgs || exit 1 $MAKE $additionalMakeArgs install || exit 1 @@ -194,11 +201,13 @@ copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix # configure gcc cd $gccObjDir -CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \ - --target=$haikuMachine --disable-nls --disable-shared --with-system-zlib \ +CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure \ + --prefix=$installDir $buildHostSpec --target=$haikuMachine \ + --disable-nls --disable-shared --with-system-zlib \ --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ --with-sysroot=$sysrootDir \ - $gccConfigureArgs || exit 1 + $gccConfigureArgs \ + || exit 1 # make gcc $MAKE $additionalMakeArgs || { ############################################################################ Commit: 49f8422a0dfa93243c407350a5795fcc6ddcd611 Author: Oliver Tappe <zooey@xxxxxxxxxxxxxxx> Date: Fri Jun 14 14:07:06 2013 UTC Remove whole sys-include folder when cross-compiler has been built. * at least for gcc2, we used to leave the 'os' subfolder in there, which may have caused problems when Haiku's headers have changed since the last time the compiler was built. (cherry picked from commit 92bb2fb33e2d0f4aa766be095057fe63ff17bc8e) ---------------------------------------------------------------------------- diff --git a/build/scripts/build_cross_tools b/build/scripts/build_cross_tools index b35bd81..9e2fd4e 100755 --- a/build/scripts/build_cross_tools +++ b/build/scripts/build_cross_tools @@ -189,8 +189,7 @@ rm -f $installDir/lib/gcc-lib/i586-pc-haiku/$haikuRequiredLegacyGCCVersion/inclu # remove the system headers from the installation dir # Only the ones from the source tree should be used. -sysIncludeDir=$installDir/i586-pc-haiku/sys-include -rm -rf $sysIncludeDir/be $sysIncludeDir/posix +rm -rf $installDir/i586-pc-haiku/sys-include # remove the objects dir rm -rf $objDir diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4 index 8e6c732..e22ef70 100755 --- a/build/scripts/build_cross_tools_gcc4 +++ b/build/scripts/build_cross_tools_gcc4 @@ -247,8 +247,7 @@ fi # remove the system headers from the installation dir # Only the ones from the source tree should be used. -sysIncludeDir=$installDir/$haikuMachine/sys-include -rm -rf $sysIncludeDir/os $sysIncludeDir/posix +rm -rf $installDir/$haikuMachine/sys-include # remove the objects dir rm -rf $objDir