Upgrade to gcc-4.8.3
[hvlinux.git] / stage0 / pkg / gcc
index c2717d0..ed373ac 100644 (file)
@@ -6,20 +6,43 @@ hvconfig_pre()
     export LDFLAGS="-Wl,-rpath,/cross-tools/lib"
 
     # Common options for passes 1 & 2
+    # --with-local-prefix:
+    #   Remove /usr/local/include (default value) from gcc's include search
+    #   path. This is not absolutely essential, however, it helps to minimize
+    #   the influence of the host system.
+    # --with-native-system-header-dir=dirname
+    #   Must be an absolute directory (from within sysroot).
+    #   The compiler will search the sysroot directory within dirname for
+    #   native system headers rather than the default /usr/include.
+    #   For example, with:
+    #     --with-sysroot=/opt/toolchain
+    #     --with-native-system-header-dir=/tools/include
+    #   then GCC will search for system headers in:
+    #     /opt/toolchain/tools/include
     CONFIGURE_OPTS+=" \
         --build=${CLFS_HOST} \
         --host=${CLFS_HOST} \
         --target=${CLFS_TARGET} \
         --with-sysroot=${CLFS} \
         --with-local-prefix=/tools \
+        --with-native-system-header-dir=/tools/include \
         --disable-nls \
         --with-mpfr=/cross-tools \
         --with-gmp=/cross-tools \
         --with-isl=/cross-tools \
         --with-cloog=/cross-tools \
+        --with-mpc=/cross-tools
+        --with-system-zlib \
+        --enable-checking=release \
         --disable-multilib"
 
     if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then
+        # --without-headers:
+        #   When building a cross-compiler and there are no system headers
+        #   for the target yet (they will be available once glibc is built).
+        # --with-newlib:
+        #   Tell the configuration utility not to use glibc, since it has not
+        #   yet been compiled for the target.
         CONFIGURE_OPTS+=" \
             --disable-shared \
             --without-headers \
@@ -28,7 +51,12 @@ hvconfig_pre()
             --disable-libgomp \
             --disable-libmudflap \
             --disable-libssp \
+            --disable-libatomic \
+            --disable-libitm \
+            --disable-libsanitizer \
+            --disable-libquadmath \
             --disable-threads \
+            --disable-target-zlib \
             --enable-languages=c"
 
         # We will create a dummy limits.h so the build will not use the one
@@ -38,24 +66,25 @@ hvconfig_pre()
     else
         CONFIGURE_OPTS+=" \
             --enable-shared \
+            --disable-static \
             --enable-languages=c,c++ \
             --enable-__cxa_atexit \
             --enable-c99 \
             --enable-long-long \
+            --enable-libstdcxx-time \
             --enable-threads=posix"
-    fi
-
-    cd ${LFS_TMP}/${PACKAGE}
 
-    # Change the StartFile Spec to point to the correct library location:
-    echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
-    echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
-    echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h
+        cd ${LFS_TMP}/${PACKAGE}
 
-    # Alter gcc's C preprocessor's default include search path to use /tools
-    # only:
-    sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
-        -i gcc/Makefile.in
+        # Change the StartFile Spec to point to the correct library location:
+        echo -en '\n' >> gcc/config/linux.h
+        echo -en '#undef  STANDARD_STARTFILE_PREFIX_1\n' >> gcc/config/linux.h
+        echo -en '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> \
+            gcc/config/linux.h
+        echo -en '#undef  STANDARD_STARTFILE_PREFIX_2\n' >> gcc/config/linux.h
+        echo -en '#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> \
+            gcc/config/linux.h
+    fi
 }
 
 hvconfig_post()