From 6ad8a8a7e94d4050773bc2015c61f1fc4adc0256 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 12 Oct 2018 20:15:20 +0200 Subject: [PATCH] gcc: remove outdated recipes. --- sys-devel/gcc/gcc-2.95.3_2014_07_26.recipe | 181 - sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe | 183 - sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe | 156 - sys-devel/gcc/gcc-4.8.3_2014_07_26.recipe | 319 -- sys-devel/gcc/gcc-4.8.4_2014_12_21.recipe | 319 -- sys-devel/gcc/gcc-4.8.5_2015_07_11.recipe | 321 -- sys-devel/gcc/gcc-5.2.0_2015_07_27.recipe | 325 -- sys-devel/gcc/gcc-5.3.0_2016_02_29.recipe | 347 -- sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe | 441 --- sys-devel/gcc/gcc49-4.9.3_2015_07_31.recipe | 325 -- sys-devel/gcc/gcc6-6.3.0_2017_05_12.recipe | 411 -- sys-devel/gcc/gcc6-6.4.0_2017_05_12.recipe | 411 -- sys-devel/gcc/gcc7-7.1.0_2017_05_12.recipe | 410 -- .../gcc/patches/gcc-4.8.3_2014_05_28.patchset | 24 - .../gcc-4.8.3_buildfixes_for_x86_64.patchset | 95 - .../gcc-4.8.5_2015_07_11_for_x86.patchset | 127 - .../gcc/patches/gcc-5.2.0_2015_07_27.patchset | 2895 --------------- .../gcc/patches/gcc-5.3.0_2016_02_29.patchset | 3290 ----------------- .../gcc/patches/gcc-5.4.0_2016_06_04.patchset | 3272 ---------------- .../gcc/patches/gcc-6.3.0_2017_05_12.patchset | 3237 ---------------- .../gcc/patches/gcc-6.4.0_2017_05_12.patchset | 3237 ---------------- .../gcc/patches/gcc-7.1.0_2017_05_12.patchset | 3259 ---------------- .../patches/gcc49-4.9.3_2015_07_31.patchset | 2895 --------------- .../patches/gcc6-6.0.0_2015_07_17.patchset | 2927 --------------- .../patches/gcc6-6.0.0_2015_11_08.patchset | 35 - 25 files changed, 29442 deletions(-) delete mode 100644 sys-devel/gcc/gcc-2.95.3_2014_07_26.recipe delete mode 100644 sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe delete mode 100644 sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe delete mode 100644 sys-devel/gcc/gcc-4.8.3_2014_07_26.recipe delete mode 100644 sys-devel/gcc/gcc-4.8.4_2014_12_21.recipe delete mode 100644 sys-devel/gcc/gcc-4.8.5_2015_07_11.recipe delete mode 100644 sys-devel/gcc/gcc-5.2.0_2015_07_27.recipe delete mode 100644 sys-devel/gcc/gcc-5.3.0_2016_02_29.recipe delete mode 100644 sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe delete mode 100644 sys-devel/gcc/gcc49-4.9.3_2015_07_31.recipe delete mode 100644 sys-devel/gcc/gcc6-6.3.0_2017_05_12.recipe delete mode 100644 sys-devel/gcc/gcc6-6.4.0_2017_05_12.recipe delete mode 100644 sys-devel/gcc/gcc7-7.1.0_2017_05_12.recipe delete mode 100644 sys-devel/gcc/patches/gcc-4.8.3_2014_05_28.patchset delete mode 100644 sys-devel/gcc/patches/gcc-4.8.3_buildfixes_for_x86_64.patchset delete mode 100644 sys-devel/gcc/patches/gcc-4.8.5_2015_07_11_for_x86.patchset delete mode 100644 sys-devel/gcc/patches/gcc-5.2.0_2015_07_27.patchset delete mode 100644 sys-devel/gcc/patches/gcc-5.3.0_2016_02_29.patchset delete mode 100644 sys-devel/gcc/patches/gcc-5.4.0_2016_06_04.patchset delete mode 100644 sys-devel/gcc/patches/gcc-6.3.0_2017_05_12.patchset delete mode 100644 sys-devel/gcc/patches/gcc-6.4.0_2017_05_12.patchset delete mode 100644 sys-devel/gcc/patches/gcc-7.1.0_2017_05_12.patchset delete mode 100644 sys-devel/gcc/patches/gcc49-4.9.3_2015_07_31.patchset delete mode 100644 sys-devel/gcc/patches/gcc6-6.0.0_2015_07_17.patchset delete mode 100644 sys-devel/gcc/patches/gcc6-6.0.0_2015_11_08.patchset diff --git a/sys-devel/gcc/gcc-2.95.3_2014_07_26.recipe b/sys-devel/gcc/gcc-2.95.3_2014_07_26.recipe deleted file mode 100644 index 77484d744..000000000 --- a/sys-devel/gcc/gcc-2.95.3_2014_07_26.recipe +++ /dev/null @@ -1,181 +0,0 @@ -SUMMARY="The GNU C/C++ compiler" -DESCRIPTION="The standard compiler for x86_gcc2 platform, ABI-compatible with \ -BeOS R5." -SUMMARY_syslibs_devel="C/C++-runtime static libraries, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's c/c++-runtime libraries that is required by Haiku's \ -build system when building Haiku." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2000 Free Software Foundation, Inc." -LICENSE="GNU GPL v2 - GNU LGPL v2" -REVISION="1" -srcGitRev="e5a1aa929a5e26ccff8d56228634ef6ba0078212" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="1e19de45203765ff494649b25df44aa1cb13a787c55ed57d3d18f8d95ff72397" -SOURCE_DIR="buildtools-$srcGitRev/legacy/gcc" - -ARCHITECTURES="x86_gcc2 !x86" -SECONDARY_ARCHITECTURES="x86_gcc2" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:cc$secondaryArchSuffix - cmd:c++$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:gcov$secondaryArchSuffix = 1.5 compat >= 1.5 - cmd:i586_pc_haiku_gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:protoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:unprotoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 - " -REQUIRES=" - haiku$secondaryArchSuffix - binutils$secondaryArchSuffix - " - -PROVIDES_syslibs_devel=" - gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 2.95.3 - " -REQUIRES_syslibs_devel="" - -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - gcc$secondaryArchSuffix - cmd:find - cmd:flex - cmd:make - cmd:sed - cmd:tar - cmd:makeinfo - " - -BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL - -gccDir=$(pwd) -relativeGccInstallDir="develop/tools$secondaryArchSubDir" -gccInstallDir="$prefix/$relativeGccInstallDir" -gccObjectsDir=$gccDir/../gcc-obj - -BUILD() -{ - rm -rf $gccObjectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $gccObjectsDir - cd $gccObjectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - - CFLAGS="-O2" CXXFLAGS="-O2" "$gccDir/configure" \ - --prefix=$gccInstallDir \ - --disable-nls --enable-shared --enable-languages=c,c++ \ - $additionalConfigureFlags - make bootstrap -} - -INSTALL() -{ - cd $gccObjectsDir - make install - - rm $gccInstallDir/lib/libiberty.a - # only needed for building gcc - - ### HTML documentation #################################### - - local html_base=$docDir - if [ ! -d "$html_base" ]; then - echo "Building HTML documentation..." - mkdir -p $html_base - cd $html_base - - makeinfo --html "$gccDir/gcc/cpp.texi" - makeinfo --html "$gccDir/gcc/gcc.texi" - makeinfo --force --html "$gccDir/libio/iostream.texi" \ - && true - # some errors - - ln -sf cpp/index.html $html_base/cpp.html - ln -sf gcc/index.html $html_base/gcc.html - ln -sf iostream/index.html $html_base/iostream.html - fi - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # convert to absolute links to relative ones - cd $gccInstallDir/bin - ln -sfn g++ c++ - ln -sfn gcc cc - ln -sfn gcc $effectiveTargetMachineTriple-gcc - - # make all tools available via default paths - echo "Symlinking binaries into default path" - mkdir -p $binDir - symlinkRelative -s $gccInstallDir/bin/* $binDir - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of static libraries (libgcc.a) - # exist in $developLibDir. These are put into a separate package - # (gcc_syslibs_devel), which is used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $gccInstallDir - gccLibDir=lib/gcc-lib/$effectiveTargetMachineTriple/2.95.3-* - - # libgcc - cp $gccLibDir/libgcc.a $developLibDir/ - - ### Strip ################################################# - - echo "Strip debug info" - - cd $gccInstallDir - strip --strip-debug bin/* - strip --strip-debug $gccLibDir/* &>/dev/null || true - - ### Cleanup ############################################### - - echo "Cleanup" - - cd $gccInstallDir - rm -rf info - rm -rf share - rm man/man1/cccp.1 - - ### C++ includes ########################################## - - echo "Install C++ includes & library" - - rm -rf $gccInstallDir/include/g++ - ln -snf /boot/system/develop/headers/c++/2.95.3 $gccInstallDir/include/g++ - - ln -snf /boot/system/lib$secondaryArchSubDir/libstdc++.r4.so $gccInstallDir/lib/ - - ### Sub Packages ########################################## - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a - - rm -rf $libDir - rm -rf $developLibDir -} diff --git a/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe b/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe deleted file mode 100644 index 239206d00..000000000 --- a/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe +++ /dev/null @@ -1,183 +0,0 @@ -SUMMARY="The GNU C/C++ compiler" -DESCRIPTION="The standard compiler for x86_gcc2 platform, ABI-compatible with \ -BeOS R5." -SUMMARY_syslibs_devel="C/C++-runtime static libraries, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's c/c++-runtime libraries that is required by Haiku's \ -build system when building Haiku." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2000 Free Software Foundation, Inc." -LICENSE="GNU GPL v2 - GNU LGPL v2" -REVISION="4" -srcGitRev="d86116d57a09505802ed6a38adc43ef294f7f364" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="9eef41dcd1582b84e677f3dcb14faa2dd42707352556d05860470e2a99b7e505" -SOURCE_DIR="buildtools-$srcGitRev/legacy/gcc" -SOURCE_FILENAME="gcc-$portVersion.tar.gz" - -ARCHITECTURES="x86_gcc2 !x86" -SECONDARY_ARCHITECTURES="x86_gcc2" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:cc$secondaryArchSuffix - cmd:c++$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:gcov$secondaryArchSuffix = 1.5 compat >= 1.5 - cmd:i586_pc_haiku_gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:protoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 - cmd:unprotoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 - " -REQUIRES=" - haiku$secondaryArchSuffix - binutils$secondaryArchSuffix - " - -PROVIDES_syslibs_devel=" - gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 2.95.3 - devel:libgcc - " -REQUIRES_syslibs_devel="" - -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - gcc$secondaryArchSuffix - cmd:find - cmd:flex - cmd:make - cmd:sed - cmd:tar - cmd:makeinfo_4.13 - " - -BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL - -gccDir=$(pwd) -relativeGccInstallDir="develop/tools$secondaryArchSubDir" -gccInstallDir="$prefix/$relativeGccInstallDir" -gccObjectsDir=$gccDir/../gcc-obj - -BUILD() -{ - rm -rf $gccObjectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $gccObjectsDir - cd $gccObjectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - - CFLAGS="-O2" CXXFLAGS="-O2" "$gccDir/configure" \ - --prefix=$gccInstallDir \ - --disable-nls --enable-shared --enable-languages=c,c++ \ - $additionalConfigureFlags - make bootstrap -} - -INSTALL() -{ - cd $gccObjectsDir - make install - - rm $gccInstallDir/lib/libiberty.a - # only needed for building gcc - - ### HTML documentation #################################### - - local html_base=$docDir - if [ ! -d "$html_base" ]; then - echo "Building HTML documentation..." - mkdir -p $html_base - cd $html_base - - makeinfo-4.13 --html "$gccDir/gcc/cpp.texi" - makeinfo-4.13 --html "$gccDir/gcc/gcc.texi" - makeinfo-4.13 --force --html "$gccDir/libio/iostream.texi" \ - && true - # some errors - - ln -sf cpp/index.html $html_base/cpp.html - ln -sf gcc/index.html $html_base/gcc.html - ln -sf iostream/index.html $html_base/iostream.html - fi - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # convert to absolute links to relative ones - cd $gccInstallDir/bin - ln -sfn g++ c++ - ln -sfn gcc cc - ln -sfn gcc $effectiveTargetMachineTriple-gcc - - # make all tools available via default paths - echo "Symlinking binaries into default path" - mkdir -p $binDir - symlinkRelative -s $gccInstallDir/bin/* $binDir - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of static libraries (libgcc.a) - # exist in $developLibDir. These are put into a separate package - # (gcc_syslibs_devel), which is used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $gccInstallDir - gccLibDir=lib/gcc-lib/$effectiveTargetMachineTriple/2.95.3-* - - # libgcc - cp $gccLibDir/libgcc.a $developLibDir/ - - ### Strip ################################################# - - echo "Strip debug info" - - cd $gccInstallDir - strip --strip-debug bin/* - strip --strip-debug $gccLibDir/* &>/dev/null || true - - ### Cleanup ############################################### - - echo "Cleanup" - - cd $gccInstallDir - rm -rf info - rm -rf share - rm man/man1/cccp.1 - - ### C++ includes ########################################## - - echo "Install C++ includes & library" - - rm -rf $gccInstallDir/include/g++ - ln -snf /boot/system/develop/headers/c++/2.95.3 $gccInstallDir/include/g++ - - ln -snf /boot/system/lib$secondaryArchSubDir/libstdc++.r4.so $gccInstallDir/lib/ - - ### Sub Packages ########################################## - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a - - rm -rf $libDir - rm -rf $developLibDir -} diff --git a/sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe b/sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe deleted file mode 100644 index 296c087c1..000000000 --- a/sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe +++ /dev/null @@ -1,156 +0,0 @@ -SUMMARY="C/C++ cross-compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for the ${effectiveTargetMachineTriple} \ -platform." -HOMEPAGE="http://gcc.gnu.org" -srcGitRev="3ad9ac2317f63b65937473c4fbe37c9e93e3a116" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="85499c650421b68f9830d3fb2ddfafb8789a3e1ffce75e8dd27aaed678135df0" -SOURCE_FILENAME="$portVersionedName.tar.gz" -REVISION="3" -LICENSE=" - GNU GPL v2 - GNU LGPL v2 - " -COPYRIGHT="1988-2013 Free Software Foundation, Inc." -PATCHES="gcc-4.8.3_2014_05_28.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc_4.8.3$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="buildtools-$srcGitRev/gcc" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - fi - - CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -c 7-) \ - $additionalConfigureFlags - - make $jobArgs -} - -INSTALL() -{ - cd $objectsDir - - make install-strip - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in gmp libquadmath mpc mpfr; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Strip ################################################# - - echo "Strip debug info" - - cd $installDir - strip --strip-debug bin/* - for f in cc1 cc1plus collect2 lto1; do - strip --strip-debug lib/gcc/$effectiveTargetMachineTriple/*/$f - done - strip --strip-debug lib/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - lib/gcc/$effectiveTargetMachineTriple/*/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share -} diff --git a/sys-devel/gcc/gcc-4.8.3_2014_07_26.recipe b/sys-devel/gcc/gcc-4.8.3_2014_07_26.recipe deleted file mode 100644 index a50cc6df3..000000000 --- a/sys-devel/gcc/gcc-4.8.3_2014_07_26.recipe +++ /dev/null @@ -1,319 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -srcGitRev="4947d64591fdd9764dad9ff6835ffbef1618e17f" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="cb9261a3d3ab6e9c4ca5f2cd772a46439490ce525062c5fd2b2d04f50ad45619" -REVISION="2" -LICENSE=" - GNU GPL v2 - GNU LGPL v2 - " -COPYRIGHT="1988-2013 Free Software Foundation, Inc." - -if [ $effectiveTargetArchitecture = x86_64 ]; then - PATCHES="gcc-4.8.3_buildfixes_for_x86_64.patchset" -fi - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.19" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc_4.8.3$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="buildtools-$srcGitRev/gcc" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - echo "### libsupc++" - - # Build a shared libsupc++ from libsupc++.a (hacking the gcc build system - # to build a shared libsupc++ yields pretty much the same result, so we - # use this simpler approach). - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \ - .libs/libsupc++.a - # build kernel version of libsupc++.a (without threads or TLS) - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in gmp libquadmath mpc mpfr; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $libstdcxxDir/libsupc++/.libs/libsupc++.so \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libsupc++.so - cp $gccLibDir/libsupc++.so $libDir/ - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug lib/*.a \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc_syslibs$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc-4.8.4_2014_12_21.recipe b/sys-devel/gcc/gcc-4.8.4_2014_12_21.recipe deleted file mode 100644 index ec0fd1a9e..000000000 --- a/sys-devel/gcc/gcc-4.8.4_2014_12_21.recipe +++ /dev/null @@ -1,319 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -srcGitRev="1a00a76b58ae57d24bd4d774f6323c4ea62dd1e7" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="822f5944c9866eebbe293edcc6ba524e5b1e409114350a681ec88e4d6b747dc2" -REVISION="1" -LICENSE=" - GNU GPL v2 - GNU LGPL v2 - " -COPYRIGHT="1988-2014 Free Software Foundation, Inc." - -if [ $effectiveTargetArchitecture = x86_64 ]; then - PATCHES="gcc-4.8.3_buildfixes_for_x86_64.patchset" -fi - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.19" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc_4.8.4$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="buildtools-$srcGitRev/gcc" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - echo "### libsupc++" - - # Build a shared libsupc++ from libsupc++.a (hacking the gcc build system - # to build a shared libsupc++ yields pretty much the same result, so we - # use this simpler approach). - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \ - .libs/libsupc++.a - # build kernel version of libsupc++.a (without threads or TLS) - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in gmp libquadmath mpc mpfr; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $libstdcxxDir/libsupc++/.libs/libsupc++.so \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libsupc++.so - cp $gccLibDir/libsupc++.so $libDir/ - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug lib/*.a \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The c/c++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc_syslibs$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and c++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc-4.8.5_2015_07_11.recipe b/sys-devel/gcc/gcc-4.8.5_2015_07_11.recipe deleted file mode 100644 index 037e7cd91..000000000 --- a/sys-devel/gcc/gcc-4.8.5_2015_07_11.recipe +++ /dev/null @@ -1,321 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -srcGitRev="3801b878c2c2bfea5a115bcbd75b56d3da05bc3d" -SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="f2c5f2a71018b1669b7b88004fd21e0077bc7dffa2b21554d138b9848f2a17d9" -REVISION="2" -LICENSE=" - GNU GPL v3 - GNU LGPL v3 - " -COPYRIGHT="1988-2015 Free Software Foundation, Inc." - -if [ $effectiveTargetArchitecture = x86_64 ]; then - PATCHES="gcc-4.8.3_buildfixes_for_x86_64.patchset" -else - PATCHES="gcc-4.8.5_2015_07_11_for_x86.patchset" -fi - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.19" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc_4.8.5$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="buildtools-$srcGitRev/gcc" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - echo "### libsupc++" - - # Build a shared libsupc++ from libsupc++.a (hacking the gcc build system - # to build a shared libsupc++ yields pretty much the same result, so we - # use this simpler approach). - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \ - .libs/libsupc++.a - # build kernel version of libsupc++.a (without threads or TLS) - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in gmp libquadmath mpc mpfr; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $libstdcxxDir/libsupc++/.libs/libsupc++.so \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libsupc++.so - cp $gccLibDir/libsupc++.so $libDir/ - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug lib/*.a \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc_syslibs$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc-5.2.0_2015_07_27.recipe b/sys-devel/gcc/gcc-5.2.0_2015_07_27.recipe deleted file mode 100644 index 3cde02588..000000000 --- a/sys-devel/gcc/gcc-5.2.0_2015_07_27.recipe +++ /dev/null @@ -1,325 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -srcGitRev="7b26e3896e268cd452d68ff8df04f4563d5db6ef" -SOURCE_URI="https://github.com/gcc-mirror/gcc/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="3770285b7de18274b4fa06e40b7dbc06c849c08650d03590365a49fa4de40142" -REVISION="2" -LICENSE=" - GNU GPL v3 - GNU LGPL v3 - " -COPYRIGHT="1988-2015 Free Software Foundation, Inc." - -PATCHES="gcc-5.2.0_2015_07_27.patchset" - -ARCHITECTURES="!x86_gcc2 !x86 x86_64 arm" -SECONDARY_ARCHITECTURES="!x86" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.21" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 5 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc_5.2.0$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 5 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="gcc-$srcGitRev" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - echo "### libsupc++" - - # Build a shared libsupc++ from libsupc++.a (hacking the gcc build system - # to build a shared libsupc++ yields pretty much the same result, so we - # use this simpler approach). - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \ - .libs/libsupc++.a - # build kernel version of libsupc++.a (without threads or TLS) - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $libstdcxxDir/libsupc++/.libs/libsupc++.so \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libsupc++.so - cp $gccLibDir/libsupc++.so $libDir/ - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 5 - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 5 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 5 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 5 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 5 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc-5.3.0_2016_02_29.recipe b/sys-devel/gcc/gcc-5.3.0_2016_02_29.recipe deleted file mode 100644 index 4f1e607ae..000000000 --- a/sys-devel/gcc/gcc-5.3.0_2016_02_29.recipe +++ /dev/null @@ -1,347 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2" -CHECKSUM_SHA256="b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db" -REVISION="5" -LICENSE=" - GNU GPL v3 - GNU LGPL v3 - " -COPYRIGHT="1988-2015 Free Software Foundation, Inc." - -PATCHES="gcc-5.3.0_2016_02_29.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -libatomicSoVersion="1" -libatomicLibVersion="1.1.0" - -libgompSoVersion="1" -libgompLibVersion="1.0.0" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.21" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 5 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc_5.3.0$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 5 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="gcc-5.3.0" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ - --with-bug-url=http://dev.haiku-os.org/ \ - --with-default-libstdcxx-abi=gcc4-compatible \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - # build kernel version of libsupc++.a (without threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libatomic - strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion - cp -d $gccLibDir/libatomic.so \ - $gccLibDir/libatomic.so.$libatomicSoVersion \ - $gccLibDir/libatomic.so.$libatomicLibVersion \ - $libDir/ - cp $gccLibDir/libatomic*.a $developLibDir/ - - # libgomp - strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion - cp -d $gccLibDir/libgomp.so \ - $gccLibDir/libgomp.so.$libgompSoVersion \ - $gccLibDir/libgomp.so.$libgompLibVersion \ - $libDir/ - cp $gccLibDir/libgomp*.a $developLibDir/ - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $gccLibDir/ - ln -s libstdc++.so $libDir/libsupc++.so - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libatomic.so.$libatomicSoVersion \ - $relativeLibDir/libatomic.so.$libatomicLibVersion \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libgomp.so.$libgompSoVersion \ - $relativeLibDir/libgomp.so.$libgompLibVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libatomic.a \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libgomp.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 4 - lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 5 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe b/sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe deleted file mode 100644 index b70ea9977..000000000 --- a/sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe +++ /dev/null @@ -1,441 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2015 Free Software Foundation, Inc." -LICENSE=" - GNU GPL v3 - GNU LGPL v3 - " -REVISION="7" -SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2" -CHECKSUM_SHA256="608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a" -SOURCE_DIR="gcc-5.4.0" -PATCHES="gcc-5.4.0_2016_06_04.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 arm" -SECONDARY_ARCHITECTURES="x86" - -libatomicSoVersion="1" -libatomicLibVersion="1.1.0" - -libgccSoVersion="1" -libgccLibVersion="1" - -libgfortranSoVersion="3" -libgfortranLibVersion="3.0.0" - -libgompSoVersion="1" -libgompLibVersion="1.0.0" - -libquadmathSoVersion="0" -libquadmathLibVersion="0.0.0" - -libsspSoVersion="0" -libsspLibVersion="0.0.0" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.21" - -PROVIDES=" - gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 5 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcc_5.4.0$secondaryArchSuffix = $portVersion compat >= 5 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 5 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ - --with-bug-url=http://dev.haiku-os.org/ \ - --with-default-libstdcxx-abi=gcc4-compatible \ - --enable-libssp \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - # build kernel version of libsupc++.a (without threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libatomic - strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion - cp -d $gccLibDir/libatomic.so \ - $gccLibDir/libatomic.so.$libatomicSoVersion \ - $gccLibDir/libatomic.so.$libatomicLibVersion \ - $libDir/ - cp $gccLibDir/libatomic*.a $developLibDir/ - - # libgfortran - strip --strip-debug $gccLibDir/libgfortran.so.$libgfortranLibVersion - cp -d $gccLibDir/libgfortran.so \ - $gccLibDir/libgfortran.so.$libgfortranSoVersion \ - $gccLibDir/libgfortran.so.$libgfortranLibVersion \ - $libDir/ - cp $gccLibDir/libgfortran*.a $developLibDir/ - - # libgomp - strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion - cp -d $gccLibDir/libgomp.so \ - $gccLibDir/libgomp.so.$libgompSoVersion \ - $gccLibDir/libgomp.so.$libgompLibVersion \ - $libDir/ - cp $gccLibDir/libgomp*.a $developLibDir/ - - # libquadmath - strip --strip-debug $gccLibDir/libquadmath.so.$libquadmathLibVersion - cp -d $gccLibDir/libquadmath.so \ - $gccLibDir/libquadmath.so.$libquadmathSoVersion \ - $gccLibDir/libquadmath.so.$libquadmathLibVersion \ - $libDir/ - cp $gccLibDir/libquadmath*.a $developLibDir - - # libssp - strip --strip-debug $gccLibDir/libssp.so.$libsspLibVersion - cp -d $gccLibDir/libssp.so \ - $gccLibDir/libssp.so.$libsspSoVersion \ - $gccLibDir/libssp.so.$libsspLibVersion \ - $libDir/ - cp $gccLibDir/libssp*.a $developLibDir - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $gccLibDir/ - ln -s libstdc++.so $libDir/libsupc++.so - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 f951 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 f951 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov gfortran; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "fortran" \ - $relativeBinDir/gfortran \ - $prefix/$relativeInstallDir/bin/*gfortran \ - $installDir/$gccLibDir/f951 \ - $installDir/$gccLibDir/finclude \ - $installDir/$gccLibDir/libcaf_single.a \ - $installDir/$gccLibDir/libgfortran.a \ - $installDir/$gccLibDir/libgfortran.spec \ - $installDir/$gccLibDir/libgfortranbegin.a - - rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*} - - packageEntries "syslibs" \ - $relativeLibDir/libatomic.so \ - $relativeLibDir/libatomic.so.$libatomicSoVersion \ - $relativeLibDir/libatomic.so.$libatomicLibVersion \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libgfortran.so \ - $relativeLibDir/libgfortran.so.$libgfortranSoVersion \ - $relativeLibDir/libgfortran.so.$libgfortranLibVersion \ - $relativeLibDir/libgomp.so \ - $relativeLibDir/libgomp.so.$libgompSoVersion \ - $relativeLibDir/libgomp.so.$libgompLibVersion \ - $relativeLibDir/libquadmath.so \ - $relativeLibDir/libquadmath.so.$libquadmathSoVersion \ - $relativeLibDir/libquadmath.so.$libquadmathLibVersion \ - $relativeLibDir/libssp.so \ - $relativeLibDir/libssp.so.$libsspSoVersion \ - $relativeLibDir/libssp.so.$libsspLibVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libatomic.a \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libgomp.a \ - $relativeDevelopLibDir/libquadmath.a \ - $relativeDevelopLibDir/libssp.a \ - $relativeDevelopLibDir/libssp_nonshared.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- fortran package ----------------------------------------------- - -SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran" -DESCRIPTION_fortran="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by gfortran to build fortran source code." - -PROVIDES_fortran=" - gcc${secondaryArchSuffix}_fortran = $portVersion compat >= 5 - cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 5 - cmd:f951$secondaryArchSuffix = $portVersion compat >= 5 - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libgfortranbegin$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - " -REQUIRES_fortran=" - haiku$secondaryArchSuffix - gcc${secondaryArchSuffix}_syslibs == $portVersion base - " - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 4 - lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - lib:libssp$secondaryArchSuffix = $libsspLibVersion compat >= $libsspSoVersion - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 5 - devel:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - devel:libgcc_kernel$secondaryArchSuffix = $portVersion compat >= 4 - devel:libgcc$secondaryArchSuffix = $portVersion compat >= 4 - devel:libgcc_eh$secondaryArchSuffix = $portVersion compat >= 4 - devel:libgcc_eh_kernel$secondaryArchSuffix = $portVersion compat >= 4 - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - devel:libssp$secondaryArchSuffix = $libsspLibVersion compat >= $libsspSoVersion - devel:libssp_nonshared$secondaryArchSuffix = $libsspLibVersion - devel:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc49-4.9.3_2015_07_31.recipe b/sys-devel/gcc/gcc49-4.9.3_2015_07_31.recipe deleted file mode 100644 index c5122af7f..000000000 --- a/sys-devel/gcc/gcc49-4.9.3_2015_07_31.recipe +++ /dev/null @@ -1,325 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" - -srcGitRev="876d41ed80ce13e060084ed5a552c37c301e5563" -SOURCE_URI="https://github.com/gcc-mirror/gcc/archive/$srcGitRev.tar.gz" -CHECKSUM_SHA256="5c60d02b319be7529736ce1578d529de47bcafd116d78da2cbbcf87705825c70" -REVISION="1" -LICENSE=" - GNU GPL v3 - GNU LGPL v3 - " -COPYRIGHT="1988-2015 Free Software Foundation, Inc." - -PATCHES="gcc49-4.9.3_2015_07_31.patchset" - -ARCHITECTURES="!x86_gcc2 !x86 ?x86_64 ?arm" -SECONDARY_ARCHITECTURES="!x86" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.20" - -libgccSoVersion="1" -libgccLibVersion="1" - -PROVIDES=" - gcc49$secondaryArchSuffix = $portVersion compat >= 4 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcc_4.9.3$secondaryArchSuffix = $portVersion compat >= 4 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -SOURCE_DIR="gcc-$srcGitRev" - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - echo "### libsupc++" - - # Build a shared libsupc++ from libsupc++.a (hacking the gcc build system - # to build a shared libsupc++ yields pretty much the same result, so we - # use this simpler approach). - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - gcc -nodefaultlibs -shared -o .libs/libsupc++.so -Xlinker --whole-archive \ - .libs/libsupc++.a - # build kernel version of libsupc++.a (without threads or TLS) - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $libstdcxxDir/libsupc++/.libs/libsupc++.so \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libsupc++.so - cp $gccLibDir/libsupc++.so $libDir/ - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "syslibs" \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} - -# ----- syslibs package ----------------------------------------------------- - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." - -PROVIDES_syslibs=" - gcc49_syslibs$secondaryArchSuffix = $portVersion compat >= 4 - lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4 - lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4 - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -# ----- syslibs_devel package ----------------------------------------------- - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." - -PROVIDES_syslibs_devel=" - gcc49_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 4 - " -REQUIRES_syslibs_devel="" diff --git a/sys-devel/gcc/gcc6-6.3.0_2017_05_12.recipe b/sys-devel/gcc/gcc6-6.3.0_2017_05_12.recipe deleted file mode 100644 index 7c5c0d5e2..000000000 --- a/sys-devel/gcc/gcc6-6.3.0_2017_05_12.recipe +++ /dev/null @@ -1,411 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2016 Free Software Foundation, Inc." -LICENSE="GNU GPL v3 - GNU LGPL v3 - " -REVISION="1" -gccVersion="6.3.0" -SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.bz2" -CHECKSUM_SHA256="f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f" -SOURCE_DIR="gcc-$gccVersion" - -PATCHES="gcc-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm" -SECONDARY_ARCHITECTURES="?x86" - -libatomicSoVersion="1" -libatomicLibVersion="1.2.0" - -libgccSoVersion="1" -libgccLibVersion="1" - -libgfortranSoVersion="3" -libgfortranLibVersion="3.0.0" - -libgompSoVersion="1" -libgompLibVersion="1.0.0" - -libquadmathSoVersion="0" -libquadmathLibVersion="0.0.0" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.22" - -PROVIDES=" - gcc6$secondaryArchSuffix = $portVersion compat >= 6 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 6 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 6 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 6 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcc_$portVersion$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran" -DESCRIPTION_fortran="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by gfortran to build fortran source code." -PROVIDES_fortran=" - gcc6${secondaryArchSuffix}_fortran = $portVersion compat >= 6 - cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 6 - cmd:f951$secondaryArchSuffix = $portVersion compat >= 6 - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - " -REQUIRES_fortran=" - haiku$secondaryArchSuffix - gcc6${secondaryArchSuffix}_syslibs == $portVersion base - " - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." -PROVIDES_syslibs=" - gcc6${secondaryArchSuffix}_syslibs = $portVersion compat >= 6 - lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - lib:libgcc_s$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - lib:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." -PROVIDES_syslibs_devel=" - gcc6${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 6 - devel:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - devel:libgcc_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - devel:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 6 - devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES_syslibs_devel="" - -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ - --with-bug-url=http://dev.haiku-os.org/ \ - --with-default-libstdcxx-abi=gcc4-compatible \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - # build kernel version of libsupc++.a (without threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libatomic - strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion - cp -d $gccLibDir/libatomic.so \ - $gccLibDir/libatomic.so.$libatomicSoVersion \ - $gccLibDir/libatomic.so.$libatomicLibVersion \ - $libDir/ - cp $gccLibDir/libatomic*.a $developLibDir/ - - # libgfortran - strip --strip-debug $gccLibDir/libgfortran.so.$libgfortranLibVersion - cp -d $gccLibDir/libgfortran.so \ - $gccLibDir/libgfortran.so.$libgfortranSoVersion \ - $gccLibDir/libgfortran.so.$libgfortranLibVersion \ - $libDir/ - cp $gccLibDir/libgfortran*.a $developLibDir/ - - # libgomp - strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion - cp -d $gccLibDir/libgomp.so \ - $gccLibDir/libgomp.so.$libgompSoVersion \ - $gccLibDir/libgomp.so.$libgompLibVersion \ - $libDir/ - cp $gccLibDir/libgomp*.a $developLibDir/ - - # libquadmath - strip --strip-debug $gccLibDir/libquadmath.so.$libquadmathLibVersion - cp -d $gccLibDir/libquadmath.so \ - $gccLibDir/libquadmath.so.$libquadmathSoVersion \ - $gccLibDir/libquadmath.so.$libquadmathLibVersion \ - $libDir/ - cp $gccLibDir/libquadmath*.a $developLibDir - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $gccLibDir/ - ln -s libstdc++.so $libDir/libsupc++.so - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 f951 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 f951 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov gfortran; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "fortran" \ - $relativeBinDir/gfortran \ - $developDir/tools/bin/*gfortran \ - $installDir/$gccLibDir/f951 \ - $installDir/$gccLibDir/finclude \ - $installDir/$gccLibDir/libcaf_single.a \ - $installDir/$gccLibDir/libgfortran.a \ - $installDir/$gccLibDir/libgfortran.spec - - rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*} - - packageEntries "syslibs" \ - $relativeLibDir/libatomic.so \ - $relativeLibDir/libatomic.so.$libatomicSoVersion \ - $relativeLibDir/libatomic.so.$libatomicLibVersion \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libgfortran.so \ - $relativeLibDir/libgfortran.so.$libgfortranSoVersion \ - $relativeLibDir/libgfortran.so.$libgfortranLibVersion \ - $relativeLibDir/libgomp.so \ - $relativeLibDir/libgomp.so.$libgompSoVersion \ - $relativeLibDir/libgomp.so.$libgompLibVersion \ - $relativeLibDir/libquadmath.so \ - $relativeLibDir/libquadmath.so.$libquadmathSoVersion \ - $relativeLibDir/libquadmath.so.$libquadmathLibVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libatomic.a \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libgomp.a \ - $relativeDevelopLibDir/libquadmath.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} diff --git a/sys-devel/gcc/gcc6-6.4.0_2017_05_12.recipe b/sys-devel/gcc/gcc6-6.4.0_2017_05_12.recipe deleted file mode 100644 index 00073bbdf..000000000 --- a/sys-devel/gcc/gcc6-6.4.0_2017_05_12.recipe +++ /dev/null @@ -1,411 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2017 Free Software Foundation, Inc." -LICENSE="GNU GPL v3 - GNU LGPL v3 - " -REVISION="1" -gccVersion="6.4.0" -SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz" -CHECKSUM_SHA256="850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4" -SOURCE_DIR="gcc-$gccVersion" - -PATCHES="gcc-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm" -SECONDARY_ARCHITECTURES="?x86" - -libatomicSoVersion="1" -libatomicLibVersion="1.2.0" - -libgccSoVersion="1" -libgccLibVersion="1" - -libgfortranSoVersion="3" -libgfortranLibVersion="3.0.0" - -libgompSoVersion="1" -libgompLibVersion="1.0.0" - -libquadmathSoVersion="0" -libquadmathLibVersion="0.0.0" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.22" - -PROVIDES=" - gcc6$secondaryArchSuffix = $portVersion compat >= 6 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 6 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 6 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 6 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcc_$portVersion$secondaryArchSuffix = $portVersion compat >= 6 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran" -DESCRIPTION_fortran="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by gfortran to build fortran source code." -PROVIDES_fortran=" - gcc6${secondaryArchSuffix}_fortran = $portVersion compat >= 6 - cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 6 - cmd:f951$secondaryArchSuffix = $portVersion compat >= 6 - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - " -REQUIRES_fortran=" - haiku$secondaryArchSuffix - gcc6${secondaryArchSuffix}_syslibs == $portVersion base - " - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." -PROVIDES_syslibs=" - gcc6${secondaryArchSuffix}_syslibs = $portVersion compat >= 6 - lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - lib:libgcc_s$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - lib:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." -PROVIDES_syslibs_devel=" - gcc6${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 6 - devel:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - devel:libgcc_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - devel:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 6 - devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 6 - " -REQUIRES_syslibs_devel="" - -BUILD_REQUIRES=" - devel:libgmp$secondaryArchSuffix - devel:libmpc$secondaryArchSuffix - devel:libmpfr$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ - --with-bug-url=http://dev.haiku-os.org/ \ - --with-default-libstdcxx-abi=gcc4-compatible \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - # build kernel version of libsupc++.a (without threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libatomic - strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion - cp -d $gccLibDir/libatomic.so \ - $gccLibDir/libatomic.so.$libatomicSoVersion \ - $gccLibDir/libatomic.so.$libatomicLibVersion \ - $libDir/ - cp $gccLibDir/libatomic*.a $developLibDir/ - - # libgfortran - strip --strip-debug $gccLibDir/libgfortran.so.$libgfortranLibVersion - cp -d $gccLibDir/libgfortran.so \ - $gccLibDir/libgfortran.so.$libgfortranSoVersion \ - $gccLibDir/libgfortran.so.$libgfortranLibVersion \ - $libDir/ - cp $gccLibDir/libgfortran*.a $developLibDir/ - - # libgomp - strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion - cp -d $gccLibDir/libgomp.so \ - $gccLibDir/libgomp.so.$libgompSoVersion \ - $gccLibDir/libgomp.so.$libgompLibVersion \ - $libDir/ - cp $gccLibDir/libgomp*.a $developLibDir/ - - # libquadmath - strip --strip-debug $gccLibDir/libquadmath.so.$libquadmathLibVersion - cp -d $gccLibDir/libquadmath.so \ - $gccLibDir/libquadmath.so.$libquadmathSoVersion \ - $gccLibDir/libquadmath.so.$libquadmathLibVersion \ - $libDir/ - cp $gccLibDir/libquadmath*.a $developLibDir - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $gccLibDir/ - ln -s libstdc++.so $libDir/libsupc++.so - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 f951 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 f951 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov gfortran; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "fortran" \ - $relativeBinDir/gfortran \ - $developDir/tools/bin/*gfortran \ - $installDir/$gccLibDir/f951 \ - $installDir/$gccLibDir/finclude \ - $installDir/$gccLibDir/libcaf_single.a \ - $installDir/$gccLibDir/libgfortran.a \ - $installDir/$gccLibDir/libgfortran.spec - - rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*} - - packageEntries "syslibs" \ - $relativeLibDir/libatomic.so \ - $relativeLibDir/libatomic.so.$libatomicSoVersion \ - $relativeLibDir/libatomic.so.$libatomicLibVersion \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libgfortran.so \ - $relativeLibDir/libgfortran.so.$libgfortranSoVersion \ - $relativeLibDir/libgfortran.so.$libgfortranLibVersion \ - $relativeLibDir/libgomp.so \ - $relativeLibDir/libgomp.so.$libgompSoVersion \ - $relativeLibDir/libgomp.so.$libgompLibVersion \ - $relativeLibDir/libquadmath.so \ - $relativeLibDir/libquadmath.so.$libquadmathSoVersion \ - $relativeLibDir/libquadmath.so.$libquadmathLibVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libatomic.a \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libgomp.a \ - $relativeDevelopLibDir/libquadmath.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} diff --git a/sys-devel/gcc/gcc7-7.1.0_2017_05_12.recipe b/sys-devel/gcc/gcc7-7.1.0_2017_05_12.recipe deleted file mode 100644 index 51eff63c0..000000000 --- a/sys-devel/gcc/gcc7-7.1.0_2017_05_12.recipe +++ /dev/null @@ -1,410 +0,0 @@ -SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" -DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ -architectures other than x86_gcc2)." -HOMEPAGE="http://gcc.gnu.org" -COPYRIGHT="1988-2017 Free Software Foundation, Inc." -LICENSE="GNU GPL v3 - GNU LGPL v3 - " -REVISION="1" -gccVersion="7.1.0" -SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.bz2" -CHECKSUM_SHA256="8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17" -SOURCE_DIR="gcc-$gccVersion" -PATCHES="gcc-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm" -SECONDARY_ARCHITECTURES="?x86" - -libatomicSoVersion="1" -libatomicLibVersion="1.2.0" - -libgccSoVersion="1" -libgccLibVersion="1" - -libgfortranSoVersion="4" -libgfortranLibVersion="4.0.0" - -libgompSoVersion="1" -libgompLibVersion="1.0.0" - -libquadmathSoVersion="0" -libquadmathLibVersion="0.0.0" - -libstdcxxSoVersion="6" -libstdcxxLibVersion="6.0.23" - -PROVIDES=" - gcc7$secondaryArchSuffix = $portVersion compat >= 7 - cmd:c++$secondaryArchSuffix = $portVersion compat >= 7 - cmd:cc$secondaryArchSuffix = $portVersion compat >= 7 - cmd:cpp$secondaryArchSuffix = $portVersion compat >= 7 - cmd:g++$secondaryArchSuffix = $portVersion compat >= 7 - cmd:gcc$secondaryArchSuffix = $portVersion compat >= 7 - cmd:gcc_$portVersion$secondaryArchSuffix = $portVersion compat >= 7 - cmd:gcov$secondaryArchSuffix = $portVersion compat >= 7 - " -REQUIRES=" - haiku$secondaryArchSuffix - cmd:as$secondaryArchSuffix - lib:libgmp$secondaryArchSuffix - lib:libmpc$secondaryArchSuffix - lib:libmpfr$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran" -DESCRIPTION_fortran="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by gfortran to build fortran source code." -PROVIDES_fortran=" - gcc7${secondaryArchSuffix}_fortran = $portVersion compat >= 7 - cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 7 - cmd:f951$secondaryArchSuffix = $portVersion compat >= 7 - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - " -REQUIRES_fortran=" - haiku$secondaryArchSuffix - gcc7${secondaryArchSuffix}_syslibs == $portVersion base - " - -SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" -DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ -distribution. This package contains the shared libraries for the runtime \ -loader, so it is required for executing most c/c++ programs." -PROVIDES_syslibs=" - gcc7${secondaryArchSuffix}_syslibs = $portVersion compat >= 7 - lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - lib:libgcc_s$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - lib:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 7 - " -REQUIRES_syslibs=" - haiku$secondaryArchSuffix - " - -SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" -DESCRIPTION_syslibs_devel="This package is not of general interest - it \ -contains the set of gcc's C/C++-runtime libraries and headers that is \ -required by Haiku's build system when building Haiku." -PROVIDES_syslibs_devel=" - gcc7${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 7 - devel:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion - devel:libgcc_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgcc_eh$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion - devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion - devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion - devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion - devel:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion - devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 7 - devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 7 - " -REQUIRES_syslibs_devel="" - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libgmp$secondaryArchSuffix >= 10.3.0 - devel:libmpc$secondaryArchSuffix >= 3.0.0 - devel:libmpfr$secondaryArchSuffix >= 4.1.4 - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:autoconf - cmd:awk - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:makeinfo - cmd:sed - cmd:strip - cmd:tar - cmd:xargs - " - -sourceDir=$(pwd) -relativeInstallDir="develop/tools$secondaryArchSubDir" -installDir="$prefix/$relativeInstallDir" -objectsDir=$(pwd)/../${portVersionedName}-obj -gccVersion=$(echo $portVersion | cut -d_ -f1) - -BUILD() -{ - rm -rf $objectsDir - - # Touch some files generated by bison, so that bison won't run to update - # them. Fixes issues with newer bison versions. - # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ - cp/parse.h c-gperf.h) - - mkdir -p $objectsDir - cd $objectsDir - - local additionalConfigureFlags - if [ -n "$secondaryArchSuffix" ]; then - additionalConfigureFlags="\ - --with-hybrid-secondary=${effectiveTargetArchitecture}" - fi - local kernelCcFlags="-D_KERNEL_MODE" - if [ $effectiveTargetArchitecture == x86_64 ]; then - # disable multilib support, as x86_64 by default tries to build the - # 32-bit libraries, too, which fails as no 32-bit libroot is available - additionalConfigureFlags+=" --disable-multilib" - - # deactivate red zone for x86_64 - kernelCcFlags="$kernelCcFlags -mno-red-zone" - fi - - "$sourceDir/configure" \ - --build=$effectiveTargetMachineTriple \ - --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ - --docdir=$docDir --enable-threads=posix \ - --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ - --enable-version-specific-runtime-libs \ - --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer \ - --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ - --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ - --with-bug-url=http://dev.haiku-os.org/ \ - --with-default-libstdcxx-abi=gcc4-compatible \ - $additionalConfigureFlags - - make $jobArgs - - echo "######################## building special libraries ################" - - echo "### libgcc" - - # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libgcc - mkdir -p saved - mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ - make clean - ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv libgcc.a libgcc-kernel.a - mv libgcc_eh.a libgcc_eh-kernel.a - ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h - mv saved/* . - rmdir saved - - # build kernel version of libsupc++.a (without threads or TLS) - cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ - mkdir -p saved - mv .libs/libsupc++* saved/ - cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ - "../config.h" \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ - saved/ - make clean - cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ - "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" - sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ - "../config.h" - sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ - "../include/$effectiveTargetMachineTriple/bits/c++config.h" - make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" - mv .libs/libsupc++.a .libs/libsupc++-kernel.a - mv saved/libsupc++* .libs/ - mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" - mv saved/config.h .. - mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" - rmdir saved -} - -INSTALL() -{ - cd $objectsDir - - make install - make install-html - - ### HTML documentation #################################### - - echo "Organizing HTML documentation..." - cd $docDir - for dir in libquadmath; do - mv ${dir}.html $dir - ln -s $dir/index.html ${dir}.html - done - - ### Libraries ############################################# - - echo "Moving libraries around" - - # Move/copy libraries such that copies of the runtime (shared) libs exist - # in $libDir and copies of static libraries exist in $developLibDir. These - # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which - # are both used by Haiku's build system. - mkdir -p $libDir - mkdir -p $developLibDir - cd $installDir - gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion - - # libatomic - strip --strip-debug $gccLibDir/libatomic.so.$libatomicLibVersion - cp -d $gccLibDir/libatomic.so \ - $gccLibDir/libatomic.so.$libatomicSoVersion \ - $gccLibDir/libatomic.so.$libatomicLibVersion \ - $libDir/ - cp $gccLibDir/libatomic*.a $developLibDir/ - - # libgfortran - strip --strip-debug $gccLibDir/libgfortran.so.$libgfortranLibVersion - cp -d $gccLibDir/libgfortran.so \ - $gccLibDir/libgfortran.so.$libgfortranSoVersion \ - $gccLibDir/libgfortran.so.$libgfortranLibVersion \ - $libDir/ - cp $gccLibDir/libgfortran*.a $developLibDir/ - - # libgomp - strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion - cp -d $gccLibDir/libgomp.so \ - $gccLibDir/libgomp.so.$libgompSoVersion \ - $gccLibDir/libgomp.so.$libgompLibVersion \ - $libDir/ - cp $gccLibDir/libgomp*.a $developLibDir/ - - # libquadmath - strip --strip-debug $gccLibDir/libquadmath.so.$libquadmathLibVersion - cp -d $gccLibDir/libquadmath.so \ - $gccLibDir/libquadmath.so.$libquadmathSoVersion \ - $gccLibDir/libquadmath.so.$libquadmathLibVersion \ - $libDir/ - cp $gccLibDir/libquadmath*.a $developLibDir - - # libstdc++ - strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion - cp -d $gccLibDir/libstdc++.so \ - $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ - $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ - $libDir/ - cp $gccLibDir/libstdc++*.a $developLibDir/ - - # libsupc++ - libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 - cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ - $gccLibDir/ - ln -s libstdc++.so $libDir/libsupc++.so - cp $gccLibDir/libsupc++*.a $developLibDir/ - - # libgcc - cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ - $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ - $gccLibDir/ - strip --strip-debug $gccLibDir/libgcc_s.so.$libgccSoVersion - cp -d $gccLibDir/libgcc_s.so \ - $gccLibDir/libgcc_s.so.$libgccSoVersion \ - $libDir/ - cp $gccLibDir/libgcc*.a $developLibDir/ - - # gcc and c++ headers - mkdir -p $includeDir/gcc - cp -r $gccLibDir/include $includeDir/gcc/ - cp -r $gccLibDir/include-fixed $includeDir/gcc/ - mv $includeDir/gcc/include/c++ $includeDir/ - - ### Strip ################################################# - - echo "Strip" - - cd $installDir - strip bin/* - for f in cc1 cc1plus collect2 f951 lto1 lto-wrapper; do - strip $gccLibDir/$f - done - - strip --strip-debug \ - $gccLibDir/*.a \ - $developLibDir/*.a - - ### Disable ASLR ########################################## - - echo "Add SYS:ENV attribute to disable ASLR" - - cd $installDir - for f in bin/*; do - if [ -r "$f" ]; then - addattr SYS:ENV DISABLE_ASLR=1 $f - fi - done - for f in cc1 cc1plus collect2 f951 lto1; do - addattr SYS:ENV DISABLE_ASLR=1 \ - $gccLibDir/$f - done - - ### Symlinks ############################################## - - echo "Creating required symlinks" - - # create missing cc symlink - ln -sf gcc $installDir/bin/cc - - # make all tools available via default paths - mkdir -p $binDir - for f in c++ cc cpp g++ gcc gcov gfortran; do - symlinkRelative -sfn $installDir/bin/$f $binDir - done - - ### Cleanup ############################################### - - echo "Cleanup" - rm -rf $installDir/info - rm -rf $installDir/share - - ### Sub Packages ########################################## - - packageEntries "fortran" \ - $relativeBinDir/gfortran \ - $developDir/tools/bin/*gfortran \ - $installDir/$gccLibDir/f951 \ - $installDir/$gccLibDir/finclude \ - $installDir/$gccLibDir/libcaf_single.a \ - $installDir/$gccLibDir/libgfortran.a \ - $installDir/$gccLibDir/libgfortran.spec - - rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*} - - packageEntries "syslibs" \ - $relativeLibDir/libatomic.so \ - $relativeLibDir/libatomic.so.$libatomicSoVersion \ - $relativeLibDir/libatomic.so.$libatomicLibVersion \ - $relativeLibDir/libgcc_s.so \ - $relativeLibDir/libgcc_s.so.$libgccSoVersion \ - $relativeLibDir/libgfortran.so \ - $relativeLibDir/libgfortran.so.$libgfortranSoVersion \ - $relativeLibDir/libgfortran.so.$libgfortranLibVersion \ - $relativeLibDir/libgomp.so \ - $relativeLibDir/libgomp.so.$libgompSoVersion \ - $relativeLibDir/libgomp.so.$libgompLibVersion \ - $relativeLibDir/libquadmath.so \ - $relativeLibDir/libquadmath.so.$libquadmathSoVersion \ - $relativeLibDir/libquadmath.so.$libquadmathLibVersion \ - $relativeLibDir/libstdc++.so \ - $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ - $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ - $relativeLibDir/libsupc++.so - - packageEntries "syslibs_devel" \ - $relativeDevelopLibDir/libatomic.a \ - $relativeDevelopLibDir/libgcc.a \ - $relativeDevelopLibDir/libgcc-kernel.a \ - $relativeDevelopLibDir/libgcc_eh.a \ - $relativeDevelopLibDir/libgcc_eh-kernel.a \ - $relativeDevelopLibDir/libgomp.a \ - $relativeDevelopLibDir/libquadmath.a \ - $relativeDevelopLibDir/libstdc++.a \ - $relativeDevelopLibDir/libsupc++.a \ - $relativeDevelopLibDir/libsupc++-kernel.a \ - $relativeIncludeDir - - rm -rf $includeDir - rm -rf $developLibDir -} diff --git a/sys-devel/gcc/patches/gcc-4.8.3_2014_05_28.patchset b/sys-devel/gcc/patches/gcc-4.8.3_2014_05_28.patchset deleted file mode 100644 index 6329e3fa8..000000000 --- a/sys-devel/gcc/patches/gcc-4.8.3_2014_05_28.patchset +++ /dev/null @@ -1,24 +0,0 @@ -From e9e78f55996c23624ebd792eed57dd60a571daaa Mon Sep 17 00:00:00 2001 -From: Jessica Hamilton -Date: Tue, 22 Jul 2014 01:32:29 +0000 -Subject: Specify -save-temps for libgcc during dependency phase - -This works around an internal compiler error when building -gcc for x86_64 with thread local storage enabled. - -diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in -index 2353c9c..93eada2 100644 ---- a/libcpp/Makefile.in -+++ b/libcpp/Makefile.in -@@ -207,7 +207,7 @@ ifeq ($(DEPMODE),depmode=gcc3) - # Note that we put the dependencies into a .Tpo file, then move them - # into place if the compile succeeds. We need this because gcc does - # not atomically write the dependency output file. --COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo -+COMPILE = $(COMPILE.base) -o $@ -save-temps -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo - POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po - else - COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ --- -1.8.3.4 - diff --git a/sys-devel/gcc/patches/gcc-4.8.3_buildfixes_for_x86_64.patchset b/sys-devel/gcc/patches/gcc-4.8.3_buildfixes_for_x86_64.patchset deleted file mode 100644 index 0fa121862..000000000 --- a/sys-devel/gcc/patches/gcc-4.8.3_buildfixes_for_x86_64.patchset +++ /dev/null @@ -1,95 +0,0 @@ -From e9e78f55996c23624ebd792eed57dd60a571daaa Mon Sep 17 00:00:00 2001 -From: Jessica Hamilton -Date: Tue, 22 Jul 2014 01:32:29 +0000 -Subject: Specify -save-temps for libgcc during dependency phase - -This works around an internal compiler error when building -gcc for x86_64 with thread local storage enabled. - -diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in -index 2353c9c..93eada2 100644 ---- a/libcpp/Makefile.in -+++ b/libcpp/Makefile.in -@@ -207,7 +207,7 @@ ifeq ($(DEPMODE),depmode=gcc3) - # Note that we put the dependencies into a .Tpo file, then move them - # into place if the compile succeeds. We need this because gcc does - # not atomically write the dependency output file. --COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo -+COMPILE = $(COMPILE.base) -o $@ -save-temps -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo - POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po - else - COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ --- -1.8.3.4 - -From fc3eb46b47136ae82418e2a6f63f3e3d8e918c1f Mon Sep 17 00:00:00 2001 -From: Oliver Tappe -Date: Sat, 26 Jul 2014 13:19:29 +0200 -Subject: Circumvent build problems on x86_64. - -* Due to some yet unknown cause, --as-needed does not seem to work as - expected on x86_64, which causes the gcc build to fail when it checks - if it can execute built programs (as libgcc_s.so is needed by those - programs and can't be found). Circumvent the problem for now by creating - appropriate 'lib' symlinks such that libgcc_s.so will be found by - runtime_loader. - -diff --git a/gmp/configure b/gmp/configure -index e8378cc..68c8d69 100755 ---- a/gmp/configure -+++ b/gmp/configure -@@ -9378,7 +9378,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - esac - -- -+# create lib symlink such that the runtime loader will find libgcc_s.so -+ln -sfn ../prev-gcc lib - - # The C compiler on the build system, and associated tests. - -diff --git a/libquadmath/configure b/libquadmath/configure -index 76dfbdf..e58cf46 100755 ---- a/libquadmath/configure -+++ b/libquadmath/configure -@@ -3381,6 +3381,9 @@ See \`config.log' for more details." "$LINENO" 5; }; } - fi - ac_exeext=$ac_cv_exeext - -+# create lib symlink such that the runtime loader will find libgcc_s.so -+ln -sfn ../../gcc/ lib -+ - # Check that the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -diff --git a/libssp/configure b/libssp/configure -index c42affe..20e2b87 100755 ---- a/libssp/configure -+++ b/libssp/configure -@@ -3361,6 +3361,9 @@ See \`config.log' for more details." "$LINENO" 5; }; } - fi - ac_exeext=$ac_cv_exeext - -+# create lib symlink such that the runtime loader will find libgcc_s.so -+ln -sfn ../../gcc/ lib -+ - # Check that the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 6479114..72e04bd 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -3997,6 +3997,9 @@ See \`config.log' for more details." "$LINENO" 5; }; } - fi - ac_exeext=$ac_cv_exeext - -+# create lib symlink such that the runtime loader will find libgcc_s.so -+ln -sfn ../../gcc/ lib -+ - # Check that the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 --- -1.8.3.4 - diff --git a/sys-devel/gcc/patches/gcc-4.8.5_2015_07_11_for_x86.patchset b/sys-devel/gcc/patches/gcc-4.8.5_2015_07_11_for_x86.patchset deleted file mode 100644 index 12f21bbe7..000000000 --- a/sys-devel/gcc/patches/gcc-4.8.5_2015_07_11_for_x86.patchset +++ /dev/null @@ -1,127 +0,0 @@ -From a5258ce3a2b1e87a6c56f2a41c3574fbd1dd9250 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Tue, 14 Jul 2015 16:01:28 +0000 -Subject: Revert 4.8.5 import of gcc/var-tracking.c - - -diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c -index f228464..0db1562 100644 ---- a/gcc/var-tracking.c -+++ b/gcc/var-tracking.c -@@ -592,39 +592,6 @@ static void vt_add_function_parameters (void); - static bool vt_initialize (void); - static void vt_finalize (void); - --/* Callback for stack_adjust_offset_pre_post, called via for_each_inc_dec. */ -- --static int --stack_adjust_offset_pre_post_cb (rtx, rtx op, rtx dest, rtx src, rtx srcoff, -- void *arg) --{ -- if (dest != stack_pointer_rtx) -- return 0; -- -- switch (GET_CODE (op)) -- { -- case PRE_INC: -- case PRE_DEC: -- ((HOST_WIDE_INT *)arg)[0] -= INTVAL (srcoff); -- return 0; -- case POST_INC: -- case POST_DEC: -- ((HOST_WIDE_INT *)arg)[1] -= INTVAL (srcoff); -- return 0; -- case PRE_MODIFY: -- case POST_MODIFY: -- /* We handle only adjustments by constant amount. */ -- gcc_assert (GET_CODE (src) == PLUS -- && CONST_INT_P (XEXP (src, 1)) -- && XEXP (src, 0) == stack_pointer_rtx); -- ((HOST_WIDE_INT *)arg)[GET_CODE (op) == POST_MODIFY] -- -= INTVAL (XEXP (src, 1)); -- return 0; -- default: -- gcc_unreachable (); -- } --} -- - /* Given a SET, calculate the amount of stack adjustment it contains - PRE- and POST-modifying stack pointer. - This function is similar to stack_adjust_offset. */ -@@ -650,12 +617,68 @@ stack_adjust_offset_pre_post (rtx pattern, HOST_WIDE_INT *pre, - *post += INTVAL (XEXP (src, 1)); - else - *post -= INTVAL (XEXP (src, 1)); -- return; - } -- HOST_WIDE_INT res[2] = { 0, 0 }; -- for_each_inc_dec (&pattern, stack_adjust_offset_pre_post_cb, res); -- *pre += res[0]; -- *post += res[1]; -+ else if (MEM_P (dest)) -+ { -+ /* (set (mem (pre_dec (reg sp))) (foo)) */ -+ src = XEXP (dest, 0); -+ code = GET_CODE (src); -+ -+ switch (code) -+ { -+ case PRE_MODIFY: -+ case POST_MODIFY: -+ if (XEXP (src, 0) == stack_pointer_rtx) -+ { -+ rtx val = XEXP (XEXP (src, 1), 1); -+ /* We handle only adjustments by constant amount. */ -+ gcc_assert (GET_CODE (XEXP (src, 1)) == PLUS && -+ CONST_INT_P (val)); -+ -+ if (code == PRE_MODIFY) -+ *pre -= INTVAL (val); -+ else -+ *post -= INTVAL (val); -+ break; -+ } -+ return; -+ -+ case PRE_DEC: -+ if (XEXP (src, 0) == stack_pointer_rtx) -+ { -+ *pre += GET_MODE_SIZE (GET_MODE (dest)); -+ break; -+ } -+ return; -+ -+ case POST_DEC: -+ if (XEXP (src, 0) == stack_pointer_rtx) -+ { -+ *post += GET_MODE_SIZE (GET_MODE (dest)); -+ break; -+ } -+ return; -+ -+ case PRE_INC: -+ if (XEXP (src, 0) == stack_pointer_rtx) -+ { -+ *pre -= GET_MODE_SIZE (GET_MODE (dest)); -+ break; -+ } -+ return; -+ -+ case POST_INC: -+ if (XEXP (src, 0) == stack_pointer_rtx) -+ { -+ *post -= GET_MODE_SIZE (GET_MODE (dest)); -+ break; -+ } -+ return; -+ -+ default: -+ return; -+ } -+ } - } - - /* Given an INSN, calculate the amount of stack adjustment it contains --- -1.8.3.4 - diff --git a/sys-devel/gcc/patches/gcc-5.2.0_2015_07_27.patchset b/sys-devel/gcc/patches/gcc-5.2.0_2015_07_27.patchset deleted file mode 100644 index 4cf991223..000000000 --- a/sys-devel/gcc/patches/gcc-5.2.0_2015_07_27.patchset +++ /dev/null @@ -1,2895 +0,0 @@ -From 35da60e9dc98c57971809054ffe5da0f615a1c30 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: [PATCH 1/2] Haiku patch - ---- - compile | 0 - config.rpath | 2 + - config/acx.m4 | 36 +-- - configure.ac | 12 + - gcc/Makefile.in | 12 +- - gcc/config.gcc | 48 ++++ - gcc/config.host | 8 +- - gcc/config/arm/haiku.h | 80 ++++++ - gcc/config/arm/t-haiku | 21 ++ - gcc/config/haiku-stdint.h | 55 +++++ - gcc/config/haiku.h | 221 +++++++++++++++++ - gcc/config/i386/haiku.h | 77 ++++++ - gcc/config/i386/haiku64.h | 135 +++++++++++ - gcc/config/i386/host-cygwin.c | 0 - gcc/config/i386/t-haiku64 | 16 ++ - gcc/config/i386/winnt-cxx.c | 0 - gcc/config/i386/winnt-stubs.c | 0 - gcc/config/m68k/haiku.h | 268 +++++++++++++++++++++ - gcc/config/mips/haiku.h | 44 ++++ - gcc/config/rs6000/haiku.h | 59 +++++ - gcc/config/t-haiku | 4 + - gcc/configure.ac | 21 +- - gcc/defaults.h | 3 +- - gcc/ginclude/stdarg.h | 2 +- - gcc/ginclude/stddef.h | 10 +- - include/filenames.h | 2 + - libgcc/Makefile.in | 6 + - libgcc/config.host | 26 ++ - libgcc/config/i386/t-cygming | 0 - libgcc/config/t-haiku | 3 + - libgcc/crtstuff.c | 2 + - libstdc++-v3/config/os/haiku/ctype_base.h | 61 +++++ - .../config/os/haiku/ctype_configure_char.cc | 99 ++++++++ - libstdc++-v3/config/os/haiku/ctype_inline.h | 168 +++++++++++++ - libstdc++-v3/config/os/haiku/error_constants.h | 178 ++++++++++++++ - libstdc++-v3/config/os/haiku/os_defines.h | 45 ++++ - libstdc++-v3/configure.host | 3 + - libstdc++-v3/crossconfig.m4 | 41 ++++ - libstdc++-v3/libsupc++/tinfo.cc | 9 + - libtool.m4 | 14 +- - 40 files changed, 1755 insertions(+), 36 deletions(-) - mode change 100755 => 100644 compile - create mode 100644 gcc/config/arm/haiku.h - create mode 100644 gcc/config/arm/t-haiku - create mode 100644 gcc/config/haiku-stdint.h - create mode 100644 gcc/config/haiku.h - create mode 100644 gcc/config/i386/haiku.h - create mode 100644 gcc/config/i386/haiku64.h - mode change 100644 => 100755 gcc/config/i386/host-cygwin.c - create mode 100644 gcc/config/i386/t-haiku64 - mode change 100644 => 100755 gcc/config/i386/winnt-cxx.c - mode change 100644 => 100755 gcc/config/i386/winnt-stubs.c - create mode 100644 gcc/config/m68k/haiku.h - create mode 100644 gcc/config/mips/haiku.h - create mode 100644 gcc/config/rs6000/haiku.h - create mode 100644 gcc/config/t-haiku - mode change 100644 => 100755 libgcc/config/i386/t-cygming - create mode 100644 libgcc/config/t-haiku - create mode 100644 libstdc++-v3/config/os/haiku/ctype_base.h - create mode 100644 libstdc++-v3/config/os/haiku/ctype_configure_char.cc - create mode 100644 libstdc++-v3/config/os/haiku/ctype_inline.h - create mode 100644 libstdc++-v3/config/os/haiku/error_constants.h - create mode 100644 libstdc++-v3/config/os/haiku/os_defines.h - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 987dfab..127b6d4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -410,6 +410,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -787,6 +790,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -974,6 +980,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1027,6 +1036,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 07c6f0a..41c4edb 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -101,6 +101,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -1989,6 +1991,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2561,7 +2567,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - # For stage1 and when cross-compiling use the build libcpp which is - # built with NLS disabled. For stage2+ use the host library and -@@ -2623,6 +2629,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 3ede69b..33548f6 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -688,6 +688,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1034,6 +1047,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1392,6 +1415,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1914,6 +1945,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -1997,6 +2035,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2331,6 +2374,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index b0f5940..2db7555 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -99,7 +99,7 @@ case ${host} in - esac - - case ${host} in -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -125,9 +125,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..2aa4b2b ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,221 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..9ff36f1 ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,59 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 6f38ba1..5831bd1 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -649,6 +649,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1079,6 +1088,16 @@ AC_LANG_POP(C++) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1534,7 +1553,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 1d54798..b4aba11 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -380,7 +380,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index afc1cc5..1d3ef09 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -93,7 +93,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index f20a41b..f8c8e2d 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 470c5e0..648ffdf 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 88ddfea..651e6e2 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -371,10 +371,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index 308e4ff..545d628 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -228,6 +228,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -376,6 +384,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -573,6 +587,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -781,6 +801,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -851,6 +873,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -981,6 +1005,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f37e464..c52930d 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..288e1ff ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..0419139 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,168 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 10. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 640199c..c110a0e 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -282,6 +282,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 10247f9..4a0798f 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 8f77408..aa206ff 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 4b2d30a..47ff8f5 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.1.0 - -From e4114a4c52a1c7a9d67008a9f4e498e353641fa9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 17:08:38 +0200 -Subject: [PATCH 2/2] Haiku: regenerate configure. - ---- - configure | 48 ++++++++++++++------ - gcc/configure | 50 ++++++++++++++------ - libstdc++-v3/configure | 121 +++++++++++++++++++++++++++++++++++++++++-------- - 3 files changed, 171 insertions(+), 48 deletions(-) - -diff --git a/configure b/configure -index a3f66ba..fd08e27 100755 ---- a/configure -+++ b/configure -@@ -3026,6 +3026,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3440,6 +3443,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3627,6 +3633,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3680,6 +3689,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5331,24 +5343,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 0037240..d8d56d3 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -737,6 +737,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -778,6 +779,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -885,6 +887,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1690,6 +1693,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-native-system-header-dir=dir -@@ -7039,6 +7044,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9115,6 +9132,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11414,7 +11441,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15253,8 +15280,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17366,8 +17391,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -17884,7 +17910,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18162,7 +18188,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18165 "configure" -+#line 18191 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18268,7 +18294,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18271 "configure" -+#line 18297 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20082,7 +20108,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20104,8 +20129,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21026,8 +21049,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 90f2aa8..1c40c4b 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8657,8 +8657,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10779,8 +10777,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11300,7 +11299,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11593,7 +11592,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11596 "configure" -+#line 11595 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11699,7 +11698,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11702 "configure" -+#line 11701 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13519,7 +13518,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13541,8 +13539,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14463,8 +14459,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15119,7 +15116,7 @@ fi - # - # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. - cat > conftest.$ac_ext << EOF --#line 15122 "configure" -+#line 15119 "configure" - struct S { ~S(); }; - void bar(); - void foo() -@@ -15471,7 +15468,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15474 "configure" -+#line 15471 "configure" - int main() - { - typedef bool atomic_type; -@@ -15506,7 +15503,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15509 "configure" -+#line 15506 "configure" - int main() - { - typedef short atomic_type; -@@ -15541,7 +15538,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15544 "configure" -+#line 15541 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15577,7 +15574,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15580 "configure" -+#line 15577 "configure" - int main() - { - typedef long long atomic_type; -@@ -15656,7 +15653,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15659 "configure" -+#line 15656 "configure" - int main() - { - _Decimal32 d1; -@@ -15698,7 +15695,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15701 "configure" -+#line 15698 "configure" - template - struct same - { typedef T2 type; }; -@@ -15732,7 +15729,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15735 "configure" -+#line 15732 "configure" - template - struct same - { typedef T2 type; }; -@@ -52160,6 +52157,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.1.0 - diff --git a/sys-devel/gcc/patches/gcc-5.3.0_2016_02_29.patchset b/sys-devel/gcc/patches/gcc-5.3.0_2016_02_29.patchset deleted file mode 100644 index 4315373e0..000000000 --- a/sys-devel/gcc/patches/gcc-5.3.0_2016_02_29.patchset +++ /dev/null @@ -1,3290 +0,0 @@ -From 0fa93a7c7a5ec1f06682682beee56d1f9fb2da01 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: Haiku patch - - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 987dfab..127b6d4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -410,6 +410,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -787,6 +790,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -974,6 +980,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1027,6 +1036,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 07c6f0a..41c4edb 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -101,6 +101,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -1989,6 +1991,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2561,7 +2567,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - # For stage1 and when cross-compiling use the build libcpp which is - # built with NLS disabled. For stage2+ use the host library and -@@ -2623,6 +2629,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index c835734..b318811 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -688,6 +688,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1040,6 +1053,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1398,6 +1421,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1920,6 +1951,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2003,6 +2041,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2337,6 +2380,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index b0f5940..2db7555 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -99,7 +99,7 @@ case ${host} in - esac - - case ${host} in -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -125,9 +125,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..2aa4b2b ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,221 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..9ff36f1 ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,59 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index d414081..c5c854a 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -649,6 +649,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1079,6 +1088,16 @@ AC_LANG_POP(C++) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1534,7 +1553,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 1d54798..b4aba11 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -380,7 +380,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index afc1cc5..1d3ef09 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -93,7 +93,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index f20a41b..f8c8e2d 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 470c5e0..648ffdf 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 88ddfea..651e6e2 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -371,10 +371,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index 4329891..dc73f2a 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -228,6 +228,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -381,6 +389,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -578,6 +592,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -786,6 +806,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -856,6 +878,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -986,6 +1010,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f37e464..c52930d 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..288e1ff ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..0419139 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,168 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 10. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 640199c..c110a0e 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -282,6 +282,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 10247f9..4a0798f 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 8f77408..aa206ff 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 24d13f3..94d96d9 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.2.2 - - -From ad5faeb68d2e2bbb25816713f06ad694c97945f2 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 10 Dec 2015 22:07:03 +0000 -Subject: Haiku: regenerate configure. - - -diff --git a/configure b/configure -index a3f66ba..fd08e27 100755 ---- a/configure -+++ b/configure -@@ -3026,6 +3026,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3440,6 +3443,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3627,6 +3633,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3680,6 +3689,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5331,24 +5343,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 3c92795..08e3c66 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -737,6 +737,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -778,6 +779,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -885,6 +887,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1690,6 +1693,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-native-system-header-dir=dir -@@ -7039,6 +7044,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9115,6 +9132,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11414,7 +11441,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15253,8 +15280,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -16134,7 +16159,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -17366,8 +17391,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -17884,7 +17910,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18162,7 +18188,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18165 "configure" -+#line 18191 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18268,7 +18294,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18271 "configure" -+#line 18297 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20082,7 +20108,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20104,8 +20129,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -20620,7 +20643,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) -@@ -21026,8 +21049,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 8cd4c76..d12f460 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8662,8 +8662,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10784,8 +10782,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11305,7 +11304,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11598,7 +11597,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11601 "configure" -+#line 11600 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11704,7 +11703,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11707 "configure" -+#line 11706 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13524,7 +13523,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13546,8 +13544,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14468,8 +14464,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15124,7 +15121,7 @@ fi - # - # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. - cat > conftest.$ac_ext << EOF --#line 15127 "configure" -+#line 15124 "configure" - struct S { ~S(); }; - void bar(); - void foo() -@@ -15476,7 +15473,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15479 "configure" -+#line 15476 "configure" - int main() - { - typedef bool atomic_type; -@@ -15511,7 +15508,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15514 "configure" -+#line 15511 "configure" - int main() - { - typedef short atomic_type; -@@ -15546,7 +15543,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15549 "configure" -+#line 15546 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15582,7 +15579,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15585 "configure" -+#line 15582 "configure" - int main() - { - typedef long long atomic_type; -@@ -15661,7 +15658,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15664 "configure" -+#line 15661 "configure" - int main() - { - _Decimal32 d1; -@@ -15703,7 +15700,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15706 "configure" -+#line 15703 "configure" - template - struct same - { typedef T2 type; }; -@@ -15737,7 +15734,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15740 "configure" -+#line 15737 "configure" - template - struct same - { typedef T2 type; }; -@@ -52227,6 +52224,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.2.2 - - -From d116557f4a9c7273155973419f1e7781c907477b Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 12 Dec 2015 09:55:48 +0000 -Subject: config.host (i[34567]86-*-haiku* and x86_64-*-haiku*): - -Add to lists of i[34567]86-*-* and x86_64-*-* soft-fp targets. - -diff --git a/libgcc/config.host b/libgcc/config.host -index dc73f2a..32e3cd2 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -1356,7 +1356,8 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ - i[34567]86-*-mingw* | x86_64-*-mingw* | \ - i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ - i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ -- i[34567]86-*-openbsd* | x86_64-*-openbsd*) -+ i[34567]86-*-openbsd* | x86_64-*-openbsd* | \ -+ i[34567]86-*-haiku* | x86_64-*-haiku*) - tmake_file="${tmake_file} t-softfp-tf" - if test "${host_address}" = 32; then - tmake_file="${tmake_file} i386/${host_address}/t-softfp" --- -2.2.2 - - -From 7f76a6991e90ba5f99004aed70daceeb1daf9b2e Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Mon, 29 Feb 2016 22:17:31 +0000 -Subject: sync with buildtools repo - - -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -index 2aa4b2b..27bab0a 100644 ---- a/gcc/config/haiku.h -+++ b/gcc/config/haiku.h -@@ -46,7 +46,9 @@ Boston, MA 02111-1307, USA. */ - user explicitly asks for the warnings with -Wmultichar. Note that - CC1_SPEC is used for both cc1 and cc1plus. */ - #undef CC1_SPEC --#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+#define CC1_SPEC \ -+ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ -+ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" - - #undef CC1PLUS_SPEC - #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -@@ -208,9 +210,6 @@ Boston, MA 02111-1307, USA. */ - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" - #endif - --/* no JCR_SECTION_NAME default definition for Haiku */ --#define TARGET_NO_JCR_SECTION_NAME 1 -- - /* Do not use JCR_SECTION_NAME default definition for Haiku */ - #define TARGET_NO_JCR_SECTION_NAME 1 - -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -index 9ff36f1..4dff89e 100644 ---- a/gcc/config/rs6000/haiku.h -+++ b/gcc/config/rs6000/haiku.h -@@ -54,6 +54,3 @@ Boston, MA 02111-1307, USA. */ - - #undef LINK_SPEC - #define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -- --#undef CC1_SPEC --#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" --- -2.2.2 - - -From 137d5c5a29ce43da76ea3f281b34273df54389a6 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sun, 10 Apr 2016 12:27:58 +0000 -Subject: enable libatomic build on Haiku - - -diff --git a/libatomic/configure b/libatomic/configure -index 3623c09..89eb721 100755 ---- a/libatomic/configure -+++ b/libatomic/configure -@@ -8202,8 +8202,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -9083,7 +9081,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -10315,8 +10313,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10833,7 +10832,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11111,7 +11110,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11114 "configure" -+#line 11113 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11217,7 +11216,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11220 "configure" -+#line 11219 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -14526,7 +14525,6 @@ _ACEOF - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -14540,13 +14538,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ CFLAGS="$CFLAGS -pthread" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - XPCFLAGS=" -pthread" - else - CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -- void *g(void *d) { return NULL; } -+ void *g(void *d) { return NULL; } - int - main () - { -@@ -14565,6 +14579,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.ac b/libatomic/configure.ac -index d5e67c8..765a212 100644 ---- a/libatomic/configure.ac -+++ b/libatomic/configure.ac -@@ -199,21 +199,27 @@ LIBAT_WORDSIZE - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -pthread"], -- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( -- [AC_LANG_PROGRAM( -- [#include -- void *g(void *d) { return NULL; }], -- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [XPCFLAGS=" -pthread"], -+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index 3c1fedd..1d0a89d 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -112,7 +112,7 @@ case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- | *-*-darwin* | *-*-aix* | *-*-cygwin*) -+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) - # POSIX system. The OS is supported. - config_path="${config_path} posix" - ;; --- -2.2.2 - - -From 84206829f3b780bcadbb4fe423d848c9ce0cf9bf Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 3 Jun 2016 12:42:22 +0200 -Subject: enable libgomp build on Haiku - - -diff --git a/configure b/configure -index fd08e27..e28c3ef 100755 ---- a/configure -+++ b/configure -@@ -3172,7 +3172,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - *) - noconfigdirs="$noconfigdirs target-libgomp" -diff --git a/configure.ac b/configure.ac -index 127b6d4..ec2ec71 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - *) - noconfigdirs="$noconfigdirs target-libgomp" -diff --git a/libgomp/configure b/libgomp/configure -index 33b8cf1..23c6296 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8209,8 +8209,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10322,8 +10320,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10840,7 +10839,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11118,7 +11117,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11121 "configure" -+#line 11120 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11224,7 +11223,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11227 "configure" -+#line 11226 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12084,8 +12083,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_FC= - ;; - - hpux*) -@@ -13962,8 +13959,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15041,7 +15039,6 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15055,9 +15052,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -- XPCFLAGS=" -Wc,-pthread" -+ - else -- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15071,6 +15068,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ XPCFLAGS=" -Wc,-pthread" -+else -+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - - else - as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5 -@@ -15080,6 +15093,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - esac - - # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- -diff --git a/libgomp/configure.ac b/libgomp/configure.ac -index 51e646d..9b9b7d0 100644 ---- a/libgomp/configure.ac -+++ b/libgomp/configure.ac -@@ -182,21 +182,27 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -Wc,-pthread"], -- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) -+ [XPCFLAGS=" -Wc,-pthread"], -+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) - esac - - m4_include([plugin/configfrag.ac]) --- -2.2.2 - diff --git a/sys-devel/gcc/patches/gcc-5.4.0_2016_06_04.patchset b/sys-devel/gcc/patches/gcc-5.4.0_2016_06_04.patchset deleted file mode 100644 index 08f8891a4..000000000 --- a/sys-devel/gcc/patches/gcc-5.4.0_2016_06_04.patchset +++ /dev/null @@ -1,3272 +0,0 @@ -From 75deba03c33d2ac44981815615d530424c991099 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: Haiku patch - - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 987dfab..127b6d4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -410,6 +410,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -787,6 +790,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -974,6 +980,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1027,6 +1036,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 07c6f0a..41c4edb 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -101,6 +101,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -1989,6 +1991,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2561,7 +2567,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - # For stage1 and when cross-compiling use the build libcpp which is - # built with NLS disabled. For stage2+ use the host library and -@@ -2623,6 +2629,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index c835734..b318811 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -688,6 +688,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1040,6 +1053,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1398,6 +1421,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1920,6 +1951,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2003,6 +2041,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2337,6 +2380,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index b0f5940..2db7555 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -99,7 +99,7 @@ case ${host} in - esac - - case ${host} in -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -125,9 +125,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..2aa4b2b ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,221 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..9ff36f1 ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,59 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 0009d87..9c4b234 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -649,6 +649,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1079,6 +1088,16 @@ AC_LANG_POP(C++) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1534,7 +1553,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 1d54798..b4aba11 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -380,7 +380,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index afc1cc5..1d3ef09 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -93,7 +93,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index f20a41b..f8c8e2d 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 470c5e0..648ffdf 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 88ddfea..651e6e2 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -371,10 +371,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index b4b0665..fa4bb97 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -228,6 +228,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -381,6 +389,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -578,6 +592,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -786,6 +806,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -856,6 +878,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -981,6 +1005,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f37e464..c52930d 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..288e1ff ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..0419139 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,168 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 10. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 640199c..c110a0e 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -282,6 +282,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 10247f9..4a0798f 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 8f77408..aa206ff 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 24d13f3..94d96d9 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.2.2 - - -From 4ab9d09dec596a2788417ffb1444afd898bb99fd Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 10 Dec 2015 22:07:03 +0000 -Subject: Haiku: regenerate configure. - - -diff --git a/configure b/configure -index a3f66ba..fd08e27 100755 ---- a/configure -+++ b/configure -@@ -3026,6 +3026,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3440,6 +3443,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3627,6 +3633,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3680,6 +3689,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5331,24 +5343,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 90f78d2..e5b79ca 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -737,6 +737,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -778,6 +779,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -885,6 +887,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1690,6 +1693,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-native-system-header-dir=dir -@@ -7039,6 +7044,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9115,6 +9132,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11414,7 +11441,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15253,8 +15280,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17366,8 +17391,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -17884,7 +17910,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18162,7 +18188,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18165 "configure" -+#line 18191 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18268,7 +18294,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18271 "configure" -+#line 18297 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20082,7 +20108,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20104,8 +20129,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21026,8 +21049,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 8cd4c76..d12f460 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8662,8 +8662,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10784,8 +10782,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11305,7 +11304,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11598,7 +11597,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11601 "configure" -+#line 11600 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11704,7 +11703,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11707 "configure" -+#line 11706 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13524,7 +13523,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13546,8 +13544,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14468,8 +14464,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15124,7 +15121,7 @@ fi - # - # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. - cat > conftest.$ac_ext << EOF --#line 15127 "configure" -+#line 15124 "configure" - struct S { ~S(); }; - void bar(); - void foo() -@@ -15476,7 +15473,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15479 "configure" -+#line 15476 "configure" - int main() - { - typedef bool atomic_type; -@@ -15511,7 +15508,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15514 "configure" -+#line 15511 "configure" - int main() - { - typedef short atomic_type; -@@ -15546,7 +15543,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15549 "configure" -+#line 15546 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15582,7 +15579,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15585 "configure" -+#line 15582 "configure" - int main() - { - typedef long long atomic_type; -@@ -15661,7 +15658,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15664 "configure" -+#line 15661 "configure" - int main() - { - _Decimal32 d1; -@@ -15703,7 +15700,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15706 "configure" -+#line 15703 "configure" - template - struct same - { typedef T2 type; }; -@@ -15737,7 +15734,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15740 "configure" -+#line 15737 "configure" - template - struct same - { typedef T2 type; }; -@@ -52227,6 +52224,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.2.2 - - -From 7d111d97f9feb67a8aa3bc1836e2bd3c4579a8d4 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 12 Dec 2015 09:55:48 +0000 -Subject: config.host (i[34567]86-*-haiku* and x86_64-*-haiku*): - -Add to lists of i[34567]86-*-* and x86_64-*-* soft-fp targets. - -diff --git a/libgcc/config.host b/libgcc/config.host -index fa4bb97..2f98b4f 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -1351,7 +1351,8 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ - i[34567]86-*-mingw* | x86_64-*-mingw* | \ - i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ - i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ -- i[34567]86-*-openbsd* | x86_64-*-openbsd*) -+ i[34567]86-*-openbsd* | x86_64-*-openbsd* | \ -+ i[34567]86-*-haiku* | x86_64-*-haiku*) - tmake_file="${tmake_file} t-softfp-tf" - if test "${host_address}" = 32; then - tmake_file="${tmake_file} i386/${host_address}/t-softfp" --- -2.2.2 - - -From a56bfbf2f392ca7708a9b4b84e64e9fa6d5fb76d Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Mon, 29 Feb 2016 22:17:31 +0000 -Subject: sync with buildtools repo - - -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -index 2aa4b2b..27bab0a 100644 ---- a/gcc/config/haiku.h -+++ b/gcc/config/haiku.h -@@ -46,7 +46,9 @@ Boston, MA 02111-1307, USA. */ - user explicitly asks for the warnings with -Wmultichar. Note that - CC1_SPEC is used for both cc1 and cc1plus. */ - #undef CC1_SPEC --#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+#define CC1_SPEC \ -+ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ -+ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" - - #undef CC1PLUS_SPEC - #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -@@ -208,9 +210,6 @@ Boston, MA 02111-1307, USA. */ - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" - #endif - --/* no JCR_SECTION_NAME default definition for Haiku */ --#define TARGET_NO_JCR_SECTION_NAME 1 -- - /* Do not use JCR_SECTION_NAME default definition for Haiku */ - #define TARGET_NO_JCR_SECTION_NAME 1 - -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -index 9ff36f1..4dff89e 100644 ---- a/gcc/config/rs6000/haiku.h -+++ b/gcc/config/rs6000/haiku.h -@@ -54,6 +54,3 @@ Boston, MA 02111-1307, USA. */ - - #undef LINK_SPEC - #define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -- --#undef CC1_SPEC --#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" --- -2.2.2 - - -From 299142db055d10e2622c15d7a3855fd84936ad5b Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sun, 10 Apr 2016 12:27:58 +0000 -Subject: enable libatomic build on Haiku - - -diff --git a/libatomic/configure b/libatomic/configure -index 3623c09..89eb721 100755 ---- a/libatomic/configure -+++ b/libatomic/configure -@@ -8202,8 +8202,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -9083,7 +9081,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -10315,8 +10313,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10833,7 +10832,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11111,7 +11110,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11114 "configure" -+#line 11113 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11217,7 +11216,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11220 "configure" -+#line 11219 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -14526,7 +14525,6 @@ _ACEOF - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -14540,13 +14538,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ CFLAGS="$CFLAGS -pthread" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - XPCFLAGS=" -pthread" - else - CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -- void *g(void *d) { return NULL; } -+ void *g(void *d) { return NULL; } - int - main () - { -@@ -14565,6 +14579,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.ac b/libatomic/configure.ac -index d5e67c8..765a212 100644 ---- a/libatomic/configure.ac -+++ b/libatomic/configure.ac -@@ -199,21 +199,27 @@ LIBAT_WORDSIZE - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -pthread"], -- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( -- [AC_LANG_PROGRAM( -- [#include -- void *g(void *d) { return NULL; }], -- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [XPCFLAGS=" -pthread"], -+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index f516afa..50635ad 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -116,7 +116,7 @@ case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- | *-*-darwin* | *-*-aix* | *-*-cygwin*) -+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) - # POSIX system. The OS is supported. - config_path="${config_path} posix" - ;; --- -2.2.2 - - -From 20a18808a8e14b620039e3708f526898760f5738 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 3 Jun 2016 12:42:22 +0200 -Subject: enable libgomp build on Haiku - - -diff --git a/configure b/configure -index fd08e27..e28c3ef 100755 ---- a/configure -+++ b/configure -@@ -3172,7 +3172,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - *) - noconfigdirs="$noconfigdirs target-libgomp" -diff --git a/configure.ac b/configure.ac -index 127b6d4..ec2ec71 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -540,7 +540,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - *) - noconfigdirs="$noconfigdirs target-libgomp" -diff --git a/libgomp/configure b/libgomp/configure -index 33b8cf1..23c6296 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8209,8 +8209,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10322,8 +10320,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10840,7 +10839,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11118,7 +11117,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11121 "configure" -+#line 11120 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11224,7 +11223,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11227 "configure" -+#line 11226 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12084,8 +12083,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_FC= - ;; - - hpux*) -@@ -13962,8 +13959,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15041,7 +15039,6 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15055,9 +15052,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -- XPCFLAGS=" -Wc,-pthread" -+ - else -- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15071,6 +15068,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ XPCFLAGS=" -Wc,-pthread" -+else -+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - - else - as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5 -@@ -15080,6 +15093,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - esac - - # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- -diff --git a/libgomp/configure.ac b/libgomp/configure.ac -index 51e646d..9b9b7d0 100644 ---- a/libgomp/configure.ac -+++ b/libgomp/configure.ac -@@ -182,21 +182,27 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -Wc,-pthread"], -- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) -+ [XPCFLAGS=" -Wc,-pthread"], -+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) - esac - - m4_include([plugin/configfrag.ac]) --- -2.2.2 - diff --git a/sys-devel/gcc/patches/gcc-6.3.0_2017_05_12.patchset b/sys-devel/gcc/patches/gcc-6.3.0_2017_05_12.patchset deleted file mode 100644 index 79e33360e..000000000 --- a/sys-devel/gcc/patches/gcc-6.3.0_2017_05_12.patchset +++ /dev/null @@ -1,3237 +0,0 @@ -From 853d1b9976f024d83b210a71ca9b203ac2afdf41 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: Haiku patch - - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 74bf58a..465c9d5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -425,6 +425,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -551,7 +554,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -804,6 +807,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -994,6 +1000,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1055,6 +1064,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 13d0d1b..6523803 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -104,6 +104,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -2035,6 +2037,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2636,7 +2642,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o - build/gencfn-macros$(build_exeext) : build/hash-table.o build/ggc-none.o -@@ -2701,6 +2707,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 1d5b23f..622de09 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -710,6 +710,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1075,6 +1088,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1455,6 +1478,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1977,6 +2008,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2060,6 +2098,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2395,6 +2438,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index 44f2f56..d501a1b 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -107,7 +107,7 @@ case ${host} in - ;; - esac - ;; -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -133,9 +133,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..a0889cb ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,223 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ -+ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..4dff89e ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,56 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 4c65d44..efeab33 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -760,6 +760,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1136,6 +1145,16 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1592,7 +1611,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 3e18338..6fde0e3 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -395,7 +395,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index 6525152..3843ce3 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -94,7 +94,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index d711530..8daddcf 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 1161daa..4b9e676 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libatomic/configure.ac b/libatomic/configure.ac -index cf40ea1..3d35281 100644 ---- a/libatomic/configure.ac -+++ b/libatomic/configure.ac -@@ -199,21 +199,27 @@ LIBAT_WORDSIZE - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -pthread"], -- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( -- [AC_LANG_PROGRAM( -- [#include -- void *g(void *d) { return NULL; }], -- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [XPCFLAGS=" -pthread"], -+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index eab2765..d63f771 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -116,7 +116,7 @@ case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- | *-*-darwin* | *-*-aix* | *-*-cygwin*) -+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) - # POSIX system. The OS is supported. - config_path="${config_path} posix" - ;; -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index f09b39b..731e4d1 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -372,10 +372,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index 124f2ce..6504330 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -230,6 +230,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -386,6 +394,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -603,6 +617,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -811,6 +831,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -881,6 +903,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -1007,6 +1031,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -@@ -1377,7 +1403,8 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ - i[34567]86-*-mingw* | x86_64-*-mingw* | \ - i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ - i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ -- i[34567]86-*-openbsd* | x86_64-*-openbsd*) -+ i[34567]86-*-openbsd* | x86_64-*-openbsd* | \ -+ i[34567]86-*-haiku* | x86_64-*-haiku*) - tmake_file="${tmake_file} t-softfp-tf" - if test "${host_address}" = 32; then - tmake_file="${tmake_file} i386/${host_address}/t-softfp" -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f3343fc..24277cc 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libgomp/configure.ac b/libgomp/configure.ac -index 2e41ca8..831c20f 100644 ---- a/libgomp/configure.ac -+++ b/libgomp/configure.ac -@@ -185,21 +185,27 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -Wc,-pthread"], -- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) -+ [XPCFLAGS=" -Wc,-pthread"], -+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) - esac - - m4_include([plugin/configfrag.ac]) -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..e762aaa ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..5b5cc56 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,173 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+#if __cplusplus >= 201103L -+ case blank: -+ __testis = isblank(__c); -+ break; -+#endif -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 11. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 304a7f5..2efe674 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -274,6 +274,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index ece1256..a0b326e 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 2fc4390..8774565 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 24d13f3..94d96d9 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.12.2 - - -From ee443c3f30ca68955b7027794dc528d11129547b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sat, 7 Nov 2015 17:07:08 +0100 -Subject: Haiku: regenerate configure. - - -diff --git a/configure b/configure -index 35f231e..74772b1 100755 ---- a/configure -+++ b/configure -@@ -3052,6 +3052,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3194,7 +3197,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -3468,6 +3471,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3658,6 +3664,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3719,6 +3728,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5375,24 +5387,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 954673c..9ee8059 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -745,6 +745,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -781,6 +782,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -896,6 +898,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1708,6 +1711,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-specs=SPECS add SPECS to driver command-line processing -@@ -7408,6 +7413,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9401,6 +9418,16 @@ fi - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11701,7 +11728,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15551,8 +15578,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17664,8 +17689,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -18182,7 +18208,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18460,7 +18486,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18463 "configure" -+#line 18489 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18566,7 +18592,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18569 "configure" -+#line 18595 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20380,7 +20406,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20402,8 +20427,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21324,8 +21347,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libatomic/configure b/libatomic/configure -index 8526abf..9837361 100755 ---- a/libatomic/configure -+++ b/libatomic/configure -@@ -8202,8 +8202,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -9083,7 +9081,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -10315,8 +10313,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10833,7 +10832,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11111,7 +11110,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11114 "configure" -+#line 11113 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11217,7 +11216,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11220 "configure" -+#line 11219 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -14526,7 +14525,6 @@ _ACEOF - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -14540,13 +14538,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ CFLAGS="$CFLAGS -pthread" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - XPCFLAGS=" -pthread" - else - CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -- void *g(void *d) { return NULL; } -+ void *g(void *d) { return NULL; } - int - main () - { -@@ -14565,6 +14579,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libgomp/configure b/libgomp/configure -index 8d03eb6..2beee72 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8236,8 +8236,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10349,8 +10347,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10867,7 +10866,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11145,7 +11144,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11148 "configure" -+#line 11147 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11251,7 +11250,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11254 "configure" -+#line 11253 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12111,8 +12110,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_FC= - ;; - - hpux*) -@@ -13989,8 +13986,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15071,7 +15069,6 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15085,9 +15082,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -- XPCFLAGS=" -Wc,-pthread" -+ - else -- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15101,6 +15098,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ XPCFLAGS=" -Wc,-pthread" -+else -+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - - else - as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5 -@@ -15110,6 +15123,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - esac - - # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 19173eb..3f1bb5a 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8660,8 +8660,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10782,8 +10780,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11303,7 +11302,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11596,7 +11595,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11599 "configure" -+#line 11598 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11702,7 +11701,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11705 "configure" -+#line 11704 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13522,7 +13521,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13544,8 +13542,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14466,8 +14462,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15388,7 +15385,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15391 "configure" -+#line 15388 "configure" - int main() - { - typedef bool atomic_type; -@@ -15423,7 +15420,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15426 "configure" -+#line 15423 "configure" - int main() - { - typedef short atomic_type; -@@ -15458,7 +15455,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15461 "configure" -+#line 15458 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15494,7 +15491,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15497 "configure" -+#line 15494 "configure" - int main() - { - typedef long long atomic_type; -@@ -15575,7 +15572,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15578 "configure" -+#line 15575 "configure" - int main() - { - _Decimal32 d1; -@@ -15617,7 +15614,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15620 "configure" -+#line 15617 "configure" - template - struct same - { typedef T2 type; }; -@@ -15651,7 +15648,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15654 "configure" -+#line 15651 "configure" - template - struct same - { typedef T2 type; }; -@@ -53199,6 +53196,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.12.2 - - -From a6c11507274466409a2269c52aaada706c5faa4c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 16:32:32 +0200 -Subject: Haiku: disable -fno-PIE as this fails on x86_64. - - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 6523803..e0154f8 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -264,7 +264,7 @@ NO_PIE_CFLAGS = @NO_PIE_CFLAGS@ - NO_PIE_FLAG = @NO_PIE_FLAG@ - - # We don't want to compile the compilers with -fPIE, it make PCH fail. --COMPILER += $(NO_PIE_CFLAGS) -+#COMPILER += $(NO_PIE_CFLAGS) - - # Link with -no-pie since we compile the compiler with -fno-PIE. - LINKER += $(NO_PIE_FLAG) -@@ -764,9 +764,9 @@ NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ - NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ - BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE - BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE --BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ --BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) --BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ -+#BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) - - # Native compiler that we use. This may be C++ some day. - COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) --- -2.12.2 - - -From de5fae9c36583a0a7c95f1a69a529c577535e427 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 5 May 2016 09:03:06 +0000 -Subject: fix for libstdc++/69506 - - -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -index 4674f7b..02c8693 100644 ---- a/libstdc++-v3/config/os/haiku/os_defines.h -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -42,4 +42,7 @@ - #define _GLIBCXX_USE_CLOCK_REALTIME 1 - #endif - -+// See libstdc++/69506 -+#define _GLIBCXX_USE_WEAK_REF 0 -+ - #endif --- -2.12.2 - diff --git a/sys-devel/gcc/patches/gcc-6.4.0_2017_05_12.patchset b/sys-devel/gcc/patches/gcc-6.4.0_2017_05_12.patchset deleted file mode 100644 index 79e33360e..000000000 --- a/sys-devel/gcc/patches/gcc-6.4.0_2017_05_12.patchset +++ /dev/null @@ -1,3237 +0,0 @@ -From 853d1b9976f024d83b210a71ca9b203ac2afdf41 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: Haiku patch - - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 74bf58a..465c9d5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -425,6 +425,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -551,7 +554,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -804,6 +807,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -994,6 +1000,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1055,6 +1064,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 13d0d1b..6523803 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -104,6 +104,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -2035,6 +2037,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2636,7 +2642,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o - build/gencfn-macros$(build_exeext) : build/hash-table.o build/ggc-none.o -@@ -2701,6 +2707,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 1d5b23f..622de09 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -710,6 +710,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1075,6 +1088,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1455,6 +1478,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1977,6 +2008,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2060,6 +2098,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2395,6 +2438,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index 44f2f56..d501a1b 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -107,7 +107,7 @@ case ${host} in - ;; - esac - ;; -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -133,9 +133,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..a0889cb ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,223 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ -+ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..4dff89e ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,56 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 4c65d44..efeab33 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -760,6 +760,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1136,6 +1145,16 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1592,7 +1611,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 3e18338..6fde0e3 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -395,7 +395,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index 6525152..3843ce3 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -94,7 +94,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index d711530..8daddcf 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 1161daa..4b9e676 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libatomic/configure.ac b/libatomic/configure.ac -index cf40ea1..3d35281 100644 ---- a/libatomic/configure.ac -+++ b/libatomic/configure.ac -@@ -199,21 +199,27 @@ LIBAT_WORDSIZE - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -pthread"], -- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( -- [AC_LANG_PROGRAM( -- [#include -- void *g(void *d) { return NULL; }], -- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [XPCFLAGS=" -pthread"], -+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index eab2765..d63f771 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -116,7 +116,7 @@ case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- | *-*-darwin* | *-*-aix* | *-*-cygwin*) -+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) - # POSIX system. The OS is supported. - config_path="${config_path} posix" - ;; -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index f09b39b..731e4d1 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -372,10 +372,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index 124f2ce..6504330 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -230,6 +230,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -386,6 +394,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -603,6 +617,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -811,6 +831,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -881,6 +903,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -1007,6 +1031,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -@@ -1377,7 +1403,8 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ - i[34567]86-*-mingw* | x86_64-*-mingw* | \ - i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ - i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ -- i[34567]86-*-openbsd* | x86_64-*-openbsd*) -+ i[34567]86-*-openbsd* | x86_64-*-openbsd* | \ -+ i[34567]86-*-haiku* | x86_64-*-haiku*) - tmake_file="${tmake_file} t-softfp-tf" - if test "${host_address}" = 32; then - tmake_file="${tmake_file} i386/${host_address}/t-softfp" -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f3343fc..24277cc 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libgomp/configure.ac b/libgomp/configure.ac -index 2e41ca8..831c20f 100644 ---- a/libgomp/configure.ac -+++ b/libgomp/configure.ac -@@ -185,21 +185,27 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -Wc,-pthread"], -- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) -+ [XPCFLAGS=" -Wc,-pthread"], -+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) - esac - - m4_include([plugin/configfrag.ac]) -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..e762aaa ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..5b5cc56 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,173 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+#if __cplusplus >= 201103L -+ case blank: -+ __testis = isblank(__c); -+ break; -+#endif -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 11. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 304a7f5..2efe674 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -274,6 +274,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index ece1256..a0b326e 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 2fc4390..8774565 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 24d13f3..94d96d9 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.12.2 - - -From ee443c3f30ca68955b7027794dc528d11129547b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sat, 7 Nov 2015 17:07:08 +0100 -Subject: Haiku: regenerate configure. - - -diff --git a/configure b/configure -index 35f231e..74772b1 100755 ---- a/configure -+++ b/configure -@@ -3052,6 +3052,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3194,7 +3197,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -3468,6 +3471,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3658,6 +3664,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3719,6 +3728,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5375,24 +5387,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 954673c..9ee8059 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -745,6 +745,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -781,6 +782,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -896,6 +898,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1708,6 +1711,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-specs=SPECS add SPECS to driver command-line processing -@@ -7408,6 +7413,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9401,6 +9418,16 @@ fi - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11701,7 +11728,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15551,8 +15578,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17664,8 +17689,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -18182,7 +18208,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18460,7 +18486,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18463 "configure" -+#line 18489 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18566,7 +18592,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18569 "configure" -+#line 18595 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20380,7 +20406,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20402,8 +20427,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21324,8 +21347,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libatomic/configure b/libatomic/configure -index 8526abf..9837361 100755 ---- a/libatomic/configure -+++ b/libatomic/configure -@@ -8202,8 +8202,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -9083,7 +9081,7 @@ _LT_EOF - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else -- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' -+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - -@@ -10315,8 +10313,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10833,7 +10832,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11111,7 +11110,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11114 "configure" -+#line 11113 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11217,7 +11216,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11220 "configure" -+#line 11219 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -14526,7 +14525,6 @@ _ACEOF - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -14540,13 +14538,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ CFLAGS="$CFLAGS -pthread" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - XPCFLAGS=" -pthread" - else - CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -- void *g(void *d) { return NULL; } -+ void *g(void *d) { return NULL; } - int - main () - { -@@ -14565,6 +14579,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libgomp/configure b/libgomp/configure -index 8d03eb6..2beee72 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8236,8 +8236,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10349,8 +10347,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10867,7 +10866,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11145,7 +11144,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11148 "configure" -+#line 11147 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11251,7 +11250,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11254 "configure" -+#line 11253 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12111,8 +12110,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_FC= - ;; - - hpux*) -@@ -13989,8 +13986,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15071,7 +15069,6 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15085,9 +15082,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -- XPCFLAGS=" -Wc,-pthread" -+ - else -- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15101,6 +15098,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ XPCFLAGS=" -Wc,-pthread" -+else -+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - - else - as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5 -@@ -15110,6 +15123,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - esac - - # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 19173eb..3f1bb5a 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8660,8 +8660,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10782,8 +10780,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11303,7 +11302,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11596,7 +11595,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11599 "configure" -+#line 11598 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11702,7 +11701,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11705 "configure" -+#line 11704 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13522,7 +13521,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13544,8 +13542,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14466,8 +14462,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15388,7 +15385,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15391 "configure" -+#line 15388 "configure" - int main() - { - typedef bool atomic_type; -@@ -15423,7 +15420,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15426 "configure" -+#line 15423 "configure" - int main() - { - typedef short atomic_type; -@@ -15458,7 +15455,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15461 "configure" -+#line 15458 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15494,7 +15491,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15497 "configure" -+#line 15494 "configure" - int main() - { - typedef long long atomic_type; -@@ -15575,7 +15572,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15578 "configure" -+#line 15575 "configure" - int main() - { - _Decimal32 d1; -@@ -15617,7 +15614,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15620 "configure" -+#line 15617 "configure" - template - struct same - { typedef T2 type; }; -@@ -15651,7 +15648,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15654 "configure" -+#line 15651 "configure" - template - struct same - { typedef T2 type; }; -@@ -53199,6 +53196,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.12.2 - - -From a6c11507274466409a2269c52aaada706c5faa4c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 16:32:32 +0200 -Subject: Haiku: disable -fno-PIE as this fails on x86_64. - - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 6523803..e0154f8 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -264,7 +264,7 @@ NO_PIE_CFLAGS = @NO_PIE_CFLAGS@ - NO_PIE_FLAG = @NO_PIE_FLAG@ - - # We don't want to compile the compilers with -fPIE, it make PCH fail. --COMPILER += $(NO_PIE_CFLAGS) -+#COMPILER += $(NO_PIE_CFLAGS) - - # Link with -no-pie since we compile the compiler with -fno-PIE. - LINKER += $(NO_PIE_FLAG) -@@ -764,9 +764,9 @@ NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ - NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ - BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE - BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE --BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ --BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) --BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ -+#BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) - - # Native compiler that we use. This may be C++ some day. - COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) --- -2.12.2 - - -From de5fae9c36583a0a7c95f1a69a529c577535e427 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 5 May 2016 09:03:06 +0000 -Subject: fix for libstdc++/69506 - - -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -index 4674f7b..02c8693 100644 ---- a/libstdc++-v3/config/os/haiku/os_defines.h -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -42,4 +42,7 @@ - #define _GLIBCXX_USE_CLOCK_REALTIME 1 - #endif - -+// See libstdc++/69506 -+#define _GLIBCXX_USE_WEAK_REF 0 -+ - #endif --- -2.12.2 - diff --git a/sys-devel/gcc/patches/gcc-7.1.0_2017_05_12.patchset b/sys-devel/gcc/patches/gcc-7.1.0_2017_05_12.patchset deleted file mode 100644 index 2b771490d..000000000 --- a/sys-devel/gcc/patches/gcc-7.1.0_2017_05_12.patchset +++ /dev/null @@ -1,3259 +0,0 @@ -From 45b750bafb91b055cc5284ef5d5780e6a1194af9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: Haiku patch - - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index aa1d34b..6eb6480 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -428,24 +428,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 1237749..cd4182c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -420,6 +420,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -511,7 +514,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -726,6 +729,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs target-libffi" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs target-libffi" - ;; -@@ -910,6 +916,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -971,6 +980,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 74d1912..61bf974 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -105,6 +105,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -2126,6 +2128,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) -DBASEVER=$(BASEVER_s) - gcc.o: $(BASEVER) - -@@ -2735,7 +2741,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o - build/gencfn-macros$(build_exeext) : build/hash-table.o build/ggc-none.o -@@ -2800,6 +2806,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index b8bb4d6..d96ca20 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -716,6 +716,19 @@ case ${target} in - *-*-fuchsia*) - native_system_header_dir=/include - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1092,6 +1105,16 @@ arm*-*-netbsdelf*) - tmake_file="${tmake_file} arm/t-arm" - target_cpu_cname="arm6" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1471,6 +1494,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1966,6 +1997,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2070,6 +2108,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2409,6 +2452,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index 6b28f30..72ebc4f 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -107,7 +107,7 @@ case ${host} in - ;; - esac - ;; -- arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*) -+ arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia* | arm*-*-haiku*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -133,9 +133,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..8e9f101 ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,214 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ -+ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..4dff89e ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,56 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 9d4c792..f1b248f 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -771,6 +771,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1155,6 +1164,16 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1611,7 +1630,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index aa248be..57a3ab0 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -94,7 +94,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index 872f451..3522e12 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 5a2a055..ca8dd20 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libatomic/configure.ac b/libatomic/configure.ac -index 023f172..1814d0c 100644 ---- a/libatomic/configure.ac -+++ b/libatomic/configure.ac -@@ -199,21 +199,27 @@ LIBAT_WORDSIZE - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -pthread"], -- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( -- [AC_LANG_PROGRAM( -- [#include -- void *g(void *d) { return NULL; }], -- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [XPCFLAGS=" -pthread"], -+ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index b8af3ab..93b3d4e 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -117,7 +117,7 @@ case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ - | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ - | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ -- | *-*-darwin* | *-*-aix* | *-*-cygwin*) -+ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) - # POSIX system. The OS is supported. - config_path="${config_path} posix" - ;; -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index a1a392d..3fea2da 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -394,10 +394,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index b279a64..55b7e35 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -231,6 +231,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -397,6 +405,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -604,6 +618,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - tmake_file="${tmake_file} i386/t-crtstuff" - ;; -@@ -812,6 +832,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -882,6 +904,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -1008,6 +1032,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index 52ed6d3..a0a25c2 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libgomp/configure.ac b/libgomp/configure.ac -index a42d4f0..17bc715 100644 ---- a/libgomp/configure.ac -+++ b/libgomp/configure.ac -@@ -188,21 +188,27 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [XPCFLAGS=" -Wc,-pthread"], -- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ [], -+ [CFLAGS="$CFLAGS -pthread" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -- [], -- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) -+ [XPCFLAGS=" -Wc,-pthread"], -+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include -+ void *g(void *d) { return NULL; }], -+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], -+ [], -+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) - esac - - if test x$libgomp_use_pthreads != xno; then -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..e762aaa ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..5b5cc56 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,173 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+#if __cplusplus >= 201103L -+ case blank: -+ __testis = isblank(__c); -+ break; -+#endif -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 11. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index caea9de..00b70da 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -270,6 +270,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 77c9828..f989e01 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -140,6 +140,46 @@ case "${host}" in - AC_SUBST(SECTION_FLAGS) - ;; - -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 04d101f..f765d9a 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 24d13f3..94d96d9 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.12.2 - - -From 229e1dff7683fd9f670de5eeb303b5e7e059282b Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 12 May 2017 23:49:00 +0200 -Subject: Haiku: regenerate configure. - - -diff --git a/configure b/configure -index 32a3863..4ff544f 100755 ---- a/configure -+++ b/configure -@@ -3054,6 +3054,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3159,7 +3162,7 @@ if test x$enable_libgomp = x ; then - ;; - *-*-solaris2* | *-*-hpux11*) - ;; -- *-*-darwin* | *-*-aix*) -+ *-*-darwin* | *-*-aix* | *-*-haiku*) - ;; - nvptx*-*-*) - ;; -@@ -3398,6 +3401,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs target-libffi" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs target-libffi" - ;; -@@ -3582,6 +3588,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3643,6 +3652,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5295,24 +5307,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index ea73b15..1299e85 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -747,6 +747,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -783,6 +784,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -899,6 +901,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1714,6 +1717,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-specs=SPECS add SPECS to driver command-line processing -@@ -7373,6 +7378,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9380,6 +9397,16 @@ fi - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11680,7 +11707,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15524,8 +15551,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17637,8 +17662,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -18155,7 +18181,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18433,7 +18459,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18436 "configure" -+#line 18462 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18539,7 +18565,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18542 "configure" -+#line 18568 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20353,7 +20379,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20375,8 +20400,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21297,8 +21320,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libatomic/configure b/libatomic/configure -index c05fc9d..c86a824 100755 ---- a/libatomic/configure -+++ b/libatomic/configure -@@ -8206,8 +8206,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10319,8 +10317,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10837,7 +10836,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11115,7 +11114,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11118 "configure" -+#line 11117 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11221,7 +11220,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11224 "configure" -+#line 11223 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12333,6 +12332,7 @@ _ACEOF - - - -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_load/store for size 2" >&5 - $as_echo_n "checking for __atomic_load/store for size 2... " >&6; } - if test "${libat_cv_have_at_ldst_2+set}" = set; then : -@@ -12400,6 +12400,7 @@ _ACEOF - - - -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_load/store for size 4" >&5 - $as_echo_n "checking for __atomic_load/store for size 4... " >&6; } - if test "${libat_cv_have_at_ldst_4+set}" = set; then : -@@ -12467,6 +12468,7 @@ _ACEOF - - - -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_load/store for size 8" >&5 - $as_echo_n "checking for __atomic_load/store for size 8... " >&6; } - if test "${libat_cv_have_at_ldst_8+set}" = set; then : -@@ -12534,6 +12536,7 @@ _ACEOF - - - -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_load/store for size 16" >&5 - $as_echo_n "checking for __atomic_load/store for size 16... " >&6; } - if test "${libat_cv_have_at_ldst_16+set}" = set; then : -@@ -12602,6 +12605,7 @@ _ACEOF - - - -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __atomic_test_and_set for size 1" >&5 - $as_echo_n "checking for __atomic_test_and_set for size 1... " >&6; } - if test "${libat_cv_have_at_tas_1+set}" = set; then : -@@ -14530,7 +14534,6 @@ _ACEOF - case " $config_path " in - *" posix "*) - XPCFLAGS="" -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -14544,13 +14547,29 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ CFLAGS="$CFLAGS -pthread" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - XPCFLAGS=" -pthread" - else - CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -- void *g(void *d) { return NULL; } -+ void *g(void *d) { return NULL; } - int - main () - { -@@ -14569,6 +14588,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS $XPCFLAGS" - ;; - esac -diff --git a/libgomp/configure b/libgomp/configure -index b7e9f40..0a7fdb7 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8246,8 +8246,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10359,8 +10357,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -10877,7 +10876,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11155,7 +11154,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11158 "configure" -+#line 11157 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11261,7 +11260,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11264 "configure" -+#line 11263 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12121,8 +12120,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_FC= - ;; - - hpux*) -@@ -13999,8 +13996,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15084,7 +15082,6 @@ case "$host" in - *) - # Check to see if -pthread or -lpthread is needed. Prefer the former. - # In case the pthread.h system header is not found, this test will fail. -- CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15098,9 +15095,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -- XPCFLAGS=" -Wc,-pthread" -+ - else -- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include -@@ -15114,6 +15111,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -+ XPCFLAGS=" -Wc,-pthread" -+else -+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ void *g(void *d) { return NULL; } -+int -+main () -+{ -+pthread_t t; pthread_create(&t,NULL,g,NULL); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : - - else - as_fn_error "Pthreads are required to build libgomp" "$LINENO" 5 -@@ -15123,6 +15136,9 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext - esac - - if test x$libgomp_use_pthreads != xno; then -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 2406cb9..363196f 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8665,8 +8665,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10787,8 +10785,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11308,7 +11307,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11601,7 +11600,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11604 "configure" -+#line 11603 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11707,7 +11706,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11710 "configure" -+#line 11709 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13527,7 +13526,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13549,8 +13547,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14471,8 +14467,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15393,7 +15390,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15396 "configure" -+#line 15393 "configure" - int main() - { - typedef bool atomic_type; -@@ -15428,7 +15425,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15431 "configure" -+#line 15428 "configure" - int main() - { - typedef short atomic_type; -@@ -15463,7 +15460,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15466 "configure" -+#line 15463 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15499,7 +15496,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15502 "configure" -+#line 15499 "configure" - int main() - { - typedef long long atomic_type; -@@ -15580,7 +15577,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15583 "configure" -+#line 15580 "configure" - int main() - { - _Decimal32 d1; -@@ -15622,7 +15619,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15625 "configure" -+#line 15622 "configure" - template - struct same - { typedef T2 type; }; -@@ -15656,7 +15653,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15659 "configure" -+#line 15656 "configure" - template - struct same - { typedef T2 type; }; -@@ -53334,6 +53331,89 @@ done - - ;; - -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.12.2 - - -From 0b9acc512c979693434aa81df5097cdb1076dafc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 16:32:32 +0200 -Subject: Haiku: disable -fno-PIE as this fails on x86_64. - - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 61bf974..82c561d 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -265,7 +265,7 @@ NO_PIE_CFLAGS = @NO_PIE_CFLAGS@ - NO_PIE_FLAG = @NO_PIE_FLAG@ - - # We don't want to compile the compilers with -fPIE, it make PCH fail. --COMPILER += $(NO_PIE_CFLAGS) -+#COMPILER += $(NO_PIE_CFLAGS) - - # Link with -no-pie since we compile the compiler with -fno-PIE. - LINKER += $(NO_PIE_FLAG) -@@ -776,9 +776,9 @@ NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ - NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ - BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE - BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE --BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ --BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) --BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ -+#BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) - - # Native compiler that we use. This may be C++ some day. - COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) --- -2.12.2 - - -From d226e420dfda57ab533c62bf2ab97e50ef0635f2 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 5 May 2016 09:03:06 +0000 -Subject: fix for libstdc++/69506 - - -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -index 4674f7b..02c8693 100644 ---- a/libstdc++-v3/config/os/haiku/os_defines.h -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -42,4 +42,7 @@ - #define _GLIBCXX_USE_CLOCK_REALTIME 1 - #endif - -+// See libstdc++/69506 -+#define _GLIBCXX_USE_WEAK_REF 0 -+ - #endif --- -2.12.2 - - -From a635fecdf48ab04995adc10078407a18abc8eec7 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Thu, 5 May 2016 15:52:08 +0000 -Subject: rename x86_elf_aligned_common. - - -diff --git a/gcc/config/i386/haiku64.h b/gcc/config/i386/haiku64.h -index 76ba48e..e2fa55a 100644 ---- a/gcc/config/i386/haiku64.h -+++ b/gcc/config/i386/haiku64.h -@@ -112,9 +112,9 @@ Boston, MA 02111-1307, USA. */ - #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ - %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" - --#undef ASM_OUTPUT_ALIGNED_COMMON --#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -- x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+#undef ASM_OUTPUT_ALIGNED_DECL_COMMON -+#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN); - - - /* i386 System V Release 4 uses DWARF debugging info. --- -2.12.2 - diff --git a/sys-devel/gcc/patches/gcc49-4.9.3_2015_07_31.patchset b/sys-devel/gcc/patches/gcc49-4.9.3_2015_07_31.patchset deleted file mode 100644 index af571e0ad..000000000 --- a/sys-devel/gcc/patches/gcc49-4.9.3_2015_07_31.patchset +++ /dev/null @@ -1,2895 +0,0 @@ -From 7a2355496697b9ba1c01c6cd502d01f2d575fb72 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sat, 1 Aug 2015 10:17:02 +0200 -Subject: [PATCH 1/2] Haiku patch - ---- - compile | 0 - config.rpath | 2 + - config/acx.m4 | 36 +-- - configure.ac | 12 + - gcc/Makefile.in | 12 +- - gcc/config.gcc | 48 ++++ - gcc/config.host | 8 +- - gcc/config/arm/haiku.h | 80 ++++++ - gcc/config/arm/t-haiku | 21 ++ - gcc/config/haiku-stdint.h | 55 +++++ - gcc/config/haiku.h | 221 +++++++++++++++++ - gcc/config/i386/haiku.h | 77 ++++++ - gcc/config/i386/haiku64.h | 135 +++++++++++ - gcc/config/i386/host-cygwin.c | 0 - gcc/config/i386/t-haiku64 | 16 ++ - gcc/config/i386/winnt-cxx.c | 0 - gcc/config/i386/winnt-stubs.c | 0 - gcc/config/m68k/haiku.h | 268 +++++++++++++++++++++ - gcc/config/mips/haiku.h | 44 ++++ - gcc/config/rs6000/haiku.h | 59 +++++ - gcc/config/t-haiku | 4 + - gcc/configure.ac | 21 +- - gcc/defaults.h | 3 +- - gcc/ginclude/stdarg.h | 2 +- - gcc/ginclude/stddef.h | 10 +- - include/filenames.h | 2 + - libgcc/Makefile.in | 6 + - libgcc/config.host | 26 ++ - libgcc/config/i386/t-cygming | 0 - libgcc/config/t-haiku | 3 + - libgcc/crtstuff.c | 2 + - libstdc++-v3/config/os/haiku/ctype_base.h | 61 +++++ - .../config/os/haiku/ctype_configure_char.cc | 99 ++++++++ - libstdc++-v3/config/os/haiku/ctype_inline.h | 168 +++++++++++++ - libstdc++-v3/config/os/haiku/error_constants.h | 178 ++++++++++++++ - libstdc++-v3/config/os/haiku/os_defines.h | 45 ++++ - libstdc++-v3/configure.host | 3 + - libstdc++-v3/crossconfig.m4 | 41 ++++ - libstdc++-v3/libsupc++/tinfo.cc | 9 + - libtool.m4 | 14 +- - 40 files changed, 1755 insertions(+), 36 deletions(-) - mode change 100755 => 100644 compile - create mode 100644 gcc/config/arm/haiku.h - create mode 100644 gcc/config/arm/t-haiku - create mode 100644 gcc/config/haiku-stdint.h - create mode 100644 gcc/config/haiku.h - create mode 100644 gcc/config/i386/haiku.h - create mode 100644 gcc/config/i386/haiku64.h - mode change 100644 => 100755 gcc/config/i386/host-cygwin.c - create mode 100644 gcc/config/i386/t-haiku64 - mode change 100644 => 100755 gcc/config/i386/winnt-cxx.c - mode change 100644 => 100755 gcc/config/i386/winnt-stubs.c - create mode 100644 gcc/config/m68k/haiku.h - create mode 100644 gcc/config/mips/haiku.h - create mode 100644 gcc/config/rs6000/haiku.h - create mode 100644 gcc/config/t-haiku - mode change 100644 => 100755 libgcc/config/i386/t-cygming - create mode 100644 libgcc/config/t-haiku - create mode 100644 libstdc++-v3/config/os/haiku/ctype_base.h - create mode 100644 libstdc++-v3/config/os/haiku/ctype_configure_char.cc - create mode 100644 libstdc++-v3/config/os/haiku/ctype_inline.h - create mode 100644 libstdc++-v3/config/os/haiku/error_constants.h - create mode 100644 libstdc++-v3/config/os/haiku/os_defines.h - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 41a30dd..209a340 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -392,6 +392,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -692,6 +695,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -868,6 +874,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -921,6 +930,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index b47733c..9336856 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -96,6 +96,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -1942,6 +1944,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2494,7 +2500,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - # These programs are not linked with the MD reader. - build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \ -@@ -2542,6 +2548,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 7ade8e5..8c7727a 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -687,6 +687,19 @@ case ${target} in - # need_64bit_hwint=yes # system compiler has this for all arch! - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1018,6 +1031,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1363,6 +1386,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1887,6 +1918,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -1983,6 +2021,11 @@ mips64*-*-linux* | mipsisa64*-*-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h" - extra_options="${extra_options} linux-android.opt" -@@ -2265,6 +2308,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index bea17bc..caa4be4 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -99,7 +99,7 @@ case ${host} in - esac - - case ${host} in -- arm*-*-linux*) -+ arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -125,9 +125,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..2aa4b2b ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,221 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..9ff36f1 ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,59 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index 8488c2d..faf0b02 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -596,6 +596,15 @@ AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats, - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -988,6 +997,16 @@ AC_LANG_POP(C++) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1442,7 +1461,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index f94ae17..d958d17 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -380,7 +380,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index 1d4418b..309269a 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -93,7 +93,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index cfa8df3..da9d382 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -164,7 +164,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -181,7 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -210,7 +210,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -243,7 +243,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -260,7 +260,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index e799a51..aba6ec3 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index e86e98d..d1e01b9 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -368,10 +368,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index f4a7428..74292a8 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -226,6 +226,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -364,6 +372,12 @@ arm-wrs-vxworks) - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -551,6 +565,12 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -742,6 +762,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -812,6 +834,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa64-*-elf* | mipsisa64el-*-elf* | \ -@@ -944,6 +968,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index 12bed4b..4d7bada 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -102,7 +102,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..288e1ff ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..0419139 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,168 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 10. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index 1328ccc..68047b9 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -274,6 +274,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 15d876e..43d4f4e 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 53ed88d..0bb38f9 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 797468f..daf6268 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.1.0 - -From f5f581ca6188b4161f7f7225a97447e1596353b0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sat, 1 Aug 2015 10:17:52 +0200 -Subject: [PATCH 2/2] Haiku: regenerate configure. - ---- - configure | 48 ++++++++++++++------ - gcc/configure | 50 ++++++++++++++------ - libstdc++-v3/configure | 121 +++++++++++++++++++++++++++++++++++++++++-------- - 3 files changed, 171 insertions(+), 48 deletions(-) - -diff --git a/configure b/configure -index d9304d9..a1d8149 100755 ---- a/configure -+++ b/configure -@@ -3035,6 +3035,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3364,6 +3367,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3540,6 +3546,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3593,6 +3602,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5230,24 +5242,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index df63aa5..b9baa46 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -739,6 +739,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -776,6 +777,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -882,6 +884,7 @@ enable_werror_always - enable_checking - enable_coverage - enable_gather_detailed_mem_stats -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1686,6 +1689,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-native-system-header-dir=dir -@@ -6917,6 +6922,18 @@ _ACEOF - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -8914,6 +8931,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11213,7 +11240,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15036,8 +15063,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17149,8 +17174,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -17667,7 +17693,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -17945,7 +17971,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 17948 "configure" -+#line 17974 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18051,7 +18077,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18054 "configure" -+#line 18080 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -19865,7 +19891,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -19887,8 +19912,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -20809,8 +20832,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index 16e09f0..5856e4a 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8590,8 +8590,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10712,8 +10710,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11233,7 +11232,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11526,7 +11525,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11529 "configure" -+#line 11528 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11632,7 +11631,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11635 "configure" -+#line 11634 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13452,7 +13451,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13474,8 +13472,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14396,8 +14392,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15052,7 +15049,7 @@ fi - # - # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. - cat > conftest.$ac_ext << EOF --#line 15055 "configure" -+#line 15052 "configure" - struct S { ~S(); }; - void bar(); - void foo() -@@ -15404,7 +15401,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15407 "configure" -+#line 15404 "configure" - int main() - { - typedef bool atomic_type; -@@ -15439,7 +15436,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15442 "configure" -+#line 15439 "configure" - int main() - { - typedef short atomic_type; -@@ -15474,7 +15471,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15477 "configure" -+#line 15474 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15510,7 +15507,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15513 "configure" -+#line 15510 "configure" - int main() - { - typedef long long atomic_type; -@@ -15589,7 +15586,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15592 "configure" -+#line 15589 "configure" - int main() - { - _Decimal32 d1; -@@ -15631,7 +15628,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15634 "configure" -+#line 15631 "configure" - template - struct same - { typedef T2 type; }; -@@ -15665,7 +15662,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15668 "configure" -+#line 15665 "configure" - template - struct same - { typedef T2 type; }; -@@ -52050,6 +52047,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.1.0 - diff --git a/sys-devel/gcc/patches/gcc6-6.0.0_2015_07_17.patchset b/sys-devel/gcc/patches/gcc6-6.0.0_2015_07_17.patchset deleted file mode 100644 index 9ce60cb07..000000000 --- a/sys-devel/gcc/patches/gcc6-6.0.0_2015_07_17.patchset +++ /dev/null @@ -1,2927 +0,0 @@ -From 5db4a7874f59be390ff30ddd0d44cb606ef36b71 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Sun, 19 Jul 2015 18:55:34 +0200 -Subject: [PATCH 1/3] Haiku patch - ---- - compile | 0 - config.rpath | 2 + - config/acx.m4 | 36 +-- - configure.ac | 12 + - gcc/Makefile.in | 12 +- - gcc/config.gcc | 48 ++++ - gcc/config.host | 8 +- - gcc/config/arm/haiku.h | 80 ++++++ - gcc/config/arm/t-haiku | 21 ++ - gcc/config/haiku-stdint.h | 55 +++++ - gcc/config/haiku.h | 221 +++++++++++++++++ - gcc/config/i386/haiku.h | 77 ++++++ - gcc/config/i386/haiku64.h | 135 +++++++++++ - gcc/config/i386/host-cygwin.c | 0 - gcc/config/i386/t-haiku64 | 16 ++ - gcc/config/i386/winnt-cxx.c | 0 - gcc/config/i386/winnt-stubs.c | 0 - gcc/config/m68k/haiku.h | 268 +++++++++++++++++++++ - gcc/config/mips/haiku.h | 44 ++++ - gcc/config/rs6000/haiku.h | 59 +++++ - gcc/config/t-haiku | 4 + - gcc/configure.ac | 21 +- - gcc/defaults.h | 3 +- - gcc/ginclude/stdarg.h | 2 +- - gcc/ginclude/stddef.h | 10 +- - include/filenames.h | 2 + - libgcc/Makefile.in | 6 + - libgcc/config.host | 26 ++ - libgcc/config/i386/t-cygming | 0 - libgcc/config/t-haiku | 3 + - libgcc/crtstuff.c | 2 + - libstdc++-v3/config/os/haiku/ctype_base.h | 61 +++++ - .../config/os/haiku/ctype_configure_char.cc | 99 ++++++++ - libstdc++-v3/config/os/haiku/ctype_inline.h | 173 +++++++++++++ - libstdc++-v3/config/os/haiku/error_constants.h | 178 ++++++++++++++ - libstdc++-v3/config/os/haiku/os_defines.h | 45 ++++ - libstdc++-v3/configure.host | 3 + - libstdc++-v3/crossconfig.m4 | 41 ++++ - libstdc++-v3/libsupc++/tinfo.cc | 9 + - libtool.m4 | 14 +- - 40 files changed, 1760 insertions(+), 36 deletions(-) - mode change 100755 => 100644 compile - create mode 100644 gcc/config/arm/haiku.h - create mode 100644 gcc/config/arm/t-haiku - create mode 100644 gcc/config/haiku-stdint.h - create mode 100644 gcc/config/haiku.h - create mode 100644 gcc/config/i386/haiku.h - create mode 100644 gcc/config/i386/haiku64.h - mode change 100644 => 100755 gcc/config/i386/host-cygwin.c - create mode 100644 gcc/config/i386/t-haiku64 - mode change 100644 => 100755 gcc/config/i386/winnt-cxx.c - mode change 100644 => 100755 gcc/config/i386/winnt-stubs.c - create mode 100644 gcc/config/m68k/haiku.h - create mode 100644 gcc/config/mips/haiku.h - create mode 100644 gcc/config/rs6000/haiku.h - create mode 100644 gcc/config/t-haiku - mode change 100644 => 100755 libgcc/config/i386/t-cygming - create mode 100644 libgcc/config/t-haiku - create mode 100644 libstdc++-v3/config/os/haiku/ctype_base.h - create mode 100644 libstdc++-v3/config/os/haiku/ctype_configure_char.cc - create mode 100644 libstdc++-v3/config/os/haiku/ctype_inline.h - create mode 100644 libstdc++-v3/config/os/haiku/error_constants.h - create mode 100644 libstdc++-v3/config/os/haiku/os_defines.h - -diff --git a/compile b/compile -old mode 100755 -new mode 100644 -diff --git a/config.rpath b/config.rpath -index 4dea759..5bcc5be 100755 ---- a/config.rpath -+++ b/config.rpath -@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then - ;; - netbsd*) - ;; -+ haiku*) -+ ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no -diff --git a/config/acx.m4 b/config/acx.m4 -index 9ff31eb..4b319f0 100644 ---- a/config/acx.m4 -+++ b/config/acx.m4 -@@ -402,24 +402,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is - dnl accepted by cmp on some systems. - AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], - [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, --[ echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+[# comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - ]) - do_compare="$gcc_cv_prog_cmp_skip" - AC_SUBST(do_compare) -diff --git a/configure.ac b/configure.ac -index 2ff9be0..9d451b2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -412,6 +412,9 @@ case "${host}" in - i[[3456789]]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -792,6 +795,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -982,6 +988,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -1035,6 +1044,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index bf2186a..4ecc2c7 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -104,6 +104,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) - build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) - target_objdir := $(toplevel_builddir)/$(target_subdir) - -+HYBRID_SECONDARY = @HYBRID_SECONDARY@ -+ - # -------- - # Defined vpaths - # -------- -@@ -2006,6 +2008,10 @@ DRIVER_DEFINES = \ - $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ - -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" - -+ifneq ($(HYBRID_SECONDARY),) -+DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-gcc.o += $(DRIVER_DEFINES) - - specs.h : s-specs ; @true -@@ -2585,7 +2591,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) - genprog = $(genprogerr) check checksum condmd match - - # These programs need libs over and above what they get from the above list. --build/genautomata$(build_exeext) : BUILD_LIBS += -lm -+build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ - - build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o - -@@ -2649,6 +2655,10 @@ PREPROCESSOR_DEFINES = \ - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ - @TARGET_SYSTEM_ROOT_DEFINE@ - -+ifneq ($(HYBRID_SECONDARY),) -+PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" -+endif -+ - CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) - cppbuiltin.o: $(BASEVER) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index d6b928d..3ac770b 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -699,6 +699,19 @@ case ${target} in - esac - use_gcc_stdint=wrap - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ # -+ gas=yes -+ gnu_ld=yes -+ tmake_file="t-slibgcc" -+ case ${enable_threads} in -+ "" | yes | posix) thread_file='posix' ;; -+ esac -+ default_use_cxa_atexit=yes -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - extra_options="$extra_options gnu-user.opt" - gas=yes -@@ -1048,6 +1061,16 @@ arm*-*-netbsdelf*) - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" - tmake_file="${tmake_file} arm/t-arm" - ;; -+arm*-*-haiku*) -+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" -+ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" -+ # The BPABI long long divmod functions return a 128-bit value in -+ # registers r0-r3. Correctly modeling that requires the use of -+ # TImode. -+ need_64bit_hwint=yes -+ default_use_cxa_atexit=yes -+ tm_file="${tm_file} arm/aout.h arm/arm.h" -+ ;; - arm*-*-linux-*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - extra_options="${extra_options} linux-android.opt" -@@ -1419,6 +1442,14 @@ i[34567]86-*-freebsd*) - x86_64-*-freebsd*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-crtpic" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} t-haiku i386/t-haiku64" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" -+ ;; - i[34567]86-*-netbsdelf*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -@@ -1941,6 +1972,13 @@ m68k-*-rtems*) - tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" - tm_defines="${tm_defines} MOTOROLA=1" - ;; -+m68k-*-haiku*) -+ default_m68k_cpu=68020 -+ default_cf_cpu=5206 -+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? -+ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h" -+ tm_defines="${tm_defines} MOTOROLA=1" -+ ;; - mcore-*-elf) - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" - tmake_file=mcore/t-mcore -@@ -2024,6 +2062,11 @@ mips*-mti-linux*) - gnu_ld=yes - gas=yes - ;; -+mipsel-*-haiku*) -+ target_cpu_default="MASK_ABICALLS" -+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" -+ tmake_file="${tmake_file} mips/t-elf t-haiku" -+ ;; - mips*-*-linux*) # Linux MIPS, either endian. - tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" - extra_options="${extra_options} linux-android.opt" -@@ -2358,6 +2401,11 @@ powerpc-*-eabi*) - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - use_gcc_stdint=wrap - ;; -+powerpc-*-haiku*) -+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" -+ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h" -+ extra_options="${extra_options} rs6000/sysv4.opt" -+ ;; - powerpc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" - extra_options="${extra_options} rs6000/sysv4.opt" -diff --git a/gcc/config.host b/gcc/config.host -index 4e456a1..a48bc49 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -107,7 +107,7 @@ case ${host} in - ;; - esac - ;; -- arm*-*-freebsd* | arm*-*-linux*) -+ arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) - case ${target} in - arm*-*-*) - host_extra_gcc_objs="driver-arm.o" -@@ -133,9 +133,11 @@ case ${host} in - ;; - esac - ;; -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - case ${target} in -- mips*-*-linux*) -+ mips*-*-linux* \ -+ | mips*-*-haiku* ) - host_extra_gcc_objs="driver-native.o" - host_xmake_file="${host_xmake_file} mips/x-native" - ;; -diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h -new file mode 100644 -index 0000000..f0c0d63 ---- /dev/null -+++ b/gcc/config/arm/haiku.h -@@ -0,0 +1,80 @@ -+/* Definitions for ARM running Haiku systems using ELF -+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+ 2005 Free Software Foundation, Inc. -+ -+ This file is part of GCC. -+ -+ GCC is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ GCC is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING. If not, write to -+ the Free Software Foundation, 59 Temple Place - Suite 330, -+ Boston, MA 02111-1307, USA. */ -+ -+/* Unsigned chars produces much better code than signed. */ -+#define DEFAULT_SIGNED_CHAR 0 -+ -+#undef TARGET_DEFAULT_FLOAT_ABI -+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT -+ -+/* We default to the "aapcs-linux" ABI so that enums are int-sized by -+ default. */ -+#undef ARM_DEFAULT_ABI -+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX -+ -+/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ -+ -+#undef MULTILIB_DEFAULTS -+#define MULTILIB_DEFAULTS \ -+ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } -+ -+/* Default is set by bpabi.h */ -+/* -+#undef TARGET_DEFAULT -+*/ -+ -+#undef SUBTARGET_CPU_DEFAULT -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -+ -+/* Now we define the strings used to build the spec file. */ -+/* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__ARM__"); \ -+ builtin_define ("__arm__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ /* Haiku apparently doesn't support merging of symbols across shared \ -+ object boundaries. Hence we need to explicitly specify that \ -+ type_infos are not merged, so that they get compared by name \ -+ instead of by pointer. */ \ -+ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ -+ /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\ -+ TARGET_BPABI_CPP_BUILTINS(); \ -+ } \ -+ while (0) -+ -+/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we -+ do not use multilib (needed ??). */ -+#undef LIBGCC_SPEC -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m armelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" -+ -diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku -new file mode 100644 -index 0000000..3f7f488 ---- /dev/null -+++ b/gcc/config/arm/t-haiku -@@ -0,0 +1,21 @@ -+# build multilib for soft float and VFP -+# (unsure about how it should be done...) -+# mix from t-symbian & t-wince-pe -+ -+#LIB1ASMSRC = arm/lib1funcs.asm -+#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX -+ -+ -+#MULTILIB_OPTIONS += mhard-float -+#MULTILIB_DIRNAMES += fpu -+ -+MULTILIB_OPTIONS += msoft-float -+MULTILIB_DIRNAMES += fpu soft -+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* -+ -+MULTILIB_OPTIONS += mfloat-abi=softfp -+MULTILIB_DIRNAMES += softfp -+ -+#LIBGCC = stmp-multilib -+#INSTALL_LIBGCC = install-multilib -+#TARGET_LIBGCC2_CFLAGS = -diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h -new file mode 100644 -index 0000000..8f702d0 ---- /dev/null -+++ b/gcc/config/haiku-stdint.h -@@ -0,0 +1,55 @@ -+/* Definitions for types on Haiku. -+ Copyright (C) 2014 Paweł Dziepak. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 3, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+Under Section 7 of GPL version 3, you are granted additional -+permissions described in the GCC Runtime Library Exception, version -+3.1, as published by the Free Software Foundation. -+ -+You should have received a copy of the GNU General Public License and -+a copy of the GCC Runtime Library Exception along with this program; -+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+. */ -+ -+#define SIG_ATOMIC_TYPE "int" -+ -+#define INT8_TYPE "signed char" -+#define INT16_TYPE "short int" -+#define INT32_TYPE "int" -+#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT8_TYPE "unsigned char" -+#define UINT16_TYPE "short unsigned int" -+#define UINT32_TYPE "unsigned int" -+#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_LEAST8_TYPE "signed char" -+#define INT_LEAST16_TYPE "short int" -+#define INT_LEAST32_TYPE "int" -+#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_LEAST8_TYPE "unsigned char" -+#define UINT_LEAST16_TYPE "short unsigned int" -+#define UINT_LEAST32_TYPE "unsigned int" -+#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INT_FAST8_TYPE "int" -+#define INT_FAST16_TYPE "int" -+#define INT_FAST32_TYPE "int" -+#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") -+#define UINT_FAST8_TYPE "unsigned int" -+#define UINT_FAST16_TYPE "unsigned int" -+#define UINT_FAST32_TYPE "unsigned int" -+#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") -+ -+#define INTPTR_TYPE "long int" -+#define UINTPTR_TYPE "long unsigned int" -diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h -new file mode 100644 -index 0000000..2aa4b2b ---- /dev/null -+++ b/gcc/config/haiku.h -@@ -0,0 +1,221 @@ -+/* Definitions of target machine for GCC. -+ Common Haiku definitions for all architectures. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* Change debugging to Dwarf2. */ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef MCOUNT_NAME -+#define MCOUNT_NAME "_mcount" -+ -+#define TARGET_DECLSPEC 1 -+ -+#undef SIZE_TYPE -+#define SIZE_TYPE "long unsigned int" -+ -+#undef PTRDIFF_TYPE -+#define PTRDIFF_TYPE "long int" -+ -+#undef WCHAR_TYPE -+#define WCHAR_TYPE "int" -+ -+#undef WCHAR_TYPE_SIZE -+#define WCHAR_TYPE_SIZE 32 -+ -+/* Haiku uses lots of multichars, so don't warn about them unless the -+ user explicitly asks for the warnings with -Wmultichar. Note that -+ CC1_SPEC is used for both cc1 and cc1plus. */ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -+ -+#undef CC1PLUS_SPEC -+#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" -+ -+/* LIB_SPEC for Haiku */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lroot" -+ -+/* Use --as-needed -lgcc_s for eh support. */ -+#ifdef HAVE_LD_AS_NEEDED -+#define USE_LD_AS_NEEDED 1 -+#endif -+ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" -+ -+/* Every program on Haiku links against libroot which contains the pthread -+ routines, so there's no need to explicitly call out when doing threaded -+ work. */ -+#undef GOMP_SELF_SPECS -+#define GOMP_SELF_SPECS "" -+#undef GTM_SELF_SPECS -+#define GTM_SELF_SPECS "" -+ -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ -+ /* Hybrid secondary folders for os kits not in base haiku package */\ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#else /* HYBRID_SECONDARY */ -+/* For both native and cross compiler, use standard Haiku include file -+ search paths. -+ For a cross compiler, it is expected that an appropriate sysroot has -+ been configured (e.g. /boot/system/develop/cross/x86) which will -+ be appended to each search folder given below. */ -+#define INCLUDE_DEFAULTS \ -+{ \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ -+ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ -+ /* TODO: To be removed when libtiff has been outsourced. */\ -+ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ -+ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+} -+#endif /* HYBRID_SECONDARY */ -+ -+/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will -+ cause nasty problems if we override it. */ -+#define LIBRARY_PATH_ENV "BELIBRARIES" -+ -+/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the -+ respective secondary architecture path. The user specific paths are set via -+ LIBRARY_PATH_ENV. */ -+#undef STANDARD_STARTFILE_PREFIX_1 -+#undef STANDARD_STARTFILE_PREFIX_2 -+#undef MD_STARTFILE_PREFIX -+#undef STARTFILE_PREFIX_SPEC -+#ifdef HYBRID_SECONDARY -+/* For a secondary compiler on a hybrid system, use alternative search paths.*/ -+#define STANDARD_STARTFILE_PREFIX_1 \ -+ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" -+#define STANDARD_STARTFILE_PREFIX_2 \ -+ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" -+#else /* HYBRID_SECONDARY */ -+#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" -+#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" -+#endif /* HYBRID_SECONDARY */ -+ -+/* Haiku doesn't have a separate math library. */ -+#define MATH_LIBRARY "" -+ -+/* Haiku headers are C++-aware (and often use C++). */ -+#define NO_IMPLICIT_EXTERN_C -+ -+/* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */ -+#ifndef TARGET_LIBC_PROVIDES_SSP -+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}" -+#endif -+ -+/* no JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not use JCR_SECTION_NAME default definition for Haiku */ -+#define TARGET_NO_JCR_SECTION_NAME 1 -+ -+/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */ -+#define TARGET_USE_JCR_SECTION 0 -+ -+/* Do not use TM clone registry in Haiku for now */ -+#define USE_TM_CLONE_REGISTRY 0 -diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h -new file mode 100644 -index 0000000..3379e19 ---- /dev/null -+++ b/gcc/config/i386/haiku.h -@@ -0,0 +1,77 @@ -+/* Definitions for Intel x86 running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START " #" -+ -+/* The SVR4 ABI for the i386 says that records and unions are returned -+ in memory. */ -+#undef DEFAULT_PCC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 1 -+ -+#undef DBX_REGISTER_NUMBER -+#define DBX_REGISTER_NUMBER(n) \ -+ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__INTEL__"); \ -+ builtin_define ("_X86_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* A C statement to output to the stdio stream FILE an assembler -+ command to advance the location counter to a multiple of 1< 8 byte \ -+ alignment is preferred. */ \ -+ if ((LOG) > 3 \ -+ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ -+ && (MAX_SKIP) >= 7) \ -+ fputs ("\t.p2align 3\n", (FILE)); \ -+ } \ -+ } \ -+ } while (0) -+#undef ASM_OUTPUT_MAX_SKIP_PAD -+#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ -+ if ((LOG) != 0) \ -+ { \ -+ if ((MAX_SKIP) == 0) \ -+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ -+ else \ -+ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ -+ } -+#endif -+ -+ -+/* Output assembler code to FILE to call the profiler. */ -+#define NO_PROFILE_COUNTERS 1 -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ -+ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" -+ -+#undef ASM_OUTPUT_ALIGNED_COMMON -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ -+ x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); -+ -+ -+/* i386 System V Release 4 uses DWARF debugging info. -+ x86-64 ABI specifies DWARF2. */ -+ -+#define DWARF2_DEBUGGING_INFO 1 -+#define DWARF2_UNWIND_INFO 1 -+ -+#undef PREFERRED_DEBUGGING_TYPE -+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -+ -+#undef TARGET_ASM_SELECT_SECTION -+#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section -+ -+#undef TARGET_ASM_UNIQUE_SECTION -+#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section -+ -+#define USE_X86_64_FRAME_POINTER 1 -diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 -new file mode 100644 -index 0000000..9c8f8e6 ---- /dev/null -+++ b/gcc/config/i386/t-haiku64 -@@ -0,0 +1,16 @@ -+MULTILIB_OPTIONS = m32 -+MULTILIB_DIRNAMES = 32 -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -+ -+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o -+ -+# The pushl in CTOR initialization interferes with frame pointer elimination. -+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, -+# because then __FRAME_END__ might not be the last thing in .eh_frame -+# section. -+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -+ -+# Compile libgcc2.a with pic. -+TARGET_LIBGCC2_CFLAGS = -fPIC -diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/i386/winnt-stubs.c b/gcc/config/i386/winnt-stubs.c -old mode 100644 -new mode 100755 -diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h -new file mode 100644 -index 0000000..358c19f ---- /dev/null -+++ b/gcc/config/m68k/haiku.h -@@ -0,0 +1,268 @@ -+/* Definitions for Motorola 68k running Haiku -+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 51 Franklin Street, Fifth Floor, -+Boston, MA 02110-1301, USA. */ -+ -+/* Default target comes from config.gcc. */ -+ -+#undef TARGET_DEFAULT -+#ifdef TARGET_CPU_DEFAULT -+#define TARGET_DEFAULT TARGET_CPU_DEFAULT -+#else -+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) -+#endif -+ -+/* for 68k machines this only needs to be TRUE for the 68000 */ -+ -+#undef STRICT_ALIGNMENT -+#define STRICT_ALIGNMENT 0 -+ -+/* Here are four prefixes that are used by asm_fprintf to -+ facilitate customization for alternate assembler syntaxes. -+ Machines with no likelihood of an alternate syntax need not -+ define these and need not use asm_fprintf. */ -+ -+/* The prefix for register names. Note that REGISTER_NAMES -+ is supposed to include this prefix. Also note that this is NOT an -+ fprintf format string, it is a literal string */ -+ -+#undef REGISTER_PREFIX -+#define REGISTER_PREFIX "%" -+ -+/* The prefix for local (compiler generated) labels. -+ These labels will not appear in the symbol table. */ -+ -+#undef LOCAL_LABEL_PREFIX -+#define LOCAL_LABEL_PREFIX "." -+ -+/* The prefix to add to user-visible assembler symbols. */ -+ -+#undef USER_LABEL_PREFIX -+#define USER_LABEL_PREFIX "" -+ -+#undef ASM_COMMENT_START -+#define ASM_COMMENT_START "|" -+ -+/* Target OS builtins. */ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__M68K__"); \ -+ builtin_define_std ("mc68000"); \ -+ builtin_define_std ("mc68020"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ } \ -+ while (0) -+ -+#define TARGET_OBJFMT_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__ELF__"); \ -+ } \ -+ while (0) -+ -+#undef CPP_SPEC -+#if TARGET_DEFAULT & MASK_68881 -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#else -+#define CPP_SPEC \ -+ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -+#endif -+ -+/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down -+ to the assembler. */ -+#undef ASM_SPEC -+#define ASM_SPEC \ -+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -+%{m68040} %{m68060:-m68040}" -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ -+#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} -no-undefined %{nostart:-e 0}" -+ -+/* XXX: not sure for the rest there... */ -+ -+/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to -+ keep switch tables in the text section. */ -+ -+#define JUMP_TABLES_IN_TEXT_SECTION 1 -+ -+/* This is how to output an assembler line that says to advance the -+ location counter to a multiple of 2**LOG bytes. */ -+ -+/* Use the default action for outputting the case label. */ -+#undef ASM_OUTPUT_CASE_LABEL -+#define ASM_RETURN_CASE_JUMP \ -+ do { \ -+ if (TARGET_COLDFIRE) \ -+ { \ -+ if (ADDRESS_REG_P (operands[0])) \ -+ return "jmp %%pc@(2,%0:l)"; \ -+ else \ -+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ -+ } \ -+ else \ -+ return "jmp %%pc@(2,%0:w)"; \ -+ } while (0) -+ -+#undef ASM_OUTPUT_ALIGN -+#define ASM_OUTPUT_ALIGN(FILE,LOG) \ -+ if ((LOG) > 0) \ -+ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); -+ -+/* If defined, a C expression whose value is a string containing the -+ assembler operation to identify the following data as uninitialized global -+ data. */ -+ -+#define BSS_SECTION_ASM_OP "\t.section\t.bss" -+ -+/* A C statement (sans semicolon) to output to the stdio stream -+ FILE the assembler definition of uninitialized global DECL named -+ NAME whose size is SIZE bytes and alignment is ALIGN bytes. -+ Try to use asm_output_aligned_bss to implement this macro. */ -+ -+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ -+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -+ -+/* Output assembler code to FILE to increment profiler label # LABELNO -+ for profiling a function entry. */ -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(FILE, LABELNO) \ -+{ \ -+ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ -+ if (flag_pic) \ -+ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ -+ else \ -+ fprintf (FILE, "\tjbsr _mcount\n"); \ -+} -+ -+/* How to renumber registers for dbx and gdb. -+ On the Sun-3, the floating point registers have numbers -+ 18 to 25, not 16 to 23 as they do in the compiler. */ -+ -+#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) -+ -+/* Do not break .stabs pseudos into continuations. */ -+ -+#define DBX_CONTIN_LENGTH 0 -+ -+/* 1 if N is a possible register number for a function value. For -+ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, -+ pointer, or floating types, respectively. Reject fp0 if not using -+ a 68881 coprocessor. */ -+ -+#undef FUNCTION_VALUE_REGNO_P -+#define FUNCTION_VALUE_REGNO_P(N) \ -+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) -+ -+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for -+ more than one register. */ -+ -+#undef NEEDS_UNTYPED_CALL -+#define NEEDS_UNTYPED_CALL 1 -+ -+/* Define how to generate (in the callee) the output value of a -+ function and how to find (in the caller) the value returned by a -+ function. VALTYPE is the data type of the value (as a tree). If -+ the precise function being called is known, FUNC is its -+ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the -+ result in d0, a0, or fp0 as appropriate. */ -+ -+#undef FUNCTION_VALUE -+#define FUNCTION_VALUE(VALTYPE, FUNC) \ -+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ -+ : (POINTER_TYPE_P (VALTYPE) \ -+ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ -+ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) -+ -+/* For compatibility with the large body of existing code which does -+ not always properly declare external functions returning pointer -+ types, the m68k/SVR4 convention is to copy the value returned for -+ pointer functions from a0 to d0 in the function epilogue, so that -+ callers that have neglected to properly declare the callee can -+ still find the correct return value. */ -+ -+#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ -+do { \ -+ if (current_function_returns_pointer \ -+ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ -+ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ -+} while (0); -+ -+/* Define how to find the value returned by a library function -+ assuming the value has mode MODE. -+ For m68k/SVR4 look for integer values in d0, pointer values in d0 -+ (returned in both d0 and a0), and floating values in fp0. */ -+ -+#undef LIBCALL_VALUE -+#define LIBCALL_VALUE(MODE) \ -+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ -+ && TARGET_68881) \ -+ ? gen_rtx_REG ((MODE), 16) \ -+ : gen_rtx_REG ((MODE), 0)) -+ -+/* For m68k SVR4, structures are returned using the reentrant -+ technique. */ -+#undef PCC_STATIC_STRUCT_RETURN -+#define DEFAULT_PCC_STRUCT_RETURN 0 -+ -+/* Finalize the trampoline by flushing the insn cache. */ -+ -+#undef FINALIZE_TRAMPOLINE -+#define FINALIZE_TRAMPOLINE(TRAMP) \ -+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ -+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ -+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ -+ Pmode); -+ -+/* Clear the instruction cache from `beg' to `end'. This makes an -+ inline system call to SYS_cacheflush. The arguments are as -+ follows: -+ -+ cacheflush (addr, scope, cache, len) -+ -+ addr - the start address for the flush -+ scope - the scope of the flush (see the cpush insn) -+ cache - which cache to flush (see the cpush insn) -+ len - a factor relating to the number of flushes to perform: -+ len/16 lines, or len/4096 pages. */ -+ -+#define CLEAR_INSN_CACHE(BEG, END) \ -+{ \ -+extern void clear_caches(void *address, int length, unsigned long flags); \ -+ void *ptr = BEG; \ -+ int len = (END - BEG + 32); \ -+ clear_caches(ptr, len, 0x0005); \ -+} -diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h -new file mode 100644 -index 0000000..f6d2efb ---- /dev/null -+++ b/gcc/config/mips/haiku.h -@@ -0,0 +1,44 @@ -+/* Definitions for MIPS running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__MIPS__"); \ -+ builtin_define ("__MIPSEL__"); \ -+ builtin_define ("_MIPSEL_"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ if (flag_pic) \ -+ { \ -+ builtin_define ("__PIC__"); \ -+ builtin_define ("__pic__"); \ -+ } \ -+ } \ -+ while (0) -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" -+ -diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h -new file mode 100644 -index 0000000..9ff36f1 ---- /dev/null -+++ b/gcc/config/rs6000/haiku.h -@@ -0,0 +1,59 @@ -+/* Definitions for PowerPC running Haiku -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 -+ Free Software Foundation, Inc. -+ -+This file is part of GCC. -+ -+GCC is free software; you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation; either version 2, or (at your option) -+any later version. -+ -+GCC is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with GCC; see the file COPYING. If not, write to -+the Free Software Foundation, 59 Temple Place - Suite 330, -+Boston, MA 02111-1307, USA. */ -+ -+ -+/* long double is 128 bits wide; the documentation claims -+ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but -+ it apparently does not */ -+/*#undef LONG_DOUBLE_TYPE_SIZE -+#define LONG_DOUBLE_TYPE_SIZE 128 -+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ builtin_define ("__HAIKU__"); \ -+ builtin_define ("__POWERPC__"); \ -+ builtin_define ("__powerpc__"); \ -+ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ -+ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ -+ builtin_define ("__STDC_ISO_10646__=201103L"); \ -+ builtin_assert ("system=haiku"); \ -+ builtin_assert ("cpu=powerpc"); \ -+ builtin_assert ("machine=powerpc"); \ -+ TARGET_OS_SYSV_CPP_BUILTINS (); \ -+ } \ -+ while (0) -+ -+/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support -+ for the special GCC options -static and -shared, which allow us to -+ link things in one of these three modes by applying the appropriate -+ combinations of options at link-time. */ -+ -+/* If ELF is the default format, we should not use /lib/elf. */ -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" -diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku -new file mode 100644 -index 0000000..587d1fb ---- /dev/null -+++ b/gcc/config/t-haiku -@@ -0,0 +1,4 @@ -+# There are system headers elsewhere, but these are the ones that -+# we are most likely to want to apply any fixes to. -+NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers -+LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] -\ No newline at end of file -diff --git a/gcc/configure.ac b/gcc/configure.ac -index bc574db..3b6bcdf 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -719,6 +719,15 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+AC_ARG_WITH(hybrid_secondary, -+ [AS_HELP_STRING([--with-hybrid_secondary], -+ [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], -+ [HYBRID_SECONDARY=$withval], -+ [HYBRID_SECONDARY=] -+) -+AC_SUBST(HYBRID_SECONDARY) -+ - # With stabs - AC_ARG_WITH(stabs, - [AS_HELP_STRING([--with-stabs], -@@ -1080,6 +1089,16 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+AC_SUBST(build_math_library) -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, -@@ -1533,7 +1552,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 9d38ba1..64e0ae1 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -395,7 +395,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ -+ && !defined(TARGET_NO_JCR_SECTION_NAME) - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif -diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h -index afc1cc5..1d3ef09 100644 ---- a/gcc/ginclude/stdarg.h -+++ b/gcc/ginclude/stdarg.h -@@ -93,7 +93,7 @@ typedef __gnuc_va_list va_list; - #ifndef _VA_LIST - /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ - #ifndef _VA_LIST_T_H --/* The macro __va_list__ is used by BeOS. */ -+/* The macro __va_list__ is used by BeOS and Haiku. */ - #ifndef __va_list__ - typedef __gnuc_va_list va_list; - #endif /* not __va_list__ */ -diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h -index f20a41b..f8c8e2d 100644 ---- a/gcc/ginclude/stddef.h -+++ b/gcc/ginclude/stddef.h -@@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_size_t) --#ifndef __size_t__ /* BeOS */ -+#ifndef __size_t__ /* BeOS, Haiku */ - #ifndef __SIZE_T__ /* Cray Unicos/Mk */ - #ifndef _SIZE_T /* in case has defined it. */ - #ifndef _SYS_SIZE_T_H -@@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #ifndef _GCC_SIZE_T - #ifndef _SIZET_ - #ifndef __size_t --#define __size_t__ /* BeOS */ -+#define __size_t__ /* BeOS, Haiku */ - #define __SIZE_T__ /* Cray Unicos/Mk */ - #define _SIZE_T - #define _SYS_SIZE_T_H -@@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; - #endif - #if !(defined (__GNUG__) && defined (size_t)) - typedef __SIZE_TYPE__ size_t; --#ifdef __BEOS__ -+#if defined(__BEOS__) - typedef long ssize_t; - #endif /* __BEOS__ */ - #endif /* !(defined (__GNUG__) && defined (size_t)) */ -@@ -247,7 +247,7 @@ typedef long ssize_t; - /* Define this type if we are doing the whole job, - or if we want this type in particular. */ - #if defined (_STDDEF_H) || defined (__need_wchar_t) --#ifndef __wchar_t__ /* BeOS */ -+#ifndef __wchar_t__ /* BeOS, Haiku */ - #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ - #ifndef _WCHAR_T - #ifndef _T_WCHAR_ -@@ -264,7 +264,7 @@ typedef long ssize_t; - #ifndef ___int_wchar_t_h - #ifndef __INT_WCHAR_T_H - #ifndef _GCC_WCHAR_T --#define __wchar_t__ /* BeOS */ -+#define __wchar_t__ /* BeOS, Haiku */ - #define __WCHAR_T__ /* Cray Unicos/Mk */ - #define _WCHAR_T - #define _T_WCHAR_ -diff --git a/include/filenames.h b/include/filenames.h -index 1161daa..4b9e676 100644 ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -44,9 +44,11 @@ extern "C" { - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ - # if defined(__APPLE__) -+/* - # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM - # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 - # endif -+*/ - # endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 527d87b..37231e7 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -372,10 +372,16 @@ ifeq ($(enable_shared),yes) - endif - endif - -+ifneq ($(enable_shared),yes) -+# Maintain the same visibility as older GCC for now. Needed on Haiku -+# because the static library is included in libroot.so. -+vis_hide = -+else - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. - vis_hide = @vis_hide@ -+endif - - ifneq (,$(vis_hide)) - -diff --git a/libgcc/config.host b/libgcc/config.host -index 3a2c75d..1266e17 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -230,6 +230,14 @@ case ${host} in - ;; - esac - ;; -+*-*-haiku*) -+ # This is the generic ELF configuration of Haiku. Later -+ # machine-specific sections may refine and add to this -+ # configuration. -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" -+ tmake_file="$tmake_file t-slibgcc-nolc-override" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -@@ -378,6 +386,12 @@ arm*-*-freebsd*) # ARM FreeBSD EABI - arm*-*-netbsdelf*) - tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" - ;; -+arm-*-haiku*) -+ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" -+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" -+ tm_file="${tm_file} arm/bpabi-lib.h" -+ unwind_header=config/arm/unwind-arm.h -+ ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" - tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" -@@ -587,6 +601,12 @@ x86_64-*-freebsd*) - tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" - md_unwind_header=i386/freebsd-unwind.h - ;; -+i[34567]86-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; -+x86_64-*-haiku*) -+ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" -+ ;; - i[34567]86-*-netbsdelf*) - ;; - x86_64-*-netbsd*) -@@ -795,6 +815,8 @@ m32r-*-linux*) - m32rle-*-linux*) - tmake_file="$tmake_file m32r/t-linux t-fdpbit" - ;; -+m68k-*-haiku*) -+ ;; - m68k-*-elf* | fido-*-elf) - tmake_file="$tmake_file m68k/t-floatlib" - ;; -@@ -865,6 +887,8 @@ mips*-sde-elf*) - esac - extra_parts="$extra_parts crti.o crtn.o" - ;; -+mipsel-*-haiku*) -+ ;; - mipsisa32-*-elf* | mipsisa32el-*-elf* | \ - mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ - mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ -@@ -995,6 +1019,8 @@ powerpc*-*-freebsd*) - ;; - esac - ;; -+powerpc-*-haiku*) -+ ;; - powerpc-*-netbsd*) - tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" - ;; -diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming -old mode 100644 -new mode 100755 -diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku -new file mode 100644 -index 0000000..b4fff2d ---- /dev/null -+++ b/libgcc/config/t-haiku -@@ -0,0 +1,3 @@ -+# Use unwind-dw2-fde -+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c -index f37e464..c52930d 100644 ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ - && defined(HAVE_LD_EH_FRAME_HDR) \ - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ - && defined(__GLIBC__) && __GLIBC__ >= 2 -+#ifndef __HAIKU__ - #include -+#endif - /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. - But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ - # if !defined(__UCLIBC__) \ -diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h -new file mode 100644 -index 0000000..e762aaa ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_base.h -@@ -0,0 +1,61 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Default information, may not be appropriate for specific host. -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Non-standard typedefs. -+ typedef const int* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef unsigned int mask; -+ static const mask upper = 1 << 0; -+ static const mask lower = 1 << 1; -+ static const mask alpha = 1 << 2; -+ static const mask digit = 1 << 3; -+ static const mask xdigit = 1 << 4; -+ static const mask space = 1 << 5; -+ static const mask print = 1 << 6; -+ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct -+ static const mask cntrl = 1 << 8; -+ static const mask punct = 1 << 9; -+ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit -+#if __cplusplus >= 201103L -+ static const mask blank = 1 << 10; -+#endif -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -new file mode 100644 -index 0000000..35e6b80 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc -@@ -0,0 +1,99 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2011-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file ctype_configure_char.cc */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+#include -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return 0; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_del(__table != 0 && __del), -+ _M_toupper(NULL), _M_tolower(NULL), -+ _M_table(__table ? __table : classic_table()) -+ { -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ _M_widen_ok = 0; -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ _M_narrow_ok = 0; -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return ::toupper((int) __c); } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::toupper((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return ::tolower((int) __c); } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = ::tolower((int) *__low); -+ ++__low; -+ } -+ return __high; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h -new file mode 100644 -index 0000000..5b5cc56 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/ctype_inline.h -@@ -0,0 +1,173 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000-2015 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/ctype_inline.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{locale} -+ */ -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+// The following definitions are portable, but insanely slow. If one -+// cares at all about performance, then specialized ctype -+// functionality should be added for the native os in question: see -+// the config/os/bits/ctype_*.h files. -+ -+// Constructing a synthetic "C" table should be seriously considered... -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { -+ if (_M_table) -+ return _M_table[static_cast(__c)] & __m; -+ else -+ { -+ bool __ret = false; -+ const size_t __bitmasksize = 15; -+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 -+ for (; __bitcur <= __bitmasksize; ++__bitcur) -+ { -+ const mask __bit = static_cast(1 << __bitcur); -+ if (__m & __bit) -+ { -+ bool __testis; -+ switch (__bit) -+ { -+ case space: -+ __testis = isspace(__c); -+ break; -+ case print: -+ __testis = isprint(__c); -+ break; -+ case cntrl: -+ __testis = iscntrl(__c); -+ break; -+ case upper: -+ __testis = isupper(__c); -+ break; -+ case lower: -+ __testis = islower(__c); -+ break; -+ case alpha: -+ __testis = isalpha(__c); -+ break; -+ case digit: -+ __testis = isdigit(__c); -+ break; -+ case punct: -+ __testis = ispunct(__c); -+ break; -+ case xdigit: -+ __testis = isxdigit(__c); -+ break; -+ case alnum: -+ __testis = isalnum(__c); -+ break; -+ case graph: -+ __testis = isgraph(__c); -+ break; -+#if __cplusplus >= 201103L -+ case blank: -+ __testis = isblank(__c); -+ break; -+#endif -+ default: -+ __testis = false; -+ break; -+ } -+ __ret |= __testis; -+ } -+ } -+ return __ret; -+ } -+ } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ if (_M_table) -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ else -+ { -+ // Highest bitmask in ctype_base == 11. -+ const size_t __bitmasksize = 15; -+ for (;__low < __high; ++__vec, ++__low) -+ { -+ mask __m = 0; -+ // Lowest bitmask in ctype_base == 0 -+ size_t __i = 0; -+ for (;__i <= __bitmasksize; ++__i) -+ { -+ const mask __bit = static_cast(1 << __i); -+ if (this->is(__bit, *__low)) -+ __m |= __bit; -+ } -+ *__vec = __m; -+ } -+ } -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ else -+ while (__low < __high && !this->is(__m, *__low)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ if (_M_table) -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ else -+ while (__low < __high && this->is(__m, *__low) != 0) -+ ++__low; -+ return __low; -+ } -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h -new file mode 100644 -index 0000000..fa6d889 ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/error_constants.h -@@ -0,0 +1,178 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2007-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/error_constants.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{system_error} -+ */ -+ -+#ifndef _GLIBCXX_ERROR_CONSTANTS -+#define _GLIBCXX_ERROR_CONSTANTS 1 -+ -+#include -+#include -+ -+namespace std _GLIBCXX_VISIBILITY(default) -+{ -+_GLIBCXX_BEGIN_NAMESPACE_VERSION -+ -+ enum class errc -+ { -+ address_family_not_supported = EAFNOSUPPORT, -+ address_in_use = EADDRINUSE, -+ address_not_available = EADDRNOTAVAIL, -+ already_connected = EISCONN, -+ argument_list_too_long = E2BIG, -+ argument_out_of_domain = EDOM, -+ bad_address = EFAULT, -+ bad_file_descriptor = EBADF, -+ -+#ifdef _GLIBCXX_HAVE_EBADMSG -+ bad_message = EBADMSG, -+#endif -+ -+ broken_pipe = EPIPE, -+ connection_aborted = ECONNABORTED, -+ connection_already_in_progress = EALREADY, -+ connection_refused = ECONNREFUSED, -+ connection_reset = ECONNRESET, -+ cross_device_link = EXDEV, -+ destination_address_required = EDESTADDRREQ, -+ device_or_resource_busy = EBUSY, -+ directory_not_empty = ENOTEMPTY, -+ executable_format_error = ENOEXEC, -+ file_exists = EEXIST, -+ file_too_large = EFBIG, -+ filename_too_long = ENAMETOOLONG, -+ function_not_supported = ENOSYS, -+ host_unreachable = EHOSTUNREACH, -+ -+#ifdef _GLIBCXX_HAVE_EIDRM -+ identifier_removed = EIDRM, -+#endif -+ -+ illegal_byte_sequence = EILSEQ, -+ inappropriate_io_control_operation = ENOTTY, -+ interrupted = EINTR, -+ invalid_argument = EINVAL, -+ invalid_seek = ESPIPE, -+ io_error = EIO, -+ is_a_directory = EISDIR, -+ message_size = EMSGSIZE, -+ network_down = ENETDOWN, -+ network_reset = ENETRESET, -+ network_unreachable = ENETUNREACH, -+ no_buffer_space = ENOBUFS, -+ no_child_process = ECHILD, -+ -+#ifdef _GLIBCXX_HAVE_ENOLINK -+ no_link = ENOLINK, -+#endif -+ -+ no_lock_available = ENOLCK, -+ -+#ifdef _GLIBCXX_HAVE_ENODATA -+ no_message_available = ENODATA, -+#endif -+ -+ no_message = ENOMSG, -+ no_protocol_option = ENOPROTOOPT, -+ no_space_on_device = ENOSPC, -+ -+#ifdef _GLIBCXX_HAVE_ENOSR -+ no_stream_resources = ENOSR, -+#endif -+ -+ no_such_device_or_address = ENXIO, -+ no_such_device = ENODEV, -+ no_such_file_or_directory = ENOENT, -+ no_such_process = ESRCH, -+ not_a_directory = ENOTDIR, -+ not_a_socket = ENOTSOCK, -+ -+#ifdef _GLIBCXX_HAVE_ENOSTR -+ not_a_stream = ENOSTR, -+#endif -+ -+ not_connected = ENOTCONN, -+ not_enough_memory = ENOMEM, -+ -+#ifdef _GLIBCXX_HAVE_ENOTSUP -+ not_supported = ENOTSUP, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ECANCELED -+ operation_canceled = ECANCELED, -+#endif -+ -+ operation_in_progress = EINPROGRESS, -+ operation_not_permitted = EPERM, -+ operation_not_supported = EOPNOTSUPP, -+ operation_would_block = EWOULDBLOCK, -+ -+#ifdef _GLIBCXX_HAVE_EOWNERDEAD -+ owner_dead = EOWNERDEAD, -+#endif -+ -+ permission_denied = EACCES, -+ -+#ifdef _GLIBCXX_HAVE_EPROTO -+ protocol_error = EPROTO, -+#endif -+ -+ protocol_not_supported = EPROTONOSUPPORT, -+ read_only_file_system = EROFS, -+ resource_deadlock_would_occur = EDEADLK, -+ resource_unavailable_try_again = EAGAIN, -+ result_out_of_range = ERANGE, -+ -+#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE -+ state_not_recoverable = ENOTRECOVERABLE, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETIME -+ stream_timeout = ETIME, -+#endif -+ -+#ifdef _GLIBCXX_HAVE_ETXTBSY -+ text_file_busy = ETXTBSY, -+#endif -+ -+ timed_out = ETIMEDOUT, -+ too_many_files_open_in_system = ENFILE, -+ too_many_files_open = EMFILE, -+ too_many_links = EMLINK, -+ too_many_symbolic_link_levels = ELOOP, -+ -+#ifdef _GLIBCXX_HAVE_EOVERFLOW -+ value_too_large = EOVERFLOW, -+#endif -+ -+ wrong_protocol_type = EPROTOTYPE -+ }; -+ -+_GLIBCXX_END_NAMESPACE_VERSION -+} // namespace -+ -+#endif -diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h -new file mode 100644 -index 0000000..4674f7b ---- /dev/null -+++ b/libstdc++-v3/config/os/haiku/os_defines.h -@@ -0,0 +1,45 @@ -+// Specific definitions for generic platforms -*- C++ -*- -+ -+// Copyright (C) 2000-2013 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// Under Section 7 of GPL version 3, you are granted additional -+// permissions described in the GCC Runtime Library Exception, version -+// 3.1, as published by the Free Software Foundation. -+ -+// You should have received a copy of the GNU General Public License and -+// a copy of the GCC Runtime Library Exception along with this program; -+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+// . -+ -+/** @file bits/os_defines.h -+ * This is an internal header file, included by other library headers. -+ * Do not attempt to use it directly. @headername{iosfwd} -+ */ -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// On Haiku, nanosleep and sched_yield are always available except for the -+// kernel and the bootloader, so use them. -+#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) -+ #define _GLIBCXX_USE_NANOSLEEP 1 -+ #define _GLIBCXX_USE_SCHED_YIELD 1 -+ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 -+ #define _GLIBCXX_USE_CLOCK_REALTIME 1 -+#endif -+ -+#endif -diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host -index c93db1e..4d1dd8a 100644 ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -274,6 +274,9 @@ case "${host_os}" in - os_include_dir="os/gnu-linux" - fi - ;; -+ haiku*) -+ os_include_dir="os/haiku" -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; -diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 10247f9..4a0798f 100644 ---- a/libstdc++-v3/crossconfig.m4 -+++ b/libstdc++-v3/crossconfig.m4 -@@ -107,6 +107,47 @@ case "${host}" in - AC_DEFINE(HAVE_ISNANL) - fi - ;; -+ -+ *-haiku*) -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ -+ AC_DEFINE(HAVE_INT64_T) -+ -+ AC_DEFINE(HAVE_ACOSF) -+ AC_DEFINE(HAVE_ASINF) -+ AC_DEFINE(HAVE_ATANF) -+ AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COSF) -+ AC_DEFINE(HAVE_COSHF) -+ AC_DEFINE(HAVE_EXPF) -+ AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+ AC_DEFINE(HAVE_FMODF) -+ AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+ AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+ AC_DEFINE(HAVE_LOGF) -+ AC_DEFINE(HAVE_LOG10F) -+ AC_DEFINE(HAVE_MODFF) -+ AC_DEFINE(HAVE_SINF) -+ AC_DEFINE(HAVE_SINHF) -+ AC_DEFINE(HAVE_SQRTF) -+ AC_DEFINE(HAVE_TANF) -+ AC_DEFINE(HAVE_TANHF) -+ AC_DEFINE(HAVE_TLS) -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - AC_SUBST(SECTION_FLAGS) -diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc -index 8f77408..aa206ff 100644 ---- a/libstdc++-v3/libsupc++/tinfo.cc -+++ b/libstdc++-v3/libsupc++/tinfo.cc -@@ -30,6 +30,15 @@ std::type_info:: - ~type_info () - { } - -+#ifdef __HAIKU__ -+#ifndef __GXX_MERGED_TYPEINFO_NAMES -+#define __GXX_MERGED_TYPEINFO_NAMES 0 -+#endif -+#ifndef __GXX_TYPEINFO_EQUALITY_INLINE -+#define __GXX_TYPEINFO_EQUALITY_INLINE 0 -+#endif -+#endif -+ - #if !__GXX_TYPEINFO_EQUALITY_INLINE - - // We can't rely on common symbols being shared between shared objects. -diff --git a/libtool.m4 b/libtool.m4 -index 4b2d30a..47ff8f5 100644 ---- a/libtool.m4 -+++ b/libtool.m4 -@@ -1137,7 +1137,7 @@ fi - # Invoke $ECHO with all args, space-separated. - func_echo_all () - { -- $ECHO "$*" -+ $ECHO "$*" - } - - case "$ECHO" in -@@ -1722,7 +1722,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -2342,8 +2342,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) --- -2.1.0 - -From db57b7204ca279b369b5bd2c1c5cbecaf2883408 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Tue, 21 Jul 2015 18:45:53 +0200 -Subject: [PATCH 2/3] Haiku: regenerate configure. - ---- - configure | 48 +++++++++++++------- - gcc/configure | 50 +++++++++++++++------ - libstdc++-v3/configure | 119 +++++++++++++++++++++++++++++++++++++++++-------- - 3 files changed, 170 insertions(+), 47 deletions(-) - -diff --git a/configure b/configure -index 5ba9489..496ac7f 100755 ---- a/configure -+++ b/configure -@@ -3035,6 +3035,9 @@ case "${host}" in - i[3456789]86-*-msdosdjgpp*) - noconfigdirs="$noconfigdirs tcl tk itcl" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs tk itcl libgui gdb" -+ ;; - esac - - -@@ -3452,6 +3455,9 @@ case "${target}" in - *-*-darwin*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs ${libgcj}" -+ ;; - *-*-netware*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -@@ -3642,6 +3648,9 @@ case "${target}" in - *-*-freebsd*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs target-newlib target-libgloss" -+ ;; - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; -@@ -3695,6 +3704,9 @@ case "${target}" in - with_gmp=/usr/local - fi - ;; -+ *-*-haiku*) -+ noconfigdirs="$noconfigdirs gdb target-libiberty" -+ ;; - *-*-kaos*) - # Remove unsupported stuff on all kaOS configurations. - noconfigdirs="$noconfigdirs target-libgloss" -@@ -5352,24 +5364,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } - if test "${gcc_cv_prog_cmp_skip+set}" = set; then : - $as_echo_n "(cached) " >&6 - else -- echo abfoo >t1 -- echo cdfoo >t2 -- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -- if cmp t1 t2 2 2 > /dev/null 2>&1; then -- if cmp t1 t2 1 1 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ # comparing object files via cmp doesn't work on haiku (files will seemingly -+ # always differ), so we disassemble both files and compare the results: -+ if uname -o | grep -iq haiku; then -+ gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ else -+ gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' -+ echo abfoo >t1 -+ echo cdfoo >t2 -+ if cmp t1 t2 2 2 > /dev/null 2>&1; then -+ if cmp t1 t2 1 1 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' -+ fi - fi -- fi -- if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -- if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -- : -- else -- gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then -+ if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then -+ : -+ else -+ gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' -+ fi - fi -+ rm t1 t2 - fi -- rm t1 t2 - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 -diff --git a/gcc/configure b/gcc/configure -index 9fb885d..f0c058c 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -740,6 +740,7 @@ LDEXP_LIB - EXTRA_GCC_LIBS - GNAT_LIBEXC - COLLECT2_LIBS -+build_math_library - CXXDEPMODE - DEPDIR - am__leading_dot -@@ -776,6 +777,7 @@ with_float - with_cpu - enable_multiarch - enable_multilib -+HYBRID_SECONDARY - coverage_flags - valgrind_command - valgrind_path_defines -@@ -891,6 +893,7 @@ enable_checking - enable_coverage - enable_gather_detailed_mem_stats - enable_valgrind_annotations -+with_hybrid_secondary - with_stabs - enable_multilib - enable_multiarch -@@ -1701,6 +1704,8 @@ Optional Packages: - --with-demangler-in-ld try to use demangler in GNU ld - --with-gnu-as arrange to work with GNU as - --with-as arrange to use the specified as (full pathname) -+ --with-hybrid_secondary specify the packaging architecture for building a -+ secondary compiler for a Haiku hybrid system - --with-stabs arrange to use stabs instead of host debug format - --with-dwarf2 force the default debug format to be DWARF 2 - --with-specs=SPECS add SPECS to driver command-line processing -@@ -7323,6 +7328,18 @@ fi - # Miscenalleous configure options - # ------------------------------- - -+# handle --with-hybrid-secondary -+ -+# Check whether --with-hybrid_secondary was given. -+if test "${with_hybrid_secondary+set}" = set; then : -+ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval -+else -+ HYBRID_SECONDARY= -+ -+fi -+ -+ -+ - # With stabs - - # Check whether --with-stabs was given. -@@ -9299,6 +9316,16 @@ fi - # -------- - - -+# Configure -lm usage for host tools that need it -+build_math_library="-lm" -+case $build in -+ *-*-haiku*) -+ # no separate math library needed -+ build_math_library= -+ ;; -+esac -+ -+ - # These libraries may be used by collect2. - # We may need a special search path to get them linked. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 -@@ -11555,7 +11582,7 @@ case ${enable_threads} in - # default - target_thread_file='single' - ;; -- aix | dce | lynx | mipssde | posix | rtems | \ -+ aix | dce | haiku | lynx | mipssde | posix | rtems | \ - single | tpf | vxworks | win32) - target_thread_file=${enable_threads} - ;; -@@ -15395,8 +15422,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -17508,8 +17533,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -18026,7 +18052,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -18304,7 +18330,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18307 "configure" -+#line 18333 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18410,7 +18436,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 18413 "configure" -+#line 18439 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -20224,7 +20250,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -20246,8 +20271,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -21168,8 +21191,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure -index e9521d6..fbb543a 100755 ---- a/libstdc++-v3/configure -+++ b/libstdc++-v3/configure -@@ -8658,8 +8658,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static= - ;; - - hpux*) -@@ -10780,8 +10778,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -11301,7 +11300,7 @@ else - lt_cv_dlopen_libs= - - case $host_os in -- beos*) -+ beos* | haiku* ) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -@@ -11594,7 +11593,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11597 "configure" -+#line 11596 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11700,7 +11699,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11703 "configure" -+#line 11702 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13520,7 +13519,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - esac - ;; -- - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -@@ -13542,8 +13540,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } - ;; - haiku*) - # PIC is the default for Haiku. -- # The "-static" flag exists, but is broken. -- lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. -@@ -14464,8 +14460,9 @@ haiku*) - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes -- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' -- hardcode_into_libs=yes -+ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' -+ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' -+ hardcode_into_libs=no - ;; - - hpux9* | hpux10* | hpux11*) -@@ -15386,7 +15383,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } - # Fake what AC_TRY_COMPILE does. - - cat > conftest.$ac_ext << EOF --#line 15389 "configure" -+#line 15386 "configure" - int main() - { - typedef bool atomic_type; -@@ -15421,7 +15418,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15424 "configure" -+#line 15421 "configure" - int main() - { - typedef short atomic_type; -@@ -15456,7 +15453,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15459 "configure" -+#line 15456 "configure" - int main() - { - // NB: _Atomic_word not necessarily int. -@@ -15492,7 +15489,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15495 "configure" -+#line 15492 "configure" - int main() - { - typedef long long atomic_type; -@@ -15571,7 +15568,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15574 "configure" -+#line 15571 "configure" - int main() - { - _Decimal32 d1; -@@ -15613,7 +15610,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # unnecessary for this test. - - cat > conftest.$ac_ext << EOF --#line 15616 "configure" -+#line 15613 "configure" - template - struct same - { typedef T2 type; }; -@@ -15647,7 +15644,7 @@ $as_echo "$enable_int128" >&6; } - rm -f conftest* - - cat > conftest.$ac_ext << EOF --#line 15650 "configure" -+#line 15647 "configure" - template - struct same - { typedef T2 type; }; -@@ -52075,6 +52072,90 @@ $as_echo "$ac_ld_relro" >&6; } - - fi - ;; -+ -+ *-haiku*) -+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ -+ -+ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h -+ -+ -+ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ASINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_CEILF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_COSHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_EXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FABSF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITE 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FMODF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOGF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_MODFF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SINHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TANHF 1" >>confdefs.h -+ -+ $as_echo "#define HAVE_TLS 1" >>confdefs.h -+ -+ ;; -+ - *-hpux*) - SECTION_FLAGS='-ffunction-sections -fdata-sections' - --- -2.1.0 - -From 8db0be72e0de7b60f741796967bf6f2ef59fe630 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 16:32:32 +0200 -Subject: [PATCH 3/3] Haiku: disable -fno-PIE as this fails on x86_64. - ---- - gcc/Makefile.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 4ecc2c7..bc5b741 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -259,7 +259,7 @@ LINKER_FLAGS = $(CFLAGS) - endif - - # We don't want to compile the compilers with -fPIE, it make PCH fail. --COMPILER += @NO_PIE_CFLAGS@ -+#COMPILER += @NO_PIE_CFLAGS@ - - # Link with -no-pie since we compile the compiler with -fno-PIE. - LINKER += @NO_PIE_FLAG@ -@@ -757,8 +757,8 @@ CC_FOR_BUILD = @CC_FOR_BUILD@ - CXX_FOR_BUILD = @CXX_FOR_BUILD@ - BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE - BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE --BUILD_CFLAGS += @NO_PIE_CFLAGS@ --BUILD_CXXFLAGS += @NO_PIE_CFLAGS@ -+#BUILD_CFLAGS += @NO_PIE_CFLAGS@ -+#BUILD_CXXFLAGS += @NO_PIE_CFLAGS@ - - # Native compiler that we use. This may be C++ some day. - COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) --- -2.1.0 - diff --git a/sys-devel/gcc/patches/gcc6-6.0.0_2015_11_08.patchset b/sys-devel/gcc/patches/gcc6-6.0.0_2015_11_08.patchset deleted file mode 100644 index ef14db3cc..000000000 --- a/sys-devel/gcc/patches/gcc6-6.0.0_2015_11_08.patchset +++ /dev/null @@ -1,35 +0,0 @@ -From 0f079ce672177b678b40d19c28e12f18f9bbbcda Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= -Date: Mon, 27 Jul 2015 16:32:32 +0200 -Subject: Haiku: disable -fno-PIE as this fails on x86_64. - - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 6bac55d..51cb015 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -264,7 +264,7 @@ NO_PIE_CFLAGS = @NO_PIE_CFLAGS@ - NO_PIE_FLAG = @NO_PIE_FLAG@ - - # We don't want to compile the compilers with -fPIE, it make PCH fail. --COMPILER += $(NO_PIE_CFLAGS) -+#COMPILER += $(NO_PIE_CFLAGS) - - # Link with -no-pie since we compile the compiler with -fno-PIE. - LINKER += $(NO_PIE_FLAG) -@@ -764,9 +764,9 @@ NO_PIE_CFLAGS_FOR_BUILD = @NO_PIE_CFLAGS_FOR_BUILD@ - NO_PIE_FLAG_FOR_BUILD = @NO_PIE_FLAG_FOR_BUILD@ - BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE - BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE --BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ --BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) --BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_NO_PIE_CFLAGS = @BUILD_NO_PIE_CFLAGS@ -+#BUILD_CFLAGS += $(BUILD_NO_PIE_CFLAGS) -+#BUILD_CXXFLAGS += $(BUILD_NO_PIE_CFLAGS) - - # Native compiler that we use. This may be C++ some day. - COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) --- -2.2.2 -