diff --git a/package/base/gcc/apply-protector.sh b/package/base/gcc/apply-protector.sh new file mode 100644 index 000000000..b6f712e3e --- /dev/null +++ b/package/base/gcc/apply-protector.sh @@ -0,0 +1,20 @@ + +# only try to apply protector if available +pfile=$( echo "$3" | grep protector | tr ' ' '\t' | tr -s '\t' | cut -f2 ) +if [ "$pfile" ] ; then + tar --use-compress-program=bzip2 \ + -xf $archdir/${pfile/.gz/.bz2} + + # Patch protector.dif a bit to apply against current gcc-3 + #[ $2 = gcc3 ] && patch -p1 < $1/package/base/$2/protector-hotfix.diff + + # be careful if you enable this, you have to respect $pkg. + # Set -fstack-protector as default? + # [ $ROCKCFG_PKG_GCC[23]_STACKPRO = 1 ] && patch -p0 < protectonly.dif + + patch -p0 < protector.dif + mv protector.{c,h} gcc/ +else + echo "No stack-protector available for $2 ..." +fi + diff --git a/package/base/gcc/config-300.hlp b/package/base/gcc/config-300.hlp new file mode 100644 index 000000000..0a873f431 --- /dev/null +++ b/package/base/gcc/config-300.hlp @@ -0,0 +1,54 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/config-300.hlp +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +MENU_COMPILER + Here you can choose which compiler to use for various tasks. + +ROCKCFG_DEFAULT_CC + The options controls the default compiler for C programs. + +ROCKCFG_DEFAULT_KCC + The options controls the default compiler for the kernel. + +ROCKCFG_DEFAULT_CXX + The options controls the default compiler for C++ programs. + +ROCKCFG_DEFAULT_F77 + The optiosn controls the default compiler Fortran-77 programs. + +ROCKCFG_PKG_GCC_STACKPRO + Please check here to use the GCC Stack Smashing Protector in all + gcc versions for which it is available. + This will help to prevent buffer overflows. + +ROCKCFG_PKG_GCC2_NO_CHILL + Please check here if you don't want to build the gcc2 CHILL compiler. + +ROCKCFG_PKG_GCC32_NO_JAVA + Please check here if you don't want to build the gcc32 JAVA compiler. + +ROCKCFG_PKG_GCC33_NO_JAVA + Please check here if you don't want to build the gcc33 JAVA compiler. + +ROCKCFG_PKG_GCC34_NO_JAVA + Please check here if you don't want to build the gcc34 JAVA compiler. + diff --git a/package/base/gcc/config-300.in b/package/base/gcc/config-300.in new file mode 100644 index 000000000..7c76dc964 --- /dev/null +++ b/package/base/gcc/config-300.in @@ -0,0 +1,111 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc/config-300.in +# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +if pkgcheck gcc X +then + menu_begin MENU_COMPILER 'GCC Compiler Options' + + bool 'Building gcc 2.x package' ROCKCFG_PKG_GCC_GCC2 0 + bool 'Building gcc 3.2.x package' ROCKCFG_PKG_GCC_GCC32 0 + bool 'Building gcc 3.3.x package' ROCKCFG_PKG_GCC_GCC33 1 + bool 'Building gcc 3.4.x package' ROCKCFG_PKG_GCC_GCC34 0 + + l="" + if [ $ROCKCFG_PKG_GCC_GCC2 = 1 ]; then pkgfork gcc gcc2; l="$l gcc2"; fi + if [ $ROCKCFG_PKG_GCC_GCC32 = 1 ]; then pkgfork gcc gcc32; l="$l gcc32"; fi + if [ $ROCKCFG_PKG_GCC_GCC33 = 1 ]; then pkgfork gcc gcc33; l="$l gcc33"; fi + if [ $ROCKCFG_PKG_GCC_GCC34 = 1 ]; then pkgfork gcc gcc34; l="$l gcc34"; fi + pkgremove gcc + + d="none" + if [ $ROCKCFG_PKG_GCC_GCC2 = 1 ]; then d="gcc2"; fi + if [ $ROCKCFG_PKG_GCC_GCC34 = 1 ]; then d="gcc34"; fi + if [ $ROCKCFG_PKG_GCC_GCC32 = 1 ]; then d="gcc32"; fi + if [ $ROCKCFG_PKG_GCC_GCC33 = 1 ]; then d="gcc33"; fi + + k=""; for x in $l; do + k="$k $x Use_${x}_as_standard_C_compiler" + done + choice ROCKCFG_DEFAULT_CC $d $k + + k=""; for x in $l; do + k="$k $x Use_${x}_as_standard_Kernel_C_compiler" + done + choice ROCKCFG_DEFAULT_KCC $d $k + + k=""; for x in $l; do + k="$k $x Use_${x}_as_standard_C++_compiler" + done + choice ROCKCFG_DEFAULT_CXX $d $k + + k=""; for x in $l; do + k="$k $x Use_${x}_as_standard_Fortran_compiler" + done + choice ROCKCFG_DEFAULT_F77 $d $k + + k=""; for x in gcc2 gcc32 gcc33 gcc34; do + if [ "$ROCKCFG_DEFAULT_CC" != "$x" ]; then + if [ "$ROCKCFG_DEFAULT_CXX" != "$x" ]; then + k="$k / gcc=$x / s/^\(..\).../\1---/;" + else + k="$k / gcc=$x / s/^\(..\)../\1--/;" + fi + fi + done + pkgfilter sed -e "$k" + + bool 'Use Stack-Smashing Protector when available' \ + ROCKCFG_PKG_GCC_STACKPRO 0 + %include package/*/*/subconfig-gcc.in + + if pkgcheck gcc=gcc2 X; then + comment ' ' + comment '--- GCC 2.x options' + bool 'Do not build CHILL compiler' \ + ROCKCFG_PKG_GCC2_NO_CHILL 0 + %include package/*/*/subconfig-gcc2.in + fi + if pkgcheck gcc=gcc32 X; then + comment ' ' + comment '--- GCC 3.2.x options' + bool 'Do not build JAVA compiler' \ + ROCKCFG_PKG_GCC32_NO_JAVA 0 + %include package/*/*/subconfig-gcc32.in + fi + if pkgcheck gcc=gcc33 X; then + comment ' ' + comment '--- GCC 3.3.x options' + bool 'Do not build JAVA compiler' \ + ROCKCFG_PKG_GCC33_NO_JAVA 0 + %include package/*/*/subconfig-gcc33.in + fi + if pkgcheck gcc=gcc34 X; then + comment ' ' + comment '--- GCC 3.4.x options' + bool 'Do not build JAVA compiler' \ + ROCKCFG_PKG_GCC34_NO_JAVA 0 + %include package/*/*/subconfig-gcc34.in + fi + + menu_end +fi + diff --git a/package/base/gcc/gcc.conf b/package/base/gcc/gcc.conf new file mode 100644 index 000000000..9104a79bd --- /dev/null +++ b/package/base/gcc/gcc.conf @@ -0,0 +1,398 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc/gcc.conf +# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +pkg_gcc_version=${xpkg#gcc} +pkg_gcc_target=${arch_target} +pkg_gcc_cross="" + +case "$xpkg" in + gcc?-cross-*|gcc??-cross-*) + pkg_gcc_cross="${xpkg#gcc*-cross-}" + pkg_gcc_version=${pkg_gcc_version%-cross-*} + pkg_gcc_target="${pkg_gcc_cross}-unknown-linux-gnu" + + var_append confopt " " "--target=$pkg_gcc_target" + echo_status "Preparing to build a cross-gcc package for $pkg_gcc_cross." + ;; + gcc?|gcc??) + ;; + *) + echo_error "Not supported $pkg package name: $xpkg" + exit 1 + ;; +esac + +create_links() { + for x ; do + if [ -f "$root/$prefix/bin/$x-${pkg_gcc_version}" ] ; then + rm -vf $root/$prefix/bin/$x + ln -vs $x-${pkg_gcc_version} $root/$prefix/bin/$x + fi + x="${pkg_gcc_target}-$x" + if [ -f $root/$prefix/bin/$x-${pkg_gcc_version} ] ; then + rm -vf $root/$prefix/bin/$x + ln -vs $x-${pkg_gcc_version} $root/$prefix/bin/$x + fi + done +} + +custmain() { + # Apply the respective gcc-2 or gcc-3 stack protector patch. + . $base/package/base/gcc/apply-protector.sh $base gcc${pkg_gcc_version} "$desc_D" + + hook_eval preconf + + # In stage 1 we only build a normal c compiler (no c++, etc) + # + if [ $stagelevel -le 1 ] ; then + echo 'Setting LANGUAGES="c" in Makefile.in.' + sed -i -e 's/LANGUAGES="[^"]*"/LANGUAGES="c"/g' \ + Makefile.in + elif [ "$ROCKCFG_DEBUG" = 1 ] ; then + if [ -f libstdc++*/configure ] ; then + echo "Setting DEBUG_FLAGS='-s' in libstdc++ configure." + ( cd libstdc++* + sed -i -e "s/DEBUG_FLAGS='-g'/DEBUG_FLAGS='-s'/g" \ + configure ) + fi + MAKE="$MAKE LIBGCC2_DEBUG_CFLAGS=-s LDFLAGS=-Wl,-s JCFLAGS=-s" + fi + + # GCC rebuilds itself using the xgcc which is build first. xgcc + # should also use the cc-wrapper. It might be better to patch big + # ammounts of the gcc sources - but this should also do the job. + # + export CFLAGS="$(exec -a echo bash \ + -c ". gcc-${pkg_gcc_version}" 2> /dev/null)" + export CXXFLAGS="$(exec -a echo bash \ + -c ". g++-${pkg_gcc_version}" 2> /dev/null)" + # + echo "Setting \$CFLAGS to '$CFLAGS'." + echo "Setting \$CXXFLAGS to '$CXXFLAGS'." + + mkdir objdir ; cd objdir + + # We install binaries, info-files and man-pages in temporary + # directories so we can rename it (adding version suffix) before + # moving them to their final directories. + # + makeinstopt="" + for x in bin info man ; do + mkdir -p $builddir/inst_$x + makeinstopt="$makeinstopt ${x}dir=$builddir/inst_$x" + done + + # NAMING VARIANT!? INTRODUCED IN GCC-3.2.1 + if [ $arch = powerpc ] ; then + ln -s ppc-nocross-linux-gnu powerpc-nocross-linux-gnu + fi + + # add the multi-lib config + if [ "$ROCKCFG_MULTILIB" = 1 ] ; then + confopt="$confopt --enable-multilib" + else + confopt="$confopt --disable-multilib" + fi + + # In stage 1 everything is a little bit more complicated + # + if [ $stagelevel -le 1 ] ; then + + create_config_cache > config.cache + eval $configprefix ../configure $confopt --enable-languages=c + + # creating native libiberty for build system + # (needed to build helper apps like gengenrtl) + # + mkdir -p $arch_build ; cd $arch_build + CC=$BUILDCC ../../configure + make all-libiberty ; cd .. + + MAKE="$MAKE LANGUAGES=c" + + # GCC thinks it can share object files between build and + # target if the CPUs are compatible, which isn't true if we + # are cross-building from glibc to dietlibc. So we also build + # helper programs with dietlibc if this is not a cross build + # between cpu architectures. + # + if ! [ "$pkg_dietlibc_useit" = 1 -a "$ROCKCFG_CROSSBUILD" = 0 ] + then + MAKE="$MAKE CC_FOR_BUILD='$BUILDCC'" + fi + + # Fixincludes doesn't run when cross-building, but we + # need a syslimits.h for a working gcc + # + mkdir -p gcc/include + echo '#include_next ' > gcc/include/syslimits.h + + hook_eval premake + + # Build and install + # + eval $MAKE prefix=/$prefix libdir=/$prefix/lib + hook_eval inmake + eval $MAKE prefix=$root/$prefix $makeinstopt install + + # This stuff needs manual installation + # + echo "Creating /$prefix/${pkg_gcc_target} ..." + mkdir -p $root/$prefix/${pkg_gcc_target}/lib + cd $root/$prefix/${pkg_gcc_target}/lib + for x in Mcrt1.o crti.o gcrt1.o crt1.o crtn.o + do ln -sf ../../lib/$x . ; done + if [ -f ../../../lib/ld-linux-$arch_machine.so.2 ] ; then + ln -sf ../../../lib/ld-linux-$arch_machine.so.2 . + elif [ -f ../../../lib/ld-linux.so.2 ] ; then + ln -sf ../../../lib/ld-linux.so.2 . + fi + else + + if [ $xpkg = gcc2 -a "$ROCKCFG_PKG_GCC2_NO_CHILL" = 1 ] ; then + # gcc-2.x contains no java compiler + confopt="$confopt --enable-languages=c,c++,objc,f77" + elif [ "$ROCKCFG_DIETLIBC_ALL" = 1 -o "$ROCKCFG_DIETLIBC_gcc3" = 1 ] ; then + # FIXME: c++ and java are not working with dietlibc + confopt="$confopt --enable-languages=c,objc" + elif [ $xpkg = gcc32 -a "$ROCKCFG_PKG_GCC32_NO_JAVA" = 1 ] || \ + [ $xpkg = gcc33 -a "$ROCKCFG_PKG_GCC33_NO_JAVA" = 1 ] || \ + [ $xpkg = gcc34 -a "$ROCKCFG_PKG_GCC34_NO_JAVA" = 1 ]; then + # gcc-3.x contains no chill compiler + confopt="$confopt --enable-languages=c,c++,objc,f77" + elif [ "$arch" = mips ] ; then + # FIXME: MIPS doesn't like the Java compiler + confopt="$confopt --disable-libgcj" + fi + + # See http://gcc.gnu.org/gcc-3.2/c++-abi.html + # and http://www.codesourcery.com/cxx-abi/. + if [ $xpkg != gcc2 ] ; then + confopt="$confopt --enable-__cxa_atexit" + fi + + # Set enable-shared + if [ "$diet_dynamic_static" == "static" ] ; then + confopt="$confopt --enable-shared=no" + else + confopt="$confopt --enable-shared=yes" + fi + + # Configure, build and install as usual + # + eval $configprefix ../configure $confopt --with-gnu-as \ + --enable-version-specific-runtime-libs \ + --with-gnu-ld --enable-threads=posix + + hook_eval premake + eval "$MAKE GCJFLAGS=\"$CXXFLAGS\" all" + hook_eval inmake + eval "$MAKE $makeinstopt install" + + # Fix the location of any improperly installed (F77) libraries + mv -vf $root/$prefix/lib/$gcc_lib_dir/../lib* \ + $root/$prefix/lib/$gcc_lib_dir || true + fi + hook_eval postmake + + # Rename and install binaries + # + cd $builddir/inst_bin ; mkdir -p $root/$prefix/bin + for y in c++ c++filt g++ cpp f77 g77 gcc gcov ; do + for x in $y ${pkg_gcc_target}-$y ; do + if [ -f "$x" ] ; then + mv -v $x $root/$prefix/bin/${x}-${pkg_gcc_version} + fi + done + done + + # gcc2 does not contain an own c++filt ... - so use the binutils one + # + if [ "$xpkg" = gcc2 ] ; then + ln -vsf $root/$prefix/bin/c++filt-2 c++filt-binutils + fi + + # Rename and install info-files + # + cd $builddir/inst_info ; mkdir -p $root/$prefix/info + for x in * ; do + [ ! -f $x ] && continue # e.g. if $x becomes '*' somehow + fn=$( echo $x | sed "s,\([a-z0-9]*\),\1-${pkg_gcc_version}," ) + infoname=$( echo $x | sed "s,\([a-z0-9]*\).*,\1," ) + echo "$x -> $root/$prefix/info/$fn" + sed "s,$infoname.info,$infoname-${pkg_gcc_version}.info," < $x \ + > $root/$prefix/info/$fn + if [ $ROCKCFG_DEFAULT_CC = $xpkg ] ; then + cp -v $x $root/$prefix/info/$x + fi + true + done + + # Rename and install man-pages + # + cd $builddir/inst_man/man1 + mkdir -p $root/$prefix/man/man1 + for x in * ; do + [ ! -f $x ] && continue # e.g. if $x becomes '*' somehow + mv -v $x $root/$prefix/man/man1/${x%.1}-${pkg_gcc_version}.1 + if [ $ROCKCFG_DEFAULT_CC = $xpkg ] ; then + ln -sf ${x%.1}-${pkg_gcc_version}.1 $root/$prefix/man/man1/$x + fi + true + done + hook_eval postdoc + + # Create various symlinks for cc, c++, cpp and f77. + # + if [ $ROCKCFG_DEFAULT_CC = $xpkg ] ; then + create_links gcc cpp gcov + rm -f $root/$prefix/bin/cc + if [ "$ROCKCFG_DIETLIBC_ALL" = 1 ]; then + cat <<- 'EOT' > $root/$prefix/bin/cc + #!/bin/sh + exec diet gcc "$@" + EOT + chmod +x $root/$prefix/bin/cc + else + ln -svf gcc $root/$prefix/bin/cc + fi + ln -vsf ../$prefix/bin/cpp $root/lib/cpp + fi + ln -sf gcc-${pkg_gcc_version} $root/$prefix/bin/kcc-${pkg_gcc_version} + if [ $ROCKCFG_DEFAULT_KCC = $xpkg ] ; then + ln -vsf gcc-${pkg_gcc_version} $root/$prefix/bin/kcc + fi + if [ $ROCKCFG_DEFAULT_CXX = $xpkg ] ; then + create_links c++ c++filt g++ + fi + if [ $ROCKCFG_DEFAULT_F77 = $xpkg ] ; then + create_links g77 + if [ -f $root/$prefix/bin/g77 ] ; then + rm -vf $root/$prefix/bin/f77 + ln -vsf g77 $root/$prefix/bin/f77 + fi + fi + + # Create symlinks for runtime libraries so they can be found by + # the dynamic loader and force rebuilding of the wrapper links + # + if [ $stagelevel -gt 1 ] ; then + ( cd $root/$prefix/lib ; ln -vfs ${gcc_lib_dir}/*.so.* . ; ) + rm -fv $base/build/$ROCKCFG_ID/ROCK/$toolsdir/.lastupdate + fi + true +} + +gcc_cross() { + # Apply the respective gcc-2 or gcc-3 stack protector patch. + . $base/package/base/gcc/apply-protector.sh $base gcc${pkg_gcc_version} "$desc_D" + + mkdir -p $root/$prefix/$pkg_gcc_target/{bin,lib} + + if [ "$stagelevel" -eq 0 ] + then + rm -f $root/$prefix/$pkg_gcc_target/include + if [ -f $root/$prefix/include/stdio.h ]; then + ln -s ../include $root/$prefix/$pkg_gcc_target/include + elif [ -f $root/$prefix/diet-include/stdio.h ]; then + ln -s ../diet-include $root/$prefix/$pkg_gcc_target/include + fi + + bindir="$root/$prefix/crosscc" + mkdir -p $root/$prefix/crosscc + fi + + [ "$pkg_gcc_version" != "2" ] && \ + confopt="$confopt --enable-languages=c" + + mkdir objdir ; cd objdir ; hook_eval preconf + eval ../configure --program-prefix=${pkg_gcc_target}- --disable-cpp \ + --disable-shared --disable-multilib $confopt + make -C libiberty + if [ -d texinfo ] ; then make -C texinfo ; fi + + hook_eval premake + if [ "$xpkg" = "gcc2" ] ; then + make -C gcc all LANGUAGES="c" + hook_eval inmake + make -C gcc install LANGUAGES="c" + else + # workaround for at least gcc-3.2.3 + mkdir -p $root/$prefix/lib/${gcc_lib_dir} + make -C gcc all + hook_eval inmake + make -C gcc install + fi + hook_eval postmake + + ${pkg_gcc_target}-ranlib \ + $root/$prefix/lib/${gcc_lib_dir}/libgcc.a + + if [ "$stagelevel" -eq 0 ]; then + x="$root/$prefix/crosscc/${arch_target}" + ln -svf ${arch_target}-gcc $x-gcc-${pkg_gcc_version} + ln -svf ${arch_target}-gcc $x-kcc-${pkg_gcc_version} + ln -svf ${arch_target}-gcc $x-kcc + ln -svf ${arch_target}-gcc $x-cc + rm -vf "$root/$prefix/crosscc/gcc" + rm -vf "$root/$prefix/crosscc/gcj" + + cd $root/$prefix/$arch_target/lib + for x in Mcrt1.o crt1.o crti.o crtn.o gcrt1.o \ + libc.a libc.so libc_nonshared.a + do ln -fvs $root/../../usr/lib/$x $x ; done + + for x in ld-linux{,-$arch_machine}.so.2 ld.so.1 libc.so.{6,6.1} + do ln -fvs $root/../../lib/$x $x ; done + + echo "Adapting gcc specs file..." + cd $root/$prefix/lib/${gcc_lib_dir} + mv specs specs.orig + + # Hint for the reader: + # The options are listed in _inverse_ order here. + x="$base/build/$ROCKCFG_ID" + tr '\n' '@' < specs.orig | sed \ + -e "s|@\\*link:@|@*link:@-L $x/../tools.cross/$arch_target/lib |" \ + -e "s|@\\*link:@|@*link:@-L $x/usr/$arch_target/lib |" \ + -e "s|@\\*link:@|@*link:@-L $x/usr/local/lib |" \ + -e "s|@\\*link:@|@*link:@-L $x/usr/lib |" \ + -e "s|@\\*link:@|@*link:@-L $x/lib |" \ + -e "s|@\\*link:@|@*link:@-rpath-link $x/lib |" \ + -e "s|@\\*cpp:@|@*cpp:@-I $x/usr/$arch_target/include |" \ + -e "s|@\\*cpp:@|@*cpp:@-I $x/usr/local/include |" \ + -e "s|@\\*cpp:@|@*cpp:@-I $x/usr/include |" \ + | tr '@' '\n' > specs + + rm -f $root/$prefix/.lastupdate + fi +} + +if [ "$stagelevel" -eq 0 -o -n "$pkg_gcc_cross" ] +then + custmain="gcc_cross" +else + custmain="custmain" +fi + +gcc_lib_dir="gcc-lib/${pkg_gcc_target}/${ver%%-*}" + diff --git a/package/base/gcc/gcc.desc b/package/base/gcc/gcc.desc new file mode 100644 index 000000000..197a4fbf5 --- /dev/null +++ b/package/base/gcc/gcc.desc @@ -0,0 +1,71 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/base/gcc/gcc.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] The GNU Compiler Collection (aka GNU C Compiler) + +[T] This package contains the GNU Compiler Collection. It includes compilers +[T] for the languages C, C++, Objective C, Fortran 77, Java and others ... +[T] +[T] This GCC contains the Stack-Smashing Protector Patch which can be enabled +[T] with the -fstack-protector command-line option. More information about it +[T] ca be found at http://www.research.ibm.com/trl/projects/security/ssp/ . + +[U] http://gcc.gnu.org/ The GCC Homepage + +[A] The GNU Project / FSF +[M] Clifford Wolf + +[C] base/development +[F] DIETLIBC CC KCC CXX F77 + +[E] group compiler + +[L] GPL +[S] Stable +[V] 0000 +[P] X 012--5---9 102.300 + +#if xpkg == gcc2.* +[V] 2.95.3 +[D] 354985877 gcc-2.95.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-2.95.3/ +[D] 2603145003 protector-2.95.3-23.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc2_95_3/ +#endif + +#if xpkg == gcc32.* +[V] 3.2.3 +[D] 4060808826 gcc-3.2.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.2.3/ +[D] 2790839069 protector-3.2.2-10.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_2_2/ +#endif + +#if xpkg == gcc33.* +[V] 3.3.3 +[D] 124205161 gcc-3.3.3.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.3.3/ +[D] 3472291992 protector-3.3-7.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_3/ +#endif + +#if xpkg == gcc34.* +[V] 3.4.1 +[D] 0 gcc-3.4.1.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.4.1/ +[D] 0 protector-3.4-2.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_4/ +#endif + diff --git a/package/base/gcc/gcc2/gcc33_support.patch b/package/base/gcc/gcc2/gcc33_support.patch new file mode 100644 index 000000000..c85d0bbd8 --- /dev/null +++ b/package/base/gcc/gcc2/gcc33_support.patch @@ -0,0 +1,35 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc2/gcc33_support.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./gcc/ch/loop.c.orig 2003-08-03 12:26:04.000000000 -0400 ++++ ./gcc/ch/loop.c 2003-08-03 12:28:30.000000000 -0400 +@@ -318,8 +318,8 @@ + (associated with all iterators). + + NOTE: Z.200, section 10.1 says that a block is ... +- "the actions statement list in a do action, including any +- loop counter and while control". This means that an exp- ++ the actions statement list in a do action, including any ++ loop counter and while control. This means that an exp- + ression in a WHILE control can include references to the + loop counters created for the loop''s exclusive use. + Example: diff --git a/package/base/gcc/gcc2/no-install-libiberty.patch b/package/base/gcc/gcc2/no-install-libiberty.patch new file mode 100644 index 000000000..3f54fe3d9 --- /dev/null +++ b/package/base/gcc/gcc2/no-install-libiberty.patch @@ -0,0 +1,35 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc2/no-install-libiberty.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./libiberty/Makefile.in.orig 2003-01-07 09:16:57.000000000 +0100 ++++ ./libiberty/Makefile.in 2003-01-07 09:17:19.000000000 +0100 +@@ -148,10 +148,6 @@ + install: install_to_$(INSTALL_DEST) install-subdir + + install_to_libdir: all +- $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n +- ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n ) +- mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n $(libdir)$(MULTISUBDIR)/$(TARGETLIB) +- @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install + + install_to_tooldir: all + $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n diff --git a/package/base/gcc/gcc2/protector-docs.patch b/package/base/gcc/gcc2/protector-docs.patch new file mode 100644 index 000000000..cae6ca230 --- /dev/null +++ b/package/base/gcc/gcc2/protector-docs.patch @@ -0,0 +1,74 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc2/protector-docs.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + + +Add documentation (man and info) to protector.patch. + +--- ./gcc/gcc.1.orig Tue Oct 16 08:19:36 2001 ++++ ./gcc/gcc.1 Tue Oct 16 08:27:46 2001 +@@ -515,6 +515,7 @@ + \-fshared\-data + \-fshort\-enums + \-fshort\-double ++\-fstack\-protector + \-fvolatile + \-fvolatile\-global + \-fverbose\-asm +@@ -3856,6 +3857,12 @@ + .B no\-\c + \&\|' or adding + it. ++.TP ++.B \-fstack\-protector ++Enable the Stack-Smashing Protector ( ++.B http://www.trl.ibm.com/projects/security/ssp/ ++). This option is only available in ROCK Linux (and probably ++some other distributions). It's not a standard GCC option. + .TP + .B \-fnonnull\-objects + Assume that objects reached through references are not null +--- ./gcc/invoke.texi.orig Tue Oct 16 08:38:25 2001 ++++ ./gcc/invoke.texi Tue Oct 16 08:38:17 2001 +@@ -421,8 +421,8 @@ + -fno-common -fno-ident -fno-gnu-linker + -fpcc-struct-return -fpic -fPIC + -freg-struct-return -fshared-data -fshort-enums +--fshort-double -fvolatile -fvolatile-global -fvolatile-static +--fverbose-asm -fpack-struct -fstack-check ++-fshort-double -fstack-protector -fvolatile -fvolatile-global ++-fvolatile-static -fverbose-asm -fpack-struct -fstack-check + -fargument-alias -fargument-noalias + -fargument-noalias-global + -fleading-underscore +@@ -6147,6 +6147,12 @@ + it. + + @table @code ++@item -fstack-protector ++Enable the Stack-Smashing Protector ++(http://www.trl.ibm.com/projects/security/ssp/). ++This option is only available in ROCK Linux (and probably ++some other distributions). It's not a standard GCC option. ++ + @item -fexceptions + Enable exception handling. Generates extra code needed to propagate + exceptions. For some targets, this implies generation of frame unwind diff --git a/package/base/gcc/gcc32/fixincl.patch b/package/base/gcc/gcc32/fixincl.patch new file mode 100644 index 000000000..ef0552f5c --- /dev/null +++ b/package/base/gcc/gcc32/fixincl.patch @@ -0,0 +1,33 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/fixincl.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./gcc/fixinc/fixincl.sh.orig Sat May 11 16:11:15 2002 ++++ ./gcc/fixinc/fixincl.sh Sat May 11 16:12:00 2002 +@@ -143,6 +143,8 @@ + INPUTLIST="$@" + fi + ++INPUTLIST="" ++ + for INPUT in ${INPUTLIST} ; do + + cd ${ORIGDIR} diff --git a/package/base/gcc/gcc32/gcc-Os-fix.patch b/package/base/gcc/gcc32/gcc-Os-fix.patch new file mode 100644 index 000000000..080d7dcc4 --- /dev/null +++ b/package/base/gcc/gcc32/gcc-Os-fix.patch @@ -0,0 +1,27 @@ +This patch is extracted from +http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00791.html + +- Juergen "George" Sawinski + +--- gcc-3.2.3/gcc/cfgcleanup.c.orig 2004-01-12 01:03:22.000000000 +0100 ++++ gcc-3.2.3/gcc/cfgcleanup.c 2004-01-12 01:04:59.000000000 +0100 +@@ -1640,7 +1640,7 @@ + /* If the jump insn has side effects, + we can't kill the edge. */ + && (GET_CODE (b->end) != JUMP_INSN +- || (flow2_completed ++ || (reload_completed + ? simplejump_p (b->end) + : onlyjump_p (b->end))) + && merge_blocks (s, b, c, mode)) +--- gcc-3.2.3/gcc/cfgrtl.c.orig 2004-01-12 01:03:40.000000000 +0100 ++++ gcc-3.2.3/gcc/cfgrtl.c 2004-01-12 01:06:41.000000000 +0100 +@@ -674,7 +674,7 @@ + if (tmp || !onlyjump_p (insn)) + return false; + +- if ((!optimize || flow2_completed) && tablejump_p (insn)) ++ if ((!optimize || reload_completed) && tablejump_p (insn)) + return false; + + /* Avoid removing branch with side effects. */ diff --git a/package/base/gcc/gcc32/install_so.patch b/package/base/gcc/gcc32/install_so.patch new file mode 100644 index 000000000..752f21fdb --- /dev/null +++ b/package/base/gcc/gcc32/install_so.patch @@ -0,0 +1,39 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/install_so.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./install-sh.orig Sat Mar 23 08:04:55 2002 ++++ ./install-sh Sat Mar 23 08:10:11 2002 +@@ -242,8 +242,12 @@ + + # Now rename the file to the real destination. + +- $doit $rmcmd -f $dstdir/$dstfile && +- $doit $mvcmd $dsttmp $dstdir/$dstfile ++ if echo $dstdir/$dstfile | grep -q 'lib/.*\.so' ; then ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ else ++ $doit $rmcmd -f $dstdir/$dstfile && ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ fi + + fi && + diff --git a/package/base/gcc/gcc32/no-install-libiberty.patch b/package/base/gcc/gcc32/no-install-libiberty.patch new file mode 100644 index 000000000..f18acdba3 --- /dev/null +++ b/package/base/gcc/gcc32/no-install-libiberty.patch @@ -0,0 +1,38 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/no-install-libiberty.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./libiberty/Makefile.in.orig 2003-02-02 22:15:38.000000000 +0100 ++++ ./libiberty/Makefile.in 2003-02-05 22:59:35.000000000 +0100 +@@ -240,12 +240,7 @@ + install: install_to_$(INSTALL_DEST) install-subdir + + install_to_libdir: all +- $(mkinstalldirs) $(DESTDIR)$(libdir)$(MULTISUBDIR) +- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n +- ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) && \ +- $(RANLIB) $(TARGETLIB)n && \ +- mv -f $(TARGETLIB)n $(TARGETLIB) ) +- @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install ++ echo flistdel: $(TARGETLIB) should not install. + + install_to_tooldir: all + $(mkinstalldirs) $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` diff --git a/package/base/gcc/gcc32/no-install-zlib.patch b/package/base/gcc/gcc32/no-install-zlib.patch new file mode 100644 index 000000000..a5400f938 --- /dev/null +++ b/package/base/gcc/gcc32/no-install-zlib.patch @@ -0,0 +1,42 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/no-install-zlib.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./zlib/Makefile.in.orig 2002-11-25 21:28:45.000000000 +0200 ++++ ./zlib/Makefile.in 2003-01-25 15:39:06.000000000 +0200 +@@ -227,15 +227,13 @@ + $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not install."; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not reindex."; \ + else :; fi; \ + done + diff --git a/package/base/gcc/gcc32/protector-docs.patch b/package/base/gcc/gcc32/protector-docs.patch new file mode 100644 index 000000000..09406b026 --- /dev/null +++ b/package/base/gcc/gcc32/protector-docs.patch @@ -0,0 +1,74 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/protector-docs.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./gcc/doc/gcc.1.orig 2002-11-19 19:17:19.000000000 +0100 ++++ ./gcc/doc/gcc.1 2003-01-02 16:08:53.000000000 +0100 +@@ -687,8 +687,8 @@ + \&\-fno-common \-fno-ident \-fno-gnu-linker + \&\-fpcc-struct-return \-fpic \-fPIC + \&\-freg-struct-return \-fshared-data \-fshort-enums +-\&\-fshort-double \-fshort-wchar \-fvolatile +-\&\-fvolatile-global \-fvolatile-static ++\&\-fshort-double \-fstack-protector \-fshort-wchar ++\&\-fvolatile \-fvolatile-global \-fvolatile-static + \&\-fverbose-asm \-fpack-struct \-fstack-check + \&\-fstack-limit-register=\fR\fIreg\fR \fB\-fstack-limit-symbol=\fR\fIsym\fR + \&\fB\-fargument-alias \-fargument-noalias +@@ -8954,6 +8954,12 @@ + instructions to throw exceptions, i.e. memory references or floating + point instructions. It does not allow exceptions to be thrown from + arbitrary signal handlers such as \f(CW\*(C`SIGALRM\*(C'\fR. ++.Ip "\fB\-fstack-protector\fR" 4 ++.IX Item "-fstack-protector" ++Enable the Stack-Smashing Protector ( ++.B http://www.trl.ibm.com/projects/security/ssp/ ++). This option is only available in ROCK Linux (and probably ++some other distributions). It's not a standard GCC option. + .Ip "\fB\-funwind-tables\fR" 4 + .IX Item "-funwind-tables" + Similar to \fB\-fexceptions\fR, except that it will just generate any needed +--- ./gcc/doc/invoke.texi.orig 2002-10-29 17:35:04.000000000 +0100 ++++ ./gcc/doc/invoke.texi 2003-01-02 16:12:11.000000000 +0100 +@@ -676,7 +676,7 @@ + -fno-common -fno-ident -fno-gnu-linker @gol + -fpcc-struct-return -fpic -fPIC @gol + -freg-struct-return -fshared-data -fshort-enums @gol +--fshort-double -fshort-wchar -fvolatile @gol ++-fshort-double -fstack-protector -fshort-wchar -fvolatile @gol + -fvolatile-global -fvolatile-static @gol + -fverbose-asm -fpack-struct -fstack-check @gol + -fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol +@@ -9721,6 +9721,14 @@ + it. + + @table @gcctabopt ++ ++@item -fstack-protector ++@opindex fstack-protector ++Enable the Stack-Smashing Protector ++(http://www.trl.ibm.com/projects/security/ssp/). ++This option is only available in ROCK Linux (and probably ++some other distributions). It's not a standard GCC option. ++ + @item -fexceptions + @opindex fexceptions + Enable exception handling. Generates extra code needed to propagate diff --git a/package/base/gcc/gcc32/sig_pthread_h.patch b/package/base/gcc/gcc32/sig_pthread_h.patch new file mode 100644 index 000000000..25868d815 --- /dev/null +++ b/package/base/gcc/gcc32/sig_pthread_h.patch @@ -0,0 +1,37 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc3/sig_pthread_h.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + + +Wow! It looks like there is a problem in the glibc header structure. +bits/sigthread.h (included by signal.h) needs pthread_t which is not +defined if we don't include pthread.h. + +--- ./gcc/config/i386/linux.h.orig 2002-08-15 14:21:56.000000000 +0200 ++++ ./gcc/config/i386/linux.h 2002-08-15 14:22:20.000000000 +0200 +@@ -221,6 +221,7 @@ + state data appropriately. See unwind-dw2.c for the structs. */ + + #ifdef IN_LIBGCC2 ++#include + #include + #include + #endif diff --git a/package/base/gcc/gcc33/fixincl.patch b/package/base/gcc/gcc33/fixincl.patch new file mode 100644 index 000000000..042dfb29a --- /dev/null +++ b/package/base/gcc/gcc33/fixincl.patch @@ -0,0 +1,33 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc33/fixincl.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./gcc/fixinc/fixincl.sh.orig Sat May 11 16:11:15 2002 ++++ ./gcc/fixinc/fixincl.sh Sat May 11 16:12:00 2002 +@@ -143,6 +143,8 @@ + INPUTLIST="$@" + fi + ++INPUTLIST="" ++ + for INPUT in ${INPUTLIST} ; do + + cd ${ORIGDIR} diff --git a/package/base/gcc/gcc33/install_so.patch b/package/base/gcc/gcc33/install_so.patch new file mode 100644 index 000000000..0715b807c --- /dev/null +++ b/package/base/gcc/gcc33/install_so.patch @@ -0,0 +1,39 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc33/install_so.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./install-sh.orig Sat Mar 23 08:04:55 2002 ++++ ./install-sh Sat Mar 23 08:10:11 2002 +@@ -242,8 +242,12 @@ + + # Now rename the file to the real destination. + +- $doit $rmcmd -f $dstdir/$dstfile && +- $doit $mvcmd $dsttmp $dstdir/$dstfile ++ if echo $dstdir/$dstfile | grep -q 'lib/.*\.so' ; then ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ else ++ $doit $rmcmd -f $dstdir/$dstfile && ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ fi + + fi && + diff --git a/package/base/gcc/gcc33/no-install-libiberty.patch b/package/base/gcc/gcc33/no-install-libiberty.patch new file mode 100644 index 000000000..26d2ce1cb --- /dev/null +++ b/package/base/gcc/gcc33/no-install-libiberty.patch @@ -0,0 +1,39 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc33/no-install-libiberty.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./libiberty/Makefile.in.orig 2003-03-23 06:16:03.000000000 -0400 ++++ ./libiberty/Makefile.in 2003-05-15 17:02:18.000000000 -0400 +@@ -263,10 +263,10 @@ + install: install_to_$(INSTALL_DEST) install-subdir + + install_to_libdir: all +- ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR) +- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n +- ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) +- mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB) ++ #${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR) ++ #$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n ++ #( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) ++ #mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB) + if test -n "${target_header_dir}"; then \ + case "${target_header_dir}" in \ + /*) thd=${target_header_dir};; \ diff --git a/package/base/gcc/gcc33/no-install-zlib.patch b/package/base/gcc/gcc33/no-install-zlib.patch new file mode 100644 index 000000000..0eefac9c0 --- /dev/null +++ b/package/base/gcc/gcc33/no-install-zlib.patch @@ -0,0 +1,42 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc33/no-install-zlib.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./zlib/Makefile.in.orig 2002-11-25 21:28:45.000000000 +0200 ++++ ./zlib/Makefile.in 2003-01-25 15:39:06.000000000 +0200 +@@ -227,15 +227,13 @@ + $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not install."; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not reindex."; \ + else :; fi; \ + done + diff --git a/package/base/gcc/gcc34/fixincl.patch b/package/base/gcc/gcc34/fixincl.patch new file mode 100644 index 000000000..5a2a52f0e --- /dev/null +++ b/package/base/gcc/gcc34/fixincl.patch @@ -0,0 +1,33 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gccx/fixincl.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./gcc/fixinc/fixincl.sh.orig Sat May 11 16:11:15 2002 ++++ ./gcc/fixinc/fixincl.sh Sat May 11 16:12:00 2002 +@@ -143,6 +143,8 @@ + INPUTLIST="$@" + fi + ++INPUTLIST="" ++ + for INPUT in ${INPUTLIST} ; do + + cd ${ORIGDIR} diff --git a/package/base/gcc/gcc34/install_so.patch b/package/base/gcc/gcc34/install_so.patch new file mode 100644 index 000000000..90b7e3f8c --- /dev/null +++ b/package/base/gcc/gcc34/install_so.patch @@ -0,0 +1,39 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gccx/install_so.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./install-sh.orig 2003-07-20 11:40:28.000000000 +0200 ++++ ./install-sh 2003-11-02 17:04:13.000000000 +0100 +@@ -283,7 +283,13 @@ + + # Now rename the file to the real destination. + +- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" ++ if echo $dstdir/$dstfile | grep -q 'lib/.*\.so' ; then ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ else ++ $doit $rmcmd -f $dstdir/$dstfile && ++ $doit $mvcmd $dsttmp $dstdir/$dstfile ++ fi ++ + + fi && + diff --git a/package/base/gcc/gcc34/no-install-libiberty.patch b/package/base/gcc/gcc34/no-install-libiberty.patch new file mode 100644 index 000000000..895c50af2 --- /dev/null +++ b/package/base/gcc/gcc34/no-install-libiberty.patch @@ -0,0 +1,39 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gccx/no-install-libiberty.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./libiberty/Makefile.in.orig 2003-03-23 06:16:03.000000000 -0400 ++++ ./libiberty/Makefile.in 2003-05-15 17:02:18.000000000 -0400 +@@ -263,10 +263,10 @@ + install: install_to_$(INSTALL_DEST) install-subdir + + install_to_libdir: all +- ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR) +- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n +- ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) +- mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB) ++ #${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR) ++ #$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n ++ #( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) ++ #mv -f $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB) + if test -n "${target_header_dir}"; then \ + case "${target_header_dir}" in \ + /*) thd=${target_header_dir};; \ diff --git a/package/base/gcc/gcc34/no-install-zlib.patch b/package/base/gcc/gcc34/no-install-zlib.patch new file mode 100644 index 000000000..b15aee412 --- /dev/null +++ b/package/base/gcc/gcc34/no-install-zlib.patch @@ -0,0 +1,42 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gccx/no-install-zlib.patch +# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +--- ./zlib/Makefile.in.orig 2002-11-25 21:28:45.000000000 +0200 ++++ ./zlib/Makefile.in 2003-01-25 15:39:06.000000000 +0200 +@@ -227,15 +227,13 @@ + $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(INSTALL_DATA) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not install."; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(toolexeclib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p"; \ +- $(RANLIB) $(DESTDIR)$(toolexeclibdir)/$$p; \ ++ echo "flistdel: $$p should not reindex."; \ + else :; fi; \ + done + diff --git a/package/base/gcc/parse-config b/package/base/gcc/parse-config new file mode 100644 index 000000000..cb855364f --- /dev/null +++ b/package/base/gcc/parse-config @@ -0,0 +1,125 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc/parse-config +# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +# Use the GCC-[23] stack protector patch +# +if [ $pkg != glibc23 -a $pkg != glibc22 -a \ + $pkg != grub -a $pkg != dietlibc ] +then + if [ "$ROCKCFG_PKG_GCC_STACKPRO" = 1 ] ; then + var_append GCC2_WRAPPER_INSERT " " "-fstack-protector" + var_append GCC3_WRAPPER_INSERT " " "-fstack-protector" + fi +fi + +# maybe we add something more later. But imo it's better to +# let the options of KCC unmodified for gcc[23]. (Clifford) +# +if [[ $ROCKCFG_DEFAULT_KCC = gcc* ]] ; then + export KCC="${archprefix}kcc-${ROCKCFG_DEFAULT_KCC#gcc}" + if [ "$ROCKCFG_OPT" = "size" ] ; then + var_insert KCC_WRAPPER_REMOVE " " "-O -O[0-9]" + var_insert KCC_WRAPPER_INSERT " " "-Os" + fi +fi + +# set CC, CXX and F77 environment variables +# +for x in CC CXX F77 ; do + eval "y=\$ROCKCFG_DEFAULT_$x" + if [[ $y = gcc* ]] ; then + case "$x-$stagelevel" in + CC-*) + z="${archprefix}gcc ${archprefix}gcc-${y#gcc}" ;; + CXX-[2-9]) + z="${archprefix}g++ ${archprefix}g++-${y#gcc}" ;; + F77-[2-9]) + z="${archprefix}g77 ${archprefix}g77-${y#gcc}" ;; + *) + export $x=${x}_not_available_in_stage_${stagelevel} + continue ;; + esac + for y in $z ; do + [ "`type -p $y`" ] && export $x=$y + done + fi +done + +# Add the usual gcc optimazation options +# Strip or add debug information +# +if [ "$ROCKCFG_DEBUG" = 0 ] ; then + var_append GCC_WRAPPER_APPEND " " "-s" + var_insert GCC_WRAPPER_REMOVE " " "-g*" +else + if [[ $pkg != glibc* ]] ; then + var_append GCC_WRAPPER_APPEND " " "-ggdb" + var_insert GCC_WRAPPER_REMOVE " " "-s -g*" + fi +fi +var_insert GCC_WRAPPER_REMOVE " " "-O -O[0-9s] -m*" +case "$ROCKCFG_OPT" in + smart) + var_insert GCC_WRAPPER_INSERT " " "-SPEED-O2 -SIZE-Os -pipe" + var_insert GCC_WRAPPER_FILTER "|" "gawk -f $base/misc/tools-source/smartwr.awk $base/scripts/smart_db.txt -" + ;; + bizarre) + var_insert GCC_WRAPPER_INSERT " " "-SPEED-Os -SIZE-O2 -pipe" + var_insert GCC_WRAPPER_FILTER "|" "gawk -f $base/misc/tools-source/smartwr.awk $base/scripts/smart_db.txt -" + ;; + speed) + var_insert GCC_WRAPPER_INSERT " " "-O2 -pipe" + ;; + size) + var_insert GCC_WRAPPER_INSERT " " "-Os -pipe" + ;; + lazy) + var_insert GCC_WRAPPER_INSERT " " "-O -pipe" + ;; +esac + +var_append GCC_WRAPPER_APPEND " " "$ROCKCFG_C_FLAGS" + +# Compile (i.e. link) all bins statically +# +if [ "$ROCKCFG_STATIC" = 1 ]; then + var_insert GCC_WRAPPER_INSERT " " "-static" +fi + +# Compile with no exceptions or rtti, gcc itself must support both +# +if [ "$ROCKCFG_LIMITCXX" = 1 ] && [[ $pkg != gcc* ]] ; then + var_append CXX_WRAPPER_APPEND " " "-fno-exceptions -fno-rtti" +fi + +# Passing -I/usr{/local/}include creates a warning in gcc3 which is confusing +# some of the configure scripts and Makefiles. +# +var_insert GCC3_WRAPPER_REMOVE " " "-I/usr/include" +var_insert GCC3_WRAPPER_REMOVE " " "-I/usr/local/include" + +# Add the architecture gcc optimisation options +# +if [ -f architecture/$arch/gcc-options ] ; then + . architecture/$arch/gcc-options +fi + diff --git a/package/base/gcc/wrappers.in b/package/base/gcc/wrappers.in new file mode 100644 index 000000000..1989056e3 --- /dev/null +++ b/package/base/gcc/wrappers.in @@ -0,0 +1,52 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/gcc/wrappers.in +# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf +# +# This program 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 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +gcc_build_wrapper() { + local x="$1" y z ; shift + for y ; do + local ver=`$y -dumpversion 2> /dev/null` + [ $? != 0 ] && continue + + case "$ver" in + 2.*) z="$x,GCC,GCC2" ;; + 3.*) z="$x,GCC,GCC3" ;; + *) continue ;; + esac + + if [ $x = KCC ] ; then + build_wrapper $x $y + else + build_wrapper $z $y + fi + done +} + +gcc_build_wrapper CC ${arch_target}-cc ${arch_target}-gcc{-2,-32,-33,-34,} +gcc_build_wrapper KCC ${arch_target}-kcc{-2,-32,-33,-34,} + +if [ $stagelevel -gt 1 -o "$ROCKCFG_USE_CROSSCC" = 0 ] ; then + gcc_build_wrapper CC cc gcc{-2,-3,-33,-34,} + gcc_build_wrapper CXX {c,g}++{-2,-3,-33,-34,} + gcc_build_wrapper F77 {g,f}77{-2,-3,-33,-34,} + gcc_build_wrapper KCC kcc{-2,-32,-33,-34,} +fi +