X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage0%2Fpkg%2Fgcc;h=fab1a514723f2f6a6531a8d5930c2dfe86fd93b2;hb=b6f8c455b6b970c08eab79303c95acbc1506f61d;hp=0fd67956487549297f413e653bc94d69ccba9962;hpb=6890ab467c34bc0ae1fccf18a521c3cedfa442a2;p=hvlinux.git diff --git a/stage0/pkg/gcc b/stage0/pkg/gcc index 0fd6795..fab1a51 100644 --- a/stage0/pkg/gcc +++ b/stage0/pkg/gcc @@ -3,23 +3,47 @@ hvconfig_pre() { export AR=ar - export LDFLAGS="-Wl,-rpath,/cross-tools/lib" + export LDFLAGS="-Wl,-rpath,${CROSS_TOOLS_DIR}/lib" # Common options for passes 1 & 2 - CONFIGURE_OPTS+=" \ + # --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=" \ + --prefix=/cross-tools \ --build=${CLFS_HOST} \ --host=${CLFS_HOST} \ --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} \ - --with-local-prefix=/tools \ + --with-local-prefix=${TOOLS_DIR} \ + --with-native-system-header-dir=/tools/include \ --disable-nls \ - --with-mpfr=/cross-tools \ - --with-gmp=/cross-tools \ - --with-cloog=/cross-tools \ - --enable-cloog-backend=isl \ + --with-mpfr=${CROSS_TOOLS_DIR} \ + --with-gmp=${CROSS_TOOLS_DIR} \ + --with-isl=${CROSS_TOOLS_DIR} \ + --with-cloog=${CROSS_TOOLS_DIR} \ + --with-mpc=${CROSS_TOOLS_DIR} + --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,34 +52,40 @@ 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 # provided by the host distro: - mkdir -p /tools/include - touch /tools/include/limits.h + mkdir -p ${TOOLS_DIR}/include + touch ${TOOLS_DIR}/include/limits.h 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 ${SRC_DIR} - # 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() @@ -68,11 +98,11 @@ hvbuild() { if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then ${HVMAKE} all-gcc all-target-libgcc - ${HVMAKE} install-gcc install-target-libgcc + ${HVMAKE} DESTDIR=${LFS} install-gcc install-target-libgcc else ${HVMAKE} \ AS_FOR_TARGET="${CLFS_TARGET}-as" \ LD_FOR_TARGET="${CLFS_TARGET}-ld" - ${HVMAKE} install + ${HVMAKE} DESTDIR=${LFS} install fi }