Commit 1961b65c authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Upgraded gcc to 11.1.0

parent 77aca970
......@@ -3,13 +3,12 @@ all:
chmod 600 swap
mkswap swap
swapon swap
tar xf gcc-10.1.0.tar.xz
patch -Np1 -d gcc-10.1.0 < gcc-10.1.0-cet_fix-1.patch
cd gcc-10.1.0 && sed -e '/mabi\.lp64=/s/lib64/lib/' -i gcc/config/aarch64/t-aarch64-linux
cd gcc-10.1.0 && sed -e '/m64=/s/lib64/lib/' -i gcc/config/i386/t-linux64
cd gcc-10.1.0 && sed -e '/GLIBC_DYNAMIC_LINKER64/s/lib64/lib/' -i gcc/config/i386/linux64.h
tar xf gcc-11.1.0.tar.xz
cd gcc-11.1.0 && sed -e '/mabi\.lp64=/s/lib64/lib/' -i gcc/config/aarch64/t-aarch64-linux
cd gcc-11.1.0 && sed -e '/m64=/s/lib64/lib/' -i gcc/config/i386/t-linux64
cd gcc-11.1.0 && sed -e '/GLIBC_DYNAMIC_LINKER64/s/lib64/lib/' -i gcc/config/i386/linux64.h
mkdir gcc-build
cd gcc-build && SED=sed CC="gcc -isystem /usr/include" CXX="g++ -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" ../gcc-10.1.0/configure --build=$(CLFS_TARGET) --prefix=/usr --libexecdir=/usr/lib --enable-languages=c,c++ --disable-multilib --with-system-zlib --disable-bootstrap $(GCC_CONFIG)
cd gcc-build && SED=sed CC="gcc -isystem /usr/include" CXX="g++ -isystem /usr/include" LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib" ../gcc-11.1.0/configure --build=$(CLFS_TARGET) --prefix=/usr --libexecdir=/usr/lib --enable-languages=c,c++ --disable-multilib --with-system-zlib --disable-bootstrap $(GCC_CONFIG)
$(MAKE) -C gcc-build
# FIXME: gcc tests fail, we should exclude tests which are known to fail and beyond our control
......@@ -17,16 +16,16 @@ all:
ulimit -s 32768 ; \
$(MAKE) -C gcc-build -k check ; \
cd gcc-build ; \
../gcc-10.1.0/contrib/test_summary ; \
../gcc-11.1.0/contrib/test_summary ; \
fi
$(MAKE) -C gcc-build install
ln -sv /usr/bin/cpp /lib
ln -sv gcc /usr/bin/cc
install -v -dm755 /usr/lib/bfd-plugins
ln -sfv ../../libexec/gcc/$$(gcc -dumpmachine)/10.1.0/liblto_plugin.so /usr/lib/bfd-plugins/
ln -sfv ../../libexec/gcc/$$(gcc -dumpmachine)/11.1.0/liblto_plugin.so /usr/lib/bfd-plugins/
rm -rf gcc-10.1.0
rm -rf gcc-11.1.0
rm -rf gcc-build
swapoff swap
rm -rf swap
......@@ -4,7 +4,7 @@
<property name="makedir" value="${builddir}/gcc-build"/>
<mkdir dir="${makedir}"/>
<antcall target="cross-gcc"/>
<exec executable="${builddir}/gcc-10.1.0/configure" dir="${makedir}" failonerror="true">
<exec executable="${builddir}/gcc-11.1.0/configure" dir="${makedir}" failonerror="true">
<env key="AR" value="ar"/>
<env key="LDFLAGS" value="-Wl,-rpath,${sysrootdir}/cross-tools/lib"/>
<arg line="--prefix=${sysrootdir}/cross-tools --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-glibc-version=2.27 --with-sysroot=${sysrootdir} --with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++ --with-mpfr=${sysrootdir}/cross-tools --with-gmp=${sysrootdir}/cross-tools --with-mpc=${sysrootdir}/cross-tools ${GCC_CROSS_CONFIG}"/>
......@@ -13,7 +13,7 @@
<exec executable="make" dir="${makedir}" failonerror="true">
<arg line="install"/>
</exec>
<delete dir="${builddir}/gcc-10.1.0"/>
<delete dir="${builddir}/gcc-11.1.0"/>
<delete dir="${makedir}"/>
</target>
......@@ -21,7 +21,7 @@
<property name="makedir" value="${builddir}/gcc-build"/>
<mkdir dir="${makedir}"/>
<antcall target="cross-gcc"/>
<exec executable="${builddir}/gcc-10.1.0/configure" dir="${makedir}" failonerror="true">
<exec executable="${builddir}/gcc-11.1.0/configure" dir="${makedir}" failonerror="true">
<env key="AR" value="ar"/>
<env key="LDFLAGS" value="-Wl,-rpath,${sysrootdir}/cross-tools/lib"/>
<arg line="--prefix=${sysrootdir}/cross-tools --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} --with-sysroot=${sysrootdir} --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --enable-languages=c,c++ --disable-multilib --with-mpc=${sysrootdir}/cross-tools --with-mpfr=${sysrootdir}/cross-tools --with-gmp=${sysrootdir}/cross-tools --with-system-zlib --enable-libstdcxx-pch --disable-bootstrap --disable-libgomp ${GCC_CROSS_CONFIG}"/>
......@@ -33,7 +33,7 @@
<exec executable="make" dir="${makedir}" failonerror="true">
<arg line="install"/>
</exec>
<delete dir="${builddir}/gcc-10.1.0"/>
<delete dir="${builddir}/gcc-11.1.0"/>
<delete dir="${makedir}"/>
</target>
......@@ -41,11 +41,11 @@
<property name="makedir" value="${builddir}/gcc-build"/>
<mkdir dir="${makedir}"/>
<antcall target="gcc"/>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<env key="PATH" path="${PATH}"/>
<arg line="-c &quot;cat gcc/limitx.h gcc/glimits.h gcc/limity.h > `dirname $(${CLFS_TARGET}-gcc -print-libgcc-file-name)`/include-fixed/limits.h&quot;"/>
</exec>
<exec executable="${builddir}/gcc-10.1.0/configure" dir="${makedir}" failonerror="true">
<exec executable="${builddir}/gcc-11.1.0/configure" dir="${makedir}" failonerror="true">
<env key="PATH" path="${PATH}"/>
<env key="CC" value="${CLFS_TARGET}-gcc"/>
<env key="CXX" value="${CLFS_TARGET}-g++"/>
......@@ -84,10 +84,10 @@
<env key="STRIP" value="${CLFS_TARGET}-strip"/>
<arg line="install"/>
</exec>
<exec executable="cp" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="cp" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg line="-v include/libiberty.h ${sysrootdir}/tools/include"/>
</exec>
<delete dir="${builddir}/gcc-10.1.0"/>
<delete dir="${builddir}/gcc-11.1.0"/>
<delete dir="${makedir}"/>
</target>
......@@ -100,56 +100,56 @@
<target name="gcc">
<exec executable="tar" failonerror="true">
<arg line="xf packages/gcc/gcc-10.1.0.tar.xz -C ${builddir}"/>
<arg line="xf packages/gcc/gcc-11.1.0.tar.xz -C ${builddir}"/>
</exec>
<exec executable="patch" dir="${builddir}/gcc-10.1.0" failonerror="true">
<arg line="-Np1 -i ${basedir}/packages/gcc/gcc-10.1.0-cet_fix-1.patch"/>
<exec executable="patch" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg line="-Np1 -i ${basedir}/packages/gcc/gcc-11.1.0-fix_fenv_t.patch"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' -e 's@/usr@/tools@g' -i gcc/config/linux.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 &quot;/tools/lib/&quot;\n\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 &quot;&quot;\n' >> gcc/config/linux.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' -e 's@/usr@/tools@g' -i gcc/config/arm/linux-eabi.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 &quot;/tools/lib/&quot;\n\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 &quot;&quot;\n' >> gcc/config/arm/linux-eabi.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' -e 's@/usr@/tools@g' -i gcc/config/arm/linux-elf.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 &quot;/tools/lib/&quot;\n\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 &quot;&quot;\n' >> gcc/config/arm/linux-elf.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' -e 's@/usr@/tools@g' -i gcc/config/aarch64/aarch64-linux.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 &quot;/tools/lib/&quot;\n\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 &quot;&quot;\n' >> gcc/config/aarch64/aarch64-linux.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e '/mabi\.lp64=/s/lib64/lib/' -i gcc/config/aarch64/t-aarch64-linux"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools/lib/ld@g' -e 's@/usr@/tools@g' -i gcc/config/i386/linux64.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 &quot;/tools/lib/&quot;\n\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 &quot;&quot;\n' >> gcc/config/i386/linux64.h"/>
</exec>
<exec executable="bash" dir="${builddir}/gcc-10.1.0" failonerror="true">
<exec executable="bash" dir="${builddir}/gcc-11.1.0" failonerror="true">
<arg value="-c"/>
<arg value="sed -e '/m64=/s/lib64/lib/' -i gcc/config/i386/t-linux64"/>
</exec>
......
Submitted By: Pierre Labastie <pierre dot labastie at neuf dot fr>
Date: 2020-05-09
Package Version: 10.1.0
Upstream Status: Submitted (PR bootstrap/94998)
Origin: https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545392.html
Description: Fix build when build!=host (used only in cross-chap5)
Don't perform CET run-time check for host when cross compiling. Instead,
enable CET in cross compiler if possible so that it will run on both CET
and non-CET hosts.
diff --git a/config/cet.m4 b/config/cet.m4
index ea616b728a9..d9608699cd5 100644
--- a/config/cet.m4
+++ b/config/cet.m4
@@ -111,7 +111,8 @@ if test x$may_have_cet = xyes; then
fi
if test x$may_have_cet = xyes; then
- AC_TRY_RUN([
+ if test x$cross_compiling = xno; then
+ AC_TRY_RUN([
static void
foo (void)
{
@@ -137,12 +138,17 @@ main ()
bar ();
return 0;
}
- ],
- [have_cet=no],
- [have_cet=yes])
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+ ],
+ [have_cet=no],
+ [have_cet=yes])
+ if test x$enable_cet = xno -a x$have_cet = xyes; then
+ AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+ fi
fi
+else
+ # Enable CET in cross compiler if possible so that it will run on both
+ # CET and non-CET hosts.
+ have_cet=yes
fi
if test x$enable_cet = xyes; then
$1="-fcf-protection"
diff --git a/libiberty/configure b/libiberty/configure
index bb76cf1b823..3f82c5bb865 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5375,7 +5375,8 @@ rm -f core conftest.err conftest.$ac_objext \
fi
if test x$may_have_cet = xyes; then
- if test "$cross_compiling" = yes; then :
+ if test x$cross_compiling = xno; then
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
@@ -5420,9 +5421,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ if test x$enable_cet = xno -a x$have_cet = xyes; then
+ as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ fi
fi
+else
+ # Enable CET in cross compiler if possible so that it will run on both
+ # CET and non-CET hosts.
+ have_cet=yes
fi
if test x$enable_cet = xyes; then
CET_HOST_FLAGS="-fcf-protection"
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 1baf6cc70b8..36c6ecc5875 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -5768,7 +5768,8 @@ rm -f core conftest.err conftest.$ac_objext \
fi
if test x$may_have_cet = xyes; then
- if test "$cross_compiling" = yes; then :
+ if test x$cross_compiling = xno; then
+ if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
@@ -5813,9 +5814,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ if test x$enable_cet = xno -a x$have_cet = xyes; then
+ as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+ fi
fi
+else
+ # Enable CET in cross compiler if possible so that it will run on both
+ # CET and non-CET hosts.
+ have_cet=yes
fi
if test x$enable_cet = xyes; then
CET_HOST_FLAGS="-fcf-protection"
@@ -11941,7 +11947,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11944 "configure"
+#line 11950 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12047,7 +12053,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12050 "configure"
+#line 12056 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
--
2.26.2
diff -uNr gcc-11.1.0/configure gcc-11.1.0-fix_fenv_t/configure
--- gcc-11.1.0/configure 2021-04-27 19:30:12.000000000 +0930
+++ gcc-11.1.0-fix_fenv_t/configure 2022-08-24 00:33:42.780750628 +0930
@@ -16478,7 +16478,7 @@
fi
-RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5
$as_echo_n "checking where to find the target ar... " >&6; }
diff -uNr gcc-11.1.0/configure.ac gcc-11.1.0-fix_fenv_t/configure.ac
--- gcc-11.1.0/configure.ac 2021-04-27 19:30:12.000000000 +0930
+++ gcc-11.1.0-fix_fenv_t/configure.ac 2022-08-24 00:34:22.175843053 +0930
@@ -3520,7 +3520,7 @@
ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
-RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment