diff --git a/package/base/gcc/config-300.hlp b/package/base/gcc/config-300.hlp index 0a873f431..6b28ec258 100644 --- a/package/base/gcc/config-300.hlp +++ b/package/base/gcc/config-300.hlp @@ -52,3 +52,7 @@ ROCKCFG_PKG_GCC33_NO_JAVA ROCKCFG_PKG_GCC34_NO_JAVA Please check here if you don't want to build the gcc34 JAVA compiler. +ROCKCFG_PKG_GCC34_PROFILED + Enables profiling during GCC bootstrap and so yields an optimised + compiler. Build speedup might be 5-10%. + diff --git a/package/base/gcc/config-300.in b/package/base/gcc/config-300.in index 7c76dc964..933a650be 100644 --- a/package/base/gcc/config-300.in +++ b/package/base/gcc/config-300.in @@ -103,6 +103,8 @@ then comment '--- GCC 3.4.x options' bool 'Do not build JAVA compiler' \ ROCKCFG_PKG_GCC34_NO_JAVA 0 + bool 'Do profiled bootstrap' \ + ROCKCFG_PKG_GCC34_PROFILED 1 %include package/*/*/subconfig-gcc34.in fi diff --git a/package/base/gcc/gcc.conf b/package/base/gcc/gcc.conf index 9104a79bd..b46df0d30 100644 --- a/package/base/gcc/gcc.conf +++ b/package/base/gcc/gcc.conf @@ -204,7 +204,11 @@ custmain() { --with-gnu-ld --enable-threads=posix hook_eval premake - eval "$MAKE GCJFLAGS=\"$CXXFLAGS\" all" + if [ $xpkg = gcc34 -a "$ROCKCFG_PKG_GCC34_PROFILED" != 0 ]; then + eval "$MAKE GCJFLAGS=\"$CXXFLAGS\" profiledbootstrap" + else + eval "$MAKE GCJFLAGS=\"$CXXFLAGS\" all" + fi hook_eval inmake eval "$MAKE $makeinstopt install" @@ -292,6 +296,25 @@ custmain() { fi fi + # Inject our default optimisation options so when the user calls + # gcc/g++ they match the ones used to precompile the headers ... + # + # Save the options affectioning optimization only - for injection into the specs + # file. They should be the gcc default options since they match the ones used + # to generate the PCHs. -ReneR + # + # Ideas for simplifications welcome ... + # + echo "Adapting gcc specs file..." + cd $root/$prefix/lib/${gcc_lib_dir} + mv specs specs.orig + tr '\n' '@' < specs.orig | sed -e "s|@\\*cc1_options:@|@*cc1_options:@$( + eval echo \$GCC_WRAPPER_INSERT \$GCC_WRAPPER_APPEND \ + \$GCC${ver:0:1}_WRAPPER_INSERT \$GCC${ver:0:1}_WRAPPER_APPEND | \ + tr ' ' '\n' | sed -e '/-O./ { p; d; }' -e '/-mcpu=.*/ { p; d; }' \ + -e '/-march=.*/ { p; d; }' -e '/-mtune=.*/ { p; d; }' -e 'd' | tr '\n' ' ' + ) |" | tr '@' '\n' > specs + # Create symlinks for runtime libraries so they can be found by # the dynamic loader and force rebuilding of the wrapper links # @@ -395,4 +418,5 @@ else fi gcc_lib_dir="gcc-lib/${pkg_gcc_target}/${ver%%-*}" +[ $pkg_gcc_version = 34 ] && gcc_lib_dir="gcc/${pkg_gcc_target}/${ver%%-*}"