From ad2d0bf02353d47f388f4ca480b343fcd4a33537 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 10 Aug 2014 08:39:58 +0200 Subject: [PATCH] Add recipe for arm_none_eabi_gcc * Do NOT use for Haiku development. This is a GCC without standard libraries for bare-metal programming on embedded platforms. --- .../arm_none_eabi_gcc-4.8.2_2014_03_20.recipe | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sys-devel/arm_none_eabi_gcc/arm_none_eabi_gcc-4.8.2_2014_03_20.recipe diff --git a/sys-devel/arm_none_eabi_gcc/arm_none_eabi_gcc-4.8.2_2014_03_20.recipe b/sys-devel/arm_none_eabi_gcc/arm_none_eabi_gcc-4.8.2_2014_03_20.recipe new file mode 100644 index 000000000..5c323a0c1 --- /dev/null +++ b/sys-devel/arm_none_eabi_gcc/arm_none_eabi_gcc-4.8.2_2014_03_20.recipe @@ -0,0 +1,126 @@ +SUMMARY="C/C++ cross-compiler for ARM" +DESCRIPTION=" +Compiler for ARM processors. +" +HOMEPAGE="http://gcc.gnu.org" + +srcGitRev="c20a732df8f8b6d0f32c872817f3a0498a5c4761" +SRC_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="6d3b677cd8ef777bf6fb3186a15b5122e46345595a996370325c758b3d8a4ab6" +SRC_FILENAME="$portVersionedName.tar.gz" +REVISION="1" +LICENSE=" + GNU GPL v2 + GNU LGPL v2 + " +COPYRIGHT="1988-2013 Free Software Foundation, Inc." + + +ARCHITECTURES="x86 x86_64 arm" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +targetArch="arm-none-eabi" +targetU="arm_none_eabi" + +PROVIDES=" + ${targetU}_gcc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_c++$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_cc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_cpp$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_g++$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_gcc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_gcc_4.8.2$secondaryArchSuffix = $portVersion compat >= 4 + cmd:${targetU}_gcov$secondaryArchSuffix = $portVersion compat >= 4 + lib:${targetU}_libstdc++$secondaryArchSuffix = $portVersion compat >= 4 + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + cmd:${targetU}_as$secondaryArchSuffix + lib:libstdc++$secondaryArchSuffix + " +BUILD_REQUIRES=" + cmd:${targetU}_as$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + cmd:awk + cmd:bison + 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/${targetArch}" +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 + + # Setting a quoted string in an environment variable is ugly (the quotes + # are removed at various stages and need an absurd amount of escaping), so + # let's use a file and --include instead. + echo '#define LIBRARY_PATH_ENV "ARM_LIBRARY_PATH"' > haiku_host.h + + CXXFLAGS="-O2 -include $objectsDir/haiku_host.h" \ + CFLAGS="-O2 -U_FORTIFY_SOURCE" "$sourceDir/configure" \ + --build=$effectiveTargetMachineTriple \ + --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ + --docdir=$docDir --disable-nls --disable-libssp --with-gnu-ld \ + --enable-languages=c,c++ --enable-lto --enable-frame-pointer \ + --enable-multilib --disable-shared \ + --without-headers --with-newlib \ + --with-pkgversion=$(echo $portVersion | cut -c 7-) --target=$targetArch + + make $jobArgs all-gcc all-target-libgcc +} + +INSTALL() +{ + cd $objectsDir + + make install-gcc install-target-libgcc + + ### Symlinks ############################################## + + echo "Creating required symlinks" + + # make all tools available via default paths + mkdir -p $binDir + for f in c++ cc cpp g++ gcc gcov; do + symlinkRelative -sfn $installDir/bin/$targetArch-$f $binDir + done + + ### Cleanup ############################################### + + echo "Cleanup" + rm -rf $installDir/info + rm -rf $installDir/share +}