diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index f55191fef060..3f91d7153798 100644 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -1139,7 +1139,7 @@ host_multiarch_dir = multiarch_dir(host) def minimum_gcc_version(): - return Version("7.1.0") + return Version("8.1.0") @template diff --git a/build/unix/build-binutils/build-binutils.sh b/build/unix/build-binutils/build-binutils.sh index c1db61761ffd..3de8d7bc96dc 100755 --- a/build/unix/build-binutils/build-binutils.sh +++ b/build/unix/build-binutils/build-binutils.sh @@ -64,11 +64,12 @@ cd .. TARGETS="aarch64-linux-gnu arm-linux-gnueabi i686-w64-mingw32" +gcc_major=8 if [ -d $MOZ_FETCHES_DIR/sysroot ]; then # Don't silently use a non-existing directory for C++ headers. - [ -d $MOZ_FETCHES_DIR/sysroot/usr/include/c++/7 ] || exit 1 + [ -d $MOZ_FETCHES_DIR/sysroot/usr/include/c++/$gcc_major ] || exit 1 export CFLAGS="-g -O2 --sysroot=$MOZ_FETCHES_DIR/sysroot" - export CXXFLAGS="$CFLAGS -isystem $MOZ_FETCHES_DIR/sysroot/usr/include/c++/7 -isystem $MOZ_FETCHES_DIR/sysroot/usr/include/x86_64-linux-gnu/c++/7" + export CXXFLAGS="$CFLAGS -isystem $MOZ_FETCHES_DIR/sysroot/usr/include/c++/$gcc_major -isystem $MOZ_FETCHES_DIR/sysroot/usr/include/x86_64-linux-gnu/c++/$gcc_major" fi # Build target-specific GNU as ; build them first so that the few documentation diff --git a/docs/code-quality/coding-style/using_cxx_in_firefox_code.rst b/docs/code-quality/coding-style/using_cxx_in_firefox_code.rst index eb14cdf091f4..92decbdf1e16 100644 --- a/docs/code-quality/coding-style/using_cxx_in_firefox_code.rst +++ b/docs/code-quality/coding-style/using_cxx_in_firefox_code.rst @@ -43,7 +43,7 @@ list of acceptable features is given below: - Clang - * - Current minimal requirement - - 7.1 + - 8.1 - 7.0 - * - Feature diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py index f130245d46e6..c6af3d99d4ec 100644 --- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py @@ -20,6 +20,8 @@ DEFAULT_C99 = {"__STDC_VERSION__": "199901L"} DEFAULT_C11 = {"__STDC_VERSION__": "201112L"} +DEFAULT_C17 = {"__STDC_VERSION__": "201710L"} + DEFAULT_CXX_97 = {"__cplusplus": "199711L"} DEFAULT_CXX_11 = {"__cplusplus": "201103L"} @@ -91,9 +93,11 @@ GCC_7 = GCC("7.3.0") + DEFAULT_C11 GXX_7 = GXX("7.3.0") + DEFAULT_CXX_14 + SUPPORTS_GNUXX17 + SUPPORTS_CXX17 GCC_8 = GCC("8.3.0") + DEFAULT_C11 GXX_8 = GXX("8.3.0") + DEFAULT_CXX_14 + SUPPORTS_GNUXX17 + SUPPORTS_CXX17 +GCC_10 = GCC("10.2.1") + DEFAULT_C17 +GXX_10 = GXX("10.2.1") + DEFAULT_CXX_14 + SUPPORTS_GNUXX17 + SUPPORTS_CXX17 -DEFAULT_GCC = GCC_7 -DEFAULT_GXX = GXX_7 +DEFAULT_GCC = GCC_8 +DEFAULT_GXX = GXX_8 GCC_PLATFORM_LITTLE_ENDIAN = { "__ORDER_LITTLE_ENDIAN__": 1234, @@ -420,7 +424,7 @@ class BaseToolchainTest(BaseConfigureTest): def old_gcc_message(old_ver): - return "Only GCC 7.1 or newer is supported (found version {}).".format(old_ver) + return "Only GCC 8.1 or newer is supported (found version {}).".format(old_ver) class LinuxToolchainTest(BaseToolchainTest): @@ -437,6 +441,8 @@ class LinuxToolchainTest(BaseToolchainTest): "/usr/bin/g++-7": GXX_7 + GCC_PLATFORM_X86_64_LINUX, "/usr/bin/gcc-8": GCC_8 + GCC_PLATFORM_X86_64_LINUX, "/usr/bin/g++-8": GXX_8 + GCC_PLATFORM_X86_64_LINUX, + "/usr/bin/gcc-10": GCC_10 + GCC_PLATFORM_X86_64_LINUX, + "/usr/bin/g++-10": GXX_10 + GCC_PLATFORM_X86_64_LINUX, "/usr/bin/clang": DEFAULT_CLANG + CLANG_PLATFORM_X86_64_LINUX, "/usr/bin/clang++": DEFAULT_CLANGXX + CLANG_PLATFORM_X86_64_LINUX, "/usr/bin/clang-7.0": CLANG_7_0 + CLANG_PLATFORM_X86_64_LINUX, @@ -455,20 +461,8 @@ class LinuxToolchainTest(BaseToolchainTest): GXX_5_RESULT = GCC_5_RESULT GCC_6_RESULT = old_gcc_message("6.4.0") GXX_6_RESULT = GCC_6_RESULT - GCC_7_RESULT = CompilerResult( - flags=["-std=gnu99"], - version="7.3.0", - type="gcc", - compiler="/usr/bin/gcc-7", - language="C", - ) - GXX_7_RESULT = CompilerResult( - flags=["-std=gnu++17"], - version="7.3.0", - type="gcc", - compiler="/usr/bin/g++-7", - language="C++", - ) + GCC_7_RESULT = old_gcc_message("7.3.0") + GXX_7_RESULT = GCC_7_RESULT GCC_8_RESULT = CompilerResult( flags=["-std=gnu99"], version="8.3.0", @@ -483,8 +477,8 @@ class LinuxToolchainTest(BaseToolchainTest): compiler="/usr/bin/g++-8", language="C++", ) - DEFAULT_GCC_RESULT = GCC_7_RESULT + {"compiler": "/usr/bin/gcc"} - DEFAULT_GXX_RESULT = GXX_7_RESULT + {"compiler": "/usr/bin/g++"} + DEFAULT_GCC_RESULT = GCC_8_RESULT + {"compiler": "/usr/bin/gcc"} + DEFAULT_GXX_RESULT = GXX_8_RESULT + {"compiler": "/usr/bin/g++"} CLANG_3_3_RESULT = ( "Only clang/llvm 7.0 or newer is supported (found version 3.3.0)." @@ -573,12 +567,12 @@ class LinuxToolchainTest(BaseToolchainTest): { "c_compiler": self.DEFAULT_GCC_RESULT, "cxx_compiler": ( - "The target C compiler is version 7.3.0, while the target " - "C++ compiler is version 8.3.0. Need to use the same compiler " + "The target C compiler is version 8.3.0, while the target " + "C++ compiler is version 10.2.1. Need to use the same compiler " "version." ), }, - environ={"CC": "gcc", "CXX": "g++-8"}, + environ={"CC": "gcc", "CXX": "g++-10"}, ) self.do_toolchain_test( @@ -588,12 +582,12 @@ class LinuxToolchainTest(BaseToolchainTest): "cxx_compiler": self.DEFAULT_GXX_RESULT, "host_c_compiler": self.DEFAULT_GCC_RESULT, "host_cxx_compiler": ( - "The host C compiler is version 7.3.0, while the host " - "C++ compiler is version 8.3.0. Need to use the same compiler " + "The host C compiler is version 8.3.0, while the host " + "C++ compiler is version 10.2.1. Need to use the same compiler " "version." ), }, - environ={"CC": "gcc", "HOST_CXX": "g++-8"}, + environ={"CC": "gcc", "HOST_CXX": "g++-10"}, ) def test_mismatched_compiler(self): @@ -849,8 +843,8 @@ class OSXToolchainTest(BaseToolchainTest): PATHS = { "/usr/bin/gcc-5": GCC_5 + GCC_PLATFORM_X86_64_OSX, "/usr/bin/g++-5": GXX_5 + GCC_PLATFORM_X86_64_OSX, - "/usr/bin/gcc-7": GCC_7 + GCC_PLATFORM_X86_64_OSX, - "/usr/bin/g++-7": GXX_7 + GCC_PLATFORM_X86_64_OSX, + "/usr/bin/gcc-8": GCC_8 + GCC_PLATFORM_X86_64_OSX, + "/usr/bin/g++-8": GXX_8 + GCC_PLATFORM_X86_64_OSX, "/usr/bin/clang": XCODE_CLANG_7_0 + CLANG_PLATFORM_X86_64_OSX, "/usr/bin/clang++": XCODE_CLANGXX_7_0 + CLANG_PLATFORM_X86_64_OSX, "/usr/bin/clang-4.0": XCODE_CLANG_4_0 + CLANG_PLATFORM_X86_64_OSX, @@ -887,8 +881,8 @@ class OSXToolchainTest(BaseToolchainTest): ) GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT - GCC_7_RESULT = LinuxToolchainTest.GCC_7_RESULT - GXX_7_RESULT = LinuxToolchainTest.GXX_7_RESULT + GCC_8_RESULT = LinuxToolchainTest.GCC_8_RESULT + GXX_8_RESULT = LinuxToolchainTest.GXX_8_RESULT SYSROOT_FLAGS = { "flags": PrependFlags( [ @@ -944,10 +938,10 @@ class OSXToolchainTest(BaseToolchainTest): self.do_toolchain_test( self.PATHS, { - "c_compiler": self.GCC_7_RESULT + self.SYSROOT_FLAGS, - "cxx_compiler": self.GXX_7_RESULT + self.SYSROOT_FLAGS, + "c_compiler": self.GCC_8_RESULT + self.SYSROOT_FLAGS, + "cxx_compiler": self.GXX_8_RESULT + self.SYSROOT_FLAGS, }, - environ={"CC": "gcc-7", "CXX": "g++-7"}, + environ={"CC": "gcc-8", "CXX": "g++-8"}, ) def test_forced_unsupported_gcc(self): @@ -1297,12 +1291,8 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest): ARM_DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT + { "compiler": "/usr/bin/arm-linux-gnu-g++" } - ARM_GCC_7_RESULT = LinuxToolchainTest.GCC_7_RESULT + { - "compiler": "/usr/bin/arm-linux-gnu-gcc-7" - } - ARM_GXX_7_RESULT = LinuxToolchainTest.GXX_7_RESULT + { - "compiler": "/usr/bin/arm-linux-gnu-g++-7" - } + ARM_GCC_7_RESULT = LinuxToolchainTest.GCC_7_RESULT + ARM_GXX_7_RESULT = LinuxToolchainTest.GXX_7_RESULT DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT diff --git a/taskcluster/ci/build/linux-base-toolchains.yml b/taskcluster/ci/build/linux-base-toolchains.yml index 27a9862b9058..c52bcec67b75 100644 --- a/taskcluster/ci/build/linux-base-toolchains.yml +++ b/taskcluster/ci/build/linux-base-toolchains.yml @@ -37,7 +37,7 @@ linux64-base-toolchains/opt: toolchain: - linux64-binutils-2.31.1 - linux64-clang-base - - linux64-gcc-7 + - linux64-gcc-base - linux64-rust-base - linux64-cbindgen - linux64-dump_syms @@ -78,7 +78,7 @@ linux64-base-toolchains/debug: toolchain: - linux64-binutils-2.31.1 - linux64-clang-base - - linux64-gcc-7 + - linux64-gcc-base - linux64-rust-base - linux64-cbindgen - linux64-dump_syms diff --git a/taskcluster/ci/fetch/toolchains.yml b/taskcluster/ci/fetch/toolchains.yml index 48d90869c770..d840512fc855 100644 --- a/taskcluster/ci/fetch/toolchains.yml +++ b/taskcluster/ci/fetch/toolchains.yml @@ -30,20 +30,6 @@ binutils-2.36.1: strip-components: 1 add-prefix: binutils-source/ -gcc-7.5.0: - description: GCC 7.5.0 source code - fetch: - type: static-url - url: https://ftp.gnu.org/gnu/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz - sha256: b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661 - size: 62783088 - gpg-signature: - sig-url: "{url}.sig" - key-path: build/unix/build-gcc/7F74F97C103468EE5D750B583AB00996FC26A641.key - artifact-name: gcc-source.tar.zst - strip-components: 1 - add-prefix: gcc-source/ - gcc-8.5.0: description: GCC 8.5.0 source code fetch: diff --git a/taskcluster/ci/packages/debian.yml b/taskcluster/ci/packages/debian.yml index c8d959675bb4..93136c5ec909 100644 --- a/taskcluster/ci/packages/debian.yml +++ b/taskcluster/ci/packages/debian.yml @@ -56,10 +56,10 @@ deb11-python-zstandard: pre-build-command: debchange -v 0.19.0-1.deb11moz --distribution bullseye "Mozilla backport for buster" name: python-zstandard -deb8-gcc-7: - description: "gcc 7 for Debian jessie" +deb8-gcc-8: + description: "gcc 8 for Debian jessie" treeherder: - symbol: Deb8(gcc-7) + symbol: Deb8(gcc-8) worker: max-run-time: 3600 env: @@ -70,8 +70,8 @@ deb8-gcc-7: using: debian-package dist: jessie dsc: - url: http://snapshot.debian.org/archive/debian/20200323T214010Z/pool/main/g/gcc-7/gcc-7_7.5.0-6.dsc - sha256: 94f2c35ddcf84a62ae152f2f290be2bba1263157b3970776d0c8b43dec4e6fd5 + url: http://snapshot.debian.org/archive/debian/20210202T150504Z/pool/main/g/gcc-8/gcc-8_8.4.0-7.dsc + sha256: b93f13bc67f5a8f16e837fbb543d00d3475d5c95777a1b0b5a448fa2310a98c5 # autoconf2.64 and quilt necessary to run the `debian/rules control` command to # generate an updated debian/control. # uncommenting `with_common_libs` makes the packaging create the libstdc++6 package. @@ -90,10 +90,10 @@ deb8-gcc-7: echo OFFLOAD_BUILD_DEP= >> debian/rules.conf && debian/rules control NT= -deb8-32-gcc-7: - description: "gcc 7 for Debian jessie" +deb8-32-gcc-8: + description: "gcc 8 for Debian jessie" treeherder: - symbol: Deb8-32(gcc-7) + symbol: Deb8-32(gcc-8) worker: max-run-time: 3600 env: @@ -104,8 +104,8 @@ deb8-32-gcc-7: using: debian-package dist: jessie dsc: - url: http://snapshot.debian.org/archive/debian/20200323T214010Z/pool/main/g/gcc-7/gcc-7_7.5.0-6.dsc - sha256: 94f2c35ddcf84a62ae152f2f290be2bba1263157b3970776d0c8b43dec4e6fd5 + url: http://snapshot.debian.org/archive/debian/20210202T150504Z/pool/main/g/gcc-8/gcc-8_8.4.0-7.dsc + sha256: b93f13bc67f5a8f16e837fbb543d00d3475d5c95777a1b0b5a448fa2310a98c5 pre-build-command: >- apt install autoconf2.64 quilt && sed -i 's/#with_common_libs/with_common_libs/' debian/rules.defs && diff --git a/taskcluster/ci/toolchain/gcc.yml b/taskcluster/ci/toolchain/gcc.yml index f8d0933973c8..2a09c37e6ca9 100644 --- a/taskcluster/ci/toolchain/gcc.yml +++ b/taskcluster/ci/toolchain/gcc.yml @@ -14,27 +14,15 @@ job-defaults: toolchain: - linux64-toolchain-sysroot -linux64-gcc-7: - description: "GCC 7 toolchain build" - treeherder: - symbol: TL(gcc7) - run: - script: build-gcc-linux.sh - toolchain-alias: linux64-gcc - fetches: - fetch: - - gcc-7.5.0 - - gmp-6.1.0 - - isl-0.16.1 - - mpc-1.0.3 - - mpfr-3.1.4 - linux64-gcc-8: description: "GCC 8 toolchain build" treeherder: symbol: TL(gcc8) run: script: build-gcc-linux.sh + toolchain-alias: + - linux64-gcc + - linux64-gcc-base fetches: fetch: - gcc-8.5.0 diff --git a/taskcluster/ci/toolchain/misc.yml b/taskcluster/ci/toolchain/misc.yml index 541bd1607bbc..d51915412bdc 100644 --- a/taskcluster/ci/toolchain/misc.yml +++ b/taskcluster/ci/toolchain/misc.yml @@ -21,7 +21,7 @@ linux64-binutils-2.31.1: - binutils-2.31.1 toolchain: # C++ code in gold doesn't compile with recent versions of GCC. - - linux64-gcc-7 + - linux64-gcc-8 - linux64-toolchain-sysroot linux64-binutils: diff --git a/taskcluster/ci/toolchain/sysroot.yml b/taskcluster/ci/toolchain/sysroot.yml index 27a82be28a45..4a5096285a4b 100644 --- a/taskcluster/ci/toolchain/sysroot.yml +++ b/taskcluster/ci/toolchain/sysroot.yml @@ -17,11 +17,11 @@ sysroot-i686-linux-gnu: local-toolchain: true worker: env: - PACKAGES_TASKS: {task-reference: ''} + PACKAGES_TASKS: {task-reference: ''} treeherder: symbol: TL(sysroot32) dependencies: - gcc-7: packages-deb8-32-gcc-7 + gcc-8: packages-deb8-32-gcc-8 run: toolchain-artifact: public/build/sysroot-i686-linux-gnu.tar.zst arguments: @@ -33,11 +33,11 @@ sysroot-x86_64-linux-gnu: local-toolchain: true worker: env: - PACKAGES_TASKS: {task-reference: ''} + PACKAGES_TASKS: {task-reference: ''} treeherder: symbol: TL(sysroot64) dependencies: - gcc-7: packages-deb8-gcc-7 + gcc-8: packages-deb8-gcc-8 run: toolchain-artifact: public/build/sysroot-x86_64-linux-gnu.tar.zst arguments: @@ -49,11 +49,11 @@ sysroot-x86_64-linux-gnu-x11: local-toolchain: true worker: env: - PACKAGES_TASKS: {task-reference: ' '} + PACKAGES_TASKS: {task-reference: ' '} treeherder: symbol: TL(sysroot64-x11) dependencies: - gcc-7: packages-deb8-gcc-7 + gcc-8: packages-deb8-gcc-8 gtk3: packages-deb8-gtk3 run: toolchain-artifact: public/build/sysroot-x86_64-linux-gnu.tar.zst @@ -117,11 +117,11 @@ linux32-toolchain-sysroot: description: "Sysroot for linux32 toolchain builds" worker: env: - PACKAGES_TASKS: {task-reference: ''} + PACKAGES_TASKS: {task-reference: ''} treeherder: symbol: TL(sysroot32-toolchain) dependencies: - gcc-7: packages-deb8-32-gcc-7 + gcc-8: packages-deb8-32-gcc-8 run: arguments: - i386 @@ -139,18 +139,18 @@ linux64-toolchain-sysroot: description: "Sysroot for linux64 toolchain builds" worker: env: - PACKAGES_TASKS: {task-reference: ''} + PACKAGES_TASKS: {task-reference: ''} treeherder: symbol: TL(sysroot64-toolchain) dependencies: - gcc-7: packages-deb8-gcc-7 + gcc-8: packages-deb8-gcc-8 run: arguments: - amd64 # For clang - binutils-dev - gcc-multilib - - lib32stdc++-7-dev + - lib32stdc++-8-dev - libxml2-dev # For minidump-stackwalk - libcurl4-openssl-dev diff --git a/taskcluster/scripts/misc/build-sysroot.sh b/taskcluster/scripts/misc/build-sysroot.sh index cf9432892d13..8b110eadf72b 100755 --- a/taskcluster/scripts/misc/build-sysroot.sh +++ b/taskcluster/scripts/misc/build-sysroot.sh @@ -20,7 +20,7 @@ case "$arch" in i386|amd64) dist=jessie if [ -n "$PACKAGES_TASKS" ]; then - gcc_version=7 + gcc_version=8 else gcc_version=4.9 fi