From 5197ee86cb10e8ef20507d4c6236c80033df0fa1 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Fri, 13 Dec 2019 22:07:03 +0000 Subject: [PATCH 1/3] sdk: update to GCC 9.2 Signed-off-by: Ben Cressey --- extras/sdk-container/Dockerfile | 10 +- .../buildroot/sdk_aarch64_gnu_defconfig | 1 - .../buildroot/sdk_aarch64_musl_defconfig | 1 - .../buildroot/sdk_x86_64_gnu_defconfig | 1 - .../buildroot/sdk_x86_64_musl_defconfig | 1 - extras/sdk-container/hashes/buildroot | 2 +- ...-for-host-builds-of-gmp-isl-mpc-mpfr.patch | 2 +- ...IR-and-SYSROOT_DIR-to-control-output.patch | 2 +- ...utils-with-TOOLS_DIR-and-SYSROOT_DIR.patch | 2 +- ...d-gcc-with-TOOLS_DIR-and-SYSROOT_DIR.patch | 2 +- ...tils-bring-back-sysroot-fix-for-2.32.patch | 2 +- ...06-package-gcc-bump-to-version-9.2.0.patch | 494 ++++++++++++++++++ 12 files changed, 507 insertions(+), 13 deletions(-) create mode 100644 extras/sdk-container/patches/buildroot/0006-package-gcc-bump-to-version-9.2.0.patch diff --git a/extras/sdk-container/Dockerfile b/extras/sdk-container/Dockerfile index 09ef695bbd7..10862edf436 100644 --- a/extras/sdk-container/Dockerfile +++ b/extras/sdk-container/Dockerfile @@ -25,8 +25,8 @@ RUN \ git config --global user.name "Builder" && \ git config --global user.email "builder@localhost" -ARG BRVER="2019.08.2" -ARG KVER="4.19.81" +ARG BRVER="2019.08.3" +ARG KVER="4.19.88" WORKDIR /home/builder COPY ./hashes/buildroot ./hashes @@ -48,6 +48,7 @@ RUN \ FROM toolchain as toolchain-gnu ARG ARCH +ARG KVER="4.19.88" RUN \ make O=output/${ARCH}-gnu defconfig BR2_DEFCONFIG=configs/sdk_${ARCH}_gnu_defconfig && \ make O=output/${ARCH}-gnu toolchain && \ @@ -57,6 +58,7 @@ RUN \ FROM toolchain as toolchain-musl ARG ARCH +ARG KVER="4.19.88" RUN \ make O=output/${ARCH}-musl defconfig BR2_DEFCONFIG=configs/sdk_${ARCH}_musl_defconfig && \ make O=output/${ARCH}-musl toolchain && \ @@ -69,7 +71,7 @@ FROM base as sdk USER root ARG ARCH -ARG KVER="4.19.81" +ARG KVER="4.19.88" WORKDIR / @@ -156,6 +158,7 @@ RUN \ rm musl-${MUSLVER}.tar.gz && \ mv musl-${MUSLVER} musl +ARG ARCH ARG TARGET="${ARCH}-thar-linux-musl" ARG SYSROOT="/${TARGET}/sys-root" ARG CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-clash-protection" @@ -220,6 +223,7 @@ RUN make install-unwind DESTDIR="${SYSROOT}" FROM sdk as sdk-libc +ARG ARCH ARG GNU_TARGET="${ARCH}-thar-linux-gnu" ARG GNU_SYSROOT="/${GNU_TARGET}/sys-root" ARG MUSL_TARGET="${ARCH}-thar-linux-musl" diff --git a/extras/sdk-container/configs/buildroot/sdk_aarch64_gnu_defconfig b/extras/sdk-container/configs/buildroot/sdk_aarch64_gnu_defconfig index 3ce3f519376..c66928c3e11 100644 --- a/extras/sdk-container/configs/buildroot/sdk_aarch64_gnu_defconfig +++ b/extras/sdk-container/configs/buildroot/sdk_aarch64_gnu_defconfig @@ -10,7 +10,6 @@ BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_KERNEL_HEADERS_4_19=y BR2_BINUTILS_VERSION_2_32_X=y BR2_GCC_VERSION_9_X=y -BR2_GCC_VERSION="9.2.0" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_GCC_ENABLE_LTO=y BR2_GCC_ENABLE_GRAPHITE=y diff --git a/extras/sdk-container/configs/buildroot/sdk_aarch64_musl_defconfig b/extras/sdk-container/configs/buildroot/sdk_aarch64_musl_defconfig index e28a1698fba..cd05b521e58 100644 --- a/extras/sdk-container/configs/buildroot/sdk_aarch64_musl_defconfig +++ b/extras/sdk-container/configs/buildroot/sdk_aarch64_musl_defconfig @@ -10,7 +10,6 @@ BR2_TOOLCHAIN_BUILDROOT_MUSL=y BR2_KERNEL_HEADERS_4_19=y BR2_BINUTILS_VERSION_2_32_X=y BR2_GCC_VERSION_9_X=y -BR2_GCC_VERSION="9.2.0" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_GCC_ENABLE_LTO=y BR2_GCC_ENABLE_GRAPHITE=y diff --git a/extras/sdk-container/configs/buildroot/sdk_x86_64_gnu_defconfig b/extras/sdk-container/configs/buildroot/sdk_x86_64_gnu_defconfig index c4258b60403..a712a400060 100644 --- a/extras/sdk-container/configs/buildroot/sdk_x86_64_gnu_defconfig +++ b/extras/sdk-container/configs/buildroot/sdk_x86_64_gnu_defconfig @@ -10,7 +10,6 @@ BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_KERNEL_HEADERS_4_19=y BR2_BINUTILS_VERSION_2_32_X=y BR2_GCC_VERSION_9_X=y -BR2_GCC_VERSION="9.2.0" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_GCC_ENABLE_LTO=y BR2_GCC_ENABLE_GRAPHITE=y diff --git a/extras/sdk-container/configs/buildroot/sdk_x86_64_musl_defconfig b/extras/sdk-container/configs/buildroot/sdk_x86_64_musl_defconfig index c23e139f9c2..0cc99d895c8 100644 --- a/extras/sdk-container/configs/buildroot/sdk_x86_64_musl_defconfig +++ b/extras/sdk-container/configs/buildroot/sdk_x86_64_musl_defconfig @@ -10,7 +10,6 @@ BR2_TOOLCHAIN_BUILDROOT_MUSL=y BR2_KERNEL_HEADERS_4_19=y BR2_BINUTILS_VERSION_2_32_X=y BR2_GCC_VERSION_9_X=y -BR2_GCC_VERSION="9.2.0" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_GCC_ENABLE_LTO=y BR2_GCC_ENABLE_GRAPHITE=y diff --git a/extras/sdk-container/hashes/buildroot b/extras/sdk-container/hashes/buildroot index 8ba21613429..7a945f13d73 100644 --- a/extras/sdk-container/hashes/buildroot +++ b/extras/sdk-container/hashes/buildroot @@ -1 +1 @@ -SHA512 (buildroot-2019.08.2.tar.gz) = e8c7481ac53f360a751fe3374e560cdea6ca5c8d0de07aa021bc91b925f5f5c45a6ebdbba523e3a1379eeaed25b3f49e1e521d2d71b3e6be632388d838cb29aa +SHA512 (buildroot-2019.08.3.tar.gz) = d5c00a38c92eb115648cd807ea70a24b18663261f884ea76246bf703f23f605563c161ad2d2d1121d7003ecbd61ee8caaff087a6a78b4ffd054c84071650c997 diff --git a/extras/sdk-container/patches/buildroot/0001-disable-shared-for-host-builds-of-gmp-isl-mpc-mpfr.patch b/extras/sdk-container/patches/buildroot/0001-disable-shared-for-host-builds-of-gmp-isl-mpc-mpfr.patch index ab6b49451ec..5816accc93f 100644 --- a/extras/sdk-container/patches/buildroot/0001-disable-shared-for-host-builds-of-gmp-isl-mpc-mpfr.patch +++ b/extras/sdk-container/patches/buildroot/0001-disable-shared-for-host-builds-of-gmp-isl-mpc-mpfr.patch @@ -1,7 +1,7 @@ From b12604ebee623187352f1430ad7b87ccfc58b3a0 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sun, 6 Aug 2017 23:15:02 +0000 -Subject: [PATCH 1/5] disable shared for host builds of gmp, isl, mpc, mpfr +Subject: [PATCH 1/6] disable shared for host builds of gmp, isl, mpc, mpfr Building these GCC dependencies as static libraries avoids the need to provide the shared library paths at runtime, using either rpath entries diff --git a/extras/sdk-container/patches/buildroot/0002-add-TOOLS_DIR-and-SYSROOT_DIR-to-control-output.patch b/extras/sdk-container/patches/buildroot/0002-add-TOOLS_DIR-and-SYSROOT_DIR-to-control-output.patch index a6a7680d1aa..22cbc522d65 100644 --- a/extras/sdk-container/patches/buildroot/0002-add-TOOLS_DIR-and-SYSROOT_DIR-to-control-output.patch +++ b/extras/sdk-container/patches/buildroot/0002-add-TOOLS_DIR-and-SYSROOT_DIR-to-control-output.patch @@ -1,7 +1,7 @@ From d668eab1928c59ce9885528f057016d4d1afbd88 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sun, 6 Aug 2017 23:35:06 +0000 -Subject: [PATCH 2/5] add TOOLS_DIR and SYSROOT_DIR to control output +Subject: [PATCH 2/6] add TOOLS_DIR and SYSROOT_DIR to control output The sysroot directory is essential to our purpose of building a relocatable toolchain, as GCC will look for it relative to the diff --git a/extras/sdk-container/patches/buildroot/0003-build-binutils-with-TOOLS_DIR-and-SYSROOT_DIR.patch b/extras/sdk-container/patches/buildroot/0003-build-binutils-with-TOOLS_DIR-and-SYSROOT_DIR.patch index c306c10d5c1..777c9089829 100644 --- a/extras/sdk-container/patches/buildroot/0003-build-binutils-with-TOOLS_DIR-and-SYSROOT_DIR.patch +++ b/extras/sdk-container/patches/buildroot/0003-build-binutils-with-TOOLS_DIR-and-SYSROOT_DIR.patch @@ -1,7 +1,7 @@ From ca0ae13b3e36a1eb5b913e550c1986582145ee1a Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sun, 6 Aug 2017 23:40:50 +0000 -Subject: [PATCH 3/5] build binutils with TOOLS_DIR and SYSROOT_DIR +Subject: [PATCH 3/6] build binutils with TOOLS_DIR and SYSROOT_DIR The binutils build only needs one stage, so we can write the binaries directly to the new output path. diff --git a/extras/sdk-container/patches/buildroot/0004-build-gcc-with-TOOLS_DIR-and-SYSROOT_DIR.patch b/extras/sdk-container/patches/buildroot/0004-build-gcc-with-TOOLS_DIR-and-SYSROOT_DIR.patch index dd4cca3c9e5..c5fe9781dc4 100644 --- a/extras/sdk-container/patches/buildroot/0004-build-gcc-with-TOOLS_DIR-and-SYSROOT_DIR.patch +++ b/extras/sdk-container/patches/buildroot/0004-build-gcc-with-TOOLS_DIR-and-SYSROOT_DIR.patch @@ -1,7 +1,7 @@ From bb41cbf1a393416e74efa9dc7bee0610a2ec3fbb Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sun, 6 Aug 2017 23:58:27 +0000 -Subject: [PATCH 4/5] build gcc with TOOLS_DIR and SYSROOT_DIR +Subject: [PATCH 4/6] build gcc with TOOLS_DIR and SYSROOT_DIR Most of the changes here are to the second and final stage of our GCC build, so that the binaries are written to the new output path, and diff --git a/extras/sdk-container/patches/buildroot/0005-package-binutils-bring-back-sysroot-fix-for-2.32.patch b/extras/sdk-container/patches/buildroot/0005-package-binutils-bring-back-sysroot-fix-for-2.32.patch index e31c60299d2..8b1cd2546ef 100644 --- a/extras/sdk-container/patches/buildroot/0005-package-binutils-bring-back-sysroot-fix-for-2.32.patch +++ b/extras/sdk-container/patches/buildroot/0005-package-binutils-bring-back-sysroot-fix-for-2.32.patch @@ -1,7 +1,7 @@ From d35e7e4616527f6e3b3807cd185aee4d2c911818 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Fri, 15 Mar 2019 18:32:49 +0000 -Subject: [PATCH 5/5] package/binutils: bring back sysroot fix for 2.32 +Subject: [PATCH 5/6] package/binutils: bring back sysroot fix for 2.32 Signed-off-by: Ben Cressey --- diff --git a/extras/sdk-container/patches/buildroot/0006-package-gcc-bump-to-version-9.2.0.patch b/extras/sdk-container/patches/buildroot/0006-package-gcc-bump-to-version-9.2.0.patch new file mode 100644 index 00000000000..0ed4ae3aad0 --- /dev/null +++ b/extras/sdk-container/patches/buildroot/0006-package-gcc-bump-to-version-9.2.0.patch @@ -0,0 +1,494 @@ +From 7163388d50a74c491e7d9cc94513814d2d438c5c Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Wed, 14 Aug 2019 18:46:13 +0200 +Subject: [PATCH 6/6] package/gcc: bump to version 9.2.0 + +Remove upstream patches + +https://github.com/gcc-mirror/gcc/commit/472bac30e63ffacecfa5eda813054555f2cc7def +https://github.com/gcc-mirror/gcc/commit/869e468112244b6a3812ab181642fcd9df8838d4 + +Signed-off-by: Romain Naour +Cc: Alexey Brodkin +Cc: Evgeniy Didin +Signed-off-by: Thomas Petazzoni +--- + .../9.1.0/0001-ARC-Backport-fix-PR89838.patch | 367 ------------------ + .../0002-ARC-Fix-emitting-TLS-symbols.patch | 61 --- + package/gcc/Config.in.host | 2 +- + package/gcc/gcc.hash | 4 +- + 4 files changed, 3 insertions(+), 431 deletions(-) + delete mode 100644 package/gcc/9.1.0/0001-ARC-Backport-fix-PR89838.patch + delete mode 100644 package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch + +diff --git a/package/gcc/9.1.0/0001-ARC-Backport-fix-PR89838.patch b/package/gcc/9.1.0/0001-ARC-Backport-fix-PR89838.patch +deleted file mode 100644 +index 3e8b86d709..0000000000 +--- a/package/gcc/9.1.0/0001-ARC-Backport-fix-PR89838.patch ++++ /dev/null +@@ -1,367 +0,0 @@ +-From e5398fbcaa1dc35422958acfdb13074bf4a797a3 Mon Sep 17 00:00:00 2001 +-From: claziss +-Date: Tue, 25 Jun 2019 11:02:21 +0000 +-Subject: [PATCH 1/2] [ARC] Backport fix PR89838 +- +-Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89838 +-Similar to https://git.buildroot.org/buildroot/commit/?h=dbf7fffb37e25c40fd5c03d0a64e50a1bba86424 +-but rebased on upstream stable "gcc-9-branch". +- +-gcc/ +-xxxx-xx-xx Claudiu Zissulescu +- +- * config/arc/arc.c (arc_symbol_binds_local_p): New function. +- (arc_legitimize_pic_address): Simplify and cleanup the function. +- (SYMBOLIC_CONST): Remove. +- (prepare_pic_move): Likewise. +- (prepare_move_operands): Handle complex mov cases here. +- (arc_legitimize_address_0): Remove call to +- arc_legitimize_pic_address. +- (arc_legitimize_address): Remove call to +- arc_legitimize_tls_address. +- * config/arc/arc.md (movqi_insn): Allow Cm3 match. +- (movhi_insn): Likewise. +- +-/gcc/testsuite +-xxxx-xx-xx Claudiu Zissulescu +-Signed-off-by: Alexey Brodkin +---- +- gcc/config/arc/arc.c | 238 ++++++++++++-------------------------------------- +- gcc/config/arc/arc.md | 8 +- +- 2 files changed, 60 insertions(+), 186 deletions(-) +- +-diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c +-index 2f5753b02fa..daacc79d0cb 100644 +---- a/gcc/config/arc/arc.c +-+++ b/gcc/config/arc/arc.c +-@@ -5971,130 +5971,47 @@ arc_legitimize_tls_address (rtx addr, enum tls_model model) +- } +- } +- +--/* Legitimize a pic address reference in ORIG. +-- The return value is the legitimated address. +-- If OLDX is non-zero, it is the target to assign the address to first. */ +-+/* Return true if SYMBOL_REF X binds locally. */ +- +--static rtx +--arc_legitimize_pic_address (rtx orig, rtx oldx) +-+static bool +-+arc_symbol_binds_local_p (const_rtx x) +- { +-- rtx addr = orig; +-- rtx pat = orig; +-- rtx base; +-+ return (SYMBOL_REF_DECL (x) +-+ ? targetm.binds_local_p (SYMBOL_REF_DECL (x)) +-+ : SYMBOL_REF_LOCAL_P (x)); +-+} +- +-- if (oldx == orig) +-- oldx = NULL; +-+/* Legitimize a pic address reference in ADDR. The return value is +-+ the legitimated address. */ +- +-- if (GET_CODE (addr) == LABEL_REF) +-- ; /* Do nothing. */ +-- else if (GET_CODE (addr) == SYMBOL_REF) +-+static rtx +-+arc_legitimize_pic_address (rtx addr) +-+{ +-+ if (!flag_pic) +-+ return addr; +-+ +-+ switch (GET_CODE (addr)) +- { +-- enum tls_model model = SYMBOL_REF_TLS_MODEL (addr); +-- if (model != 0) +-- return arc_legitimize_tls_address (addr, model); +-- else if (!flag_pic) +-- return orig; +-- else if (CONSTANT_POOL_ADDRESS_P (addr) || SYMBOL_REF_LOCAL_P (addr)) +-- return arc_unspec_offset (addr, ARC_UNSPEC_GOTOFFPC); +-+ case SYMBOL_REF: +-+ /* TLS symbols are handled in different place. */ +-+ if (SYMBOL_REF_TLS_MODEL (addr)) +-+ return addr; +- +- /* This symbol must be referenced via a load from the Global +- Offset Table (@GOTPC). */ +-- pat = arc_unspec_offset (addr, ARC_UNSPEC_GOT); +-- pat = gen_const_mem (Pmode, pat); +-- +-- if (oldx == NULL) +-- oldx = gen_reg_rtx (Pmode); +-- +-- emit_move_insn (oldx, pat); +-- pat = oldx; +-- } +-- else +-- { +-- if (GET_CODE (addr) == CONST) +-- { +-- addr = XEXP (addr, 0); +-- if (GET_CODE (addr) == UNSPEC) +-- { +-- /* Check that the unspec is one of the ones we generate? */ +-- return orig; +-- } +-- /* fwprop is placing in the REG_EQUIV notes constant pic +-- unspecs expressions. Then, loop may use these notes for +-- optimizations resulting in complex patterns that are not +-- supported by the current implementation. The following +-- two if-cases are simplifying the complex patters to +-- simpler ones. */ +-- else if (GET_CODE (addr) == MINUS) +-- { +-- rtx op0 = XEXP (addr, 0); +-- rtx op1 = XEXP (addr, 1); +-- gcc_assert (oldx); +-- gcc_assert (GET_CODE (op1) == UNSPEC); +-- +-- emit_move_insn (oldx, +-- gen_rtx_CONST (SImode, +-- arc_legitimize_pic_address (op1, +-- NULL_RTX))); +-- emit_insn (gen_rtx_SET (oldx, gen_rtx_MINUS (SImode, op0, oldx))); +-- return oldx; +-- +-- } +-- else if (GET_CODE (addr) != PLUS) +-- { +-- rtx tmp = XEXP (addr, 0); +-- enum rtx_code code = GET_CODE (addr); +-- +-- /* It only works for UNARY operations. */ +-- gcc_assert (UNARY_P (addr)); +-- gcc_assert (GET_CODE (tmp) == UNSPEC); +-- gcc_assert (oldx); +-- +-- emit_move_insn +-- (oldx, +-- gen_rtx_CONST (SImode, +-- arc_legitimize_pic_address (tmp, +-- NULL_RTX))); +-- +-- emit_insn (gen_rtx_SET (oldx, +-- gen_rtx_fmt_ee (code, SImode, +-- oldx, const0_rtx))); +-- +-- return oldx; +-- } +-- else +-- { +-- gcc_assert (GET_CODE (addr) == PLUS); +-- if (GET_CODE (XEXP (addr, 0)) == UNSPEC) +-- return orig; +-- } +-- } +-- +-- if (GET_CODE (addr) == PLUS) +-- { +-- rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1); +-+ if (!arc_symbol_binds_local_p (addr)) +-+ return gen_const_mem (Pmode, arc_unspec_offset (addr, ARC_UNSPEC_GOT)); +- +-- base = arc_legitimize_pic_address (op0, oldx); +-- pat = arc_legitimize_pic_address (op1, +-- base == oldx ? NULL_RTX : oldx); +-- +-- if (base == op0 && pat == op1) +-- return orig; +-+ /* Local symb: use @pcl to access it. */ +-+ /* Fall through. */ +-+ case LABEL_REF: +-+ return arc_unspec_offset (addr, ARC_UNSPEC_GOTOFFPC); +- +-- if (GET_CODE (pat) == CONST_INT) +-- pat = plus_constant (Pmode, base, INTVAL (pat)); +-- else +-- { +-- if (GET_CODE (pat) == PLUS && CONSTANT_P (XEXP (pat, 1))) +-- { +-- base = gen_rtx_PLUS (Pmode, base, XEXP (pat, 0)); +-- pat = XEXP (pat, 1); +-- } +-- pat = gen_rtx_PLUS (Pmode, base, pat); +-- } +-- } +-+ default: +-+ break; +- } +- +-- return pat; +-+ return addr; +- } +- +- /* Output address constant X to FILE, taking PIC into account. */ +-@@ -6256,28 +6173,6 @@ arc_output_pic_addr_const (FILE * file, rtx x, int code) +- } +- } +- +--#define SYMBOLIC_CONST(X) \ +--(GET_CODE (X) == SYMBOL_REF \ +-- || GET_CODE (X) == LABEL_REF \ +-- || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X))) +-- +--/* Emit insns to move operands[1] into operands[0]. */ +-- +--static void +--prepare_pic_move (rtx *operands, machine_mode) +--{ +-- if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1]) +-- && flag_pic) +-- operands[1] = force_reg (Pmode, operands[1]); +-- else +-- { +-- rtx temp = (reload_in_progress ? operands[0] +-- : flag_pic? gen_reg_rtx (Pmode) : NULL_RTX); +-- operands[1] = arc_legitimize_pic_address (operands[1], temp); +-- } +--} +-- +-- +- /* The function returning the number of words, at the beginning of an +- argument, must be put in registers. The returned value must be +- zero for arguments that are passed entirely in registers or that +-@@ -9053,54 +8948,37 @@ prepare_move_operands (rtx *operands, machine_mode mode) +- } +- } +- +-- if (mode == SImode && SYMBOLIC_CONST (operands[1])) +-+ if (GET_CODE (operands[1]) == SYMBOL_REF) +- { +-- prepare_pic_move (operands, SImode); +-- +-- /* Disable any REG_EQUALs associated with the symref +-- otherwise the optimization pass undoes the work done +-- here and references the variable directly. */ +-+ enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); +-+ if (MEM_P (operands[0]) && flag_pic) +-+ operands[1] = force_reg (mode, operands[1]); +-+ else if (model) +-+ operands[1] = arc_legitimize_tls_address (operands[1], model); +- } +- +-+ operands[1] = arc_legitimize_pic_address (operands[1]); +-+ +-+ /* Store instructions are limited, they only accept as address an +-+ immediate, a register or a register plus a small immediate. */ +- if (MEM_P (operands[0]) +-- && !(reload_in_progress || reload_completed)) +-+ && !move_dest_operand (operands[0], mode)) +- { +-- operands[1] = force_reg (mode, operands[1]); +-- if (!move_dest_operand (operands[0], mode)) +-- { +-- rtx addr = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); +-- /* This is like change_address_1 (operands[0], mode, 0, 1) , +-- except that we can't use that function because it is static. */ +-- rtx pat = change_address (operands[0], mode, addr); +-- MEM_COPY_ATTRIBUTES (pat, operands[0]); +-- operands[0] = pat; +-- } +-- if (!cse_not_expected) +-- { +-- rtx pat = XEXP (operands[0], 0); +-- +-- pat = arc_legitimize_address_0 (pat, pat, mode); +-- if (pat) +-- { +-- pat = change_address (operands[0], mode, pat); +-- MEM_COPY_ATTRIBUTES (pat, operands[0]); +-- operands[0] = pat; +-- } +-- } +-+ rtx tmp0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); +-+ rtx tmp1 = change_address (operands[0], mode, tmp0); +-+ MEM_COPY_ATTRIBUTES (tmp1, operands[0]); +-+ operands[0] = tmp1; +- } +- +-- if (MEM_P (operands[1]) && !cse_not_expected) +-- { +-- rtx pat = XEXP (operands[1], 0); +-- +-- pat = arc_legitimize_address_0 (pat, pat, mode); +-- if (pat) +-- { +-- pat = change_address (operands[1], mode, pat); +-- MEM_COPY_ATTRIBUTES (pat, operands[1]); +-- operands[1] = pat; +-- } +-- } +-+ /* Check if it is constant but it is not legitimized. */ +-+ if (CONSTANT_P (operands[1]) +-+ && !arc_legitimate_constant_p (mode, operands[1])) +-+ operands[1] = force_reg (mode, XEXP (operands[1], 0)); +-+ else if (MEM_P (operands[0]) +-+ && ((CONSTANT_P (operands[1]) +-+ && !satisfies_constraint_Cm3 (operands[1])) +-+ || MEM_P (operands[1]))) +-+ operands[1] = force_reg (mode, operands[1]); +- +- return false; +- } +-@@ -9572,11 +9450,10 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED, +- { +- rtx addr, inner; +- +-- if (flag_pic && SYMBOLIC_CONST (x)) +-- (x) = arc_legitimize_pic_address (x, 0); +- addr = x; +- if (GET_CODE (addr) == CONST) +- addr = XEXP (addr, 0); +-+ +- if (GET_CODE (addr) == PLUS +- && CONST_INT_P (XEXP (addr, 1)) +- && ((GET_CODE (XEXP (addr, 0)) == SYMBOL_REF +-@@ -9607,13 +9484,6 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED, +- static rtx +- arc_legitimize_address (rtx orig_x, rtx oldx, machine_mode mode) +- { +-- if (GET_CODE (orig_x) == SYMBOL_REF) +-- { +-- enum tls_model model = SYMBOL_REF_TLS_MODEL (orig_x); +-- if (model != 0) +-- return arc_legitimize_tls_address (orig_x, model); +-- } +-- +- rtx new_x = arc_legitimize_address_0 (orig_x, oldx, mode); +- +- if (new_x) +-diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md +-index ce1004c1b56..78e304d4c71 100644 +---- a/gcc/config/arc/arc.md +-+++ b/gcc/config/arc/arc.md +-@@ -671,7 +671,9 @@ core_3, archs4x, archs4xd, archs4xd_slow" +- [(set (match_operand:QI 0 "move_dest_operand" "=Rcq,Rcq#q, w,Rcq#q, h, w, w,???w,h, w,Rcq, S,!*x, r,r, Ucm,m,???m, m,Usc") +- (match_operand:QI 1 "move_src_operand" " cL, cP,Rcq#q, P,hCm1,cL, I,?Rac,i,?i, T,Rcq,Usd,Ucm,m,?Rac,c,?Rac,Cm3,i"))] +- "register_operand (operands[0], QImode) +-- || register_operand (operands[1], QImode)" +-+ || register_operand (operands[1], QImode) +-+ || (satisfies_constraint_Cm3 (operands[1]) +-+ && memory_operand (operands[0], QImode))" +- "@ +- mov%? %0,%1%& +- mov%? %0,%1%& +-@@ -713,7 +715,9 @@ core_3, archs4x, archs4xd, archs4xd_slow" +- /* Don't use a LIMM that we could load with a single insn - we loose +- delay-slot filling opportunities. */ +- && !satisfies_constraint_I (operands[1]) +-- && satisfies_constraint_Usc (operands[0]))" +-+ && satisfies_constraint_Usc (operands[0])) +-+ || (satisfies_constraint_Cm3 (operands[1]) +-+ && memory_operand (operands[0], HImode))" +- "@ +- mov%? %0,%1%& +- mov%? %0,%1%& +--- +-2.16.2 +- +diff --git a/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch b/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch +deleted file mode 100644 +index 15df921290..0000000000 +--- a/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch ++++ /dev/null +@@ -1,61 +0,0 @@ +-From d17cd0f88ed986be4046b2eb70240dc95b2958cd Mon Sep 17 00:00:00 2001 +-From: Claudiu Zissulescu +-Date: Wed, 26 Jun 2019 17:53:51 +0300 +-Subject: [PATCH 2/2] [ARC] Fix emitting TLS symbols. +- +-When storing a TLS symbol to memory, always use an intermediate register +-to load it. Otherwise compiler generates instruction which couldn't be +-encoded and we see: +------------------------------>8--------------------------- +-In file included from gethstent_r.c:34: +-../nss/getXXent_r.c: In function '__gethostent_r': +-../nss/getXXent_r.c:168:1: error: unrecognizable insn: +- } +- ^ +-(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) +- (const_int 16 [0x10])) [0 S4 A32]) +- (plus:SI (reg:SI 25 r25) +- (reg:SI 174))) "../nss/getXXent_r.c":160 -1 +- (nil)) +-during RTL pass: vregs +-../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +-In file included from getnetent_r.c:34: +-../nss/getXXent_r.c: In function '__getnetent_r': +-../nss/getXXent_r.c:168:1: error: unrecognizable insn: +- } +- ^ +-(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) +- (const_int 16 [0x10])) [0 S4 A32]) +- (plus:SI (reg:SI 25 r25) +- (reg:SI 174))) "../nss/getXXent_r.c":160 -1 +- (nil)) +-during RTL pass: vregs +-../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +------------------------------>8--------------------------- +- +-Note this patch is not yet submitted to the GCC's master and gcc-9-branch but +-will be submitted soon. That said with bump of GCC this patch won't be +-needed any longer. +- +-Signed-off-by: Claudiu Zissulescu +-Signed-off-by: Alexey Brodkin +---- +- gcc/config/arc/arc.c | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +-diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c +-index daacc79d0cb..ee1f70bbb51 100644 +---- a/gcc/config/arc/arc.c +-+++ b/gcc/config/arc/arc.c +-@@ -8951,7 +8951,7 @@ prepare_move_operands (rtx *operands, machine_mode mode) +- if (GET_CODE (operands[1]) == SYMBOL_REF) +- { +- enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); +-- if (MEM_P (operands[0]) && flag_pic) +-+ if (MEM_P (operands[0])) +- operands[1] = force_reg (mode, operands[1]); +- else if (model) +- operands[1] = arc_legitimize_tls_address (operands[1], model); +--- +-2.16.2 +- +diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host +index 4425be9df3..5a53b9702f 100644 +--- a/package/gcc/Config.in.host ++++ b/package/gcc/Config.in.host +@@ -85,7 +85,7 @@ config BR2_GCC_VERSION + default "5.5.0" if BR2_GCC_VERSION_5_X + default "7.4.0" if BR2_GCC_VERSION_7_X + default "8.3.0" if BR2_GCC_VERSION_8_X +- default "9.1.0" if BR2_GCC_VERSION_9_X ++ default "9.2.0" if BR2_GCC_VERSION_9_X + default "arc-2019.03-release" if BR2_GCC_VERSION_ARC + default "or1k-musl-5.4.0-20170218" if BR2_GCC_VERSION_OR1K + default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY +diff --git a/package/gcc/gcc.hash b/package/gcc/gcc.hash +index 20f5145be6..5be1ec1a1d 100644 +--- a/package/gcc/gcc.hash ++++ b/package/gcc/gcc.hash +@@ -4,8 +4,8 @@ sha512 670ff52c2ae12c7852c12987e91798c5aa8bd6daf21f0d6e0cd57a4aa59cc4f06a837fe7 + sha512 8864d8e4b97c2e1a4f17422f6e68120172ebefeab97b1757734f7185ca68a6b9a89011c6833c03fa454c17b0ac35b15e1d284881e6971035948ac6100f3aa45e gcc-7.4.0.tar.xz + # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-8.3.0/sha512.sum + sha512 1811337ae3add9680cec64968a2509d085b6dc5b6783fc1e8c295e3e47416196fd1a3ad8dfe7e10be2276b4f62c357659ce2902f239f60a8648548231b4b5802 gcc-8.3.0.tar.xz +-# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-9.1.0/sha512.sum +-sha512 b6134df027e734cee5395afd739fcfa4ea319a6017d662e54e89df927dea19d3fff7a6e35d676685383034e3db01c9d0b653f63574c274eeb15a2cb0bc7a1f28 gcc-9.1.0.tar.xz ++# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-9.2.0/sha512.sum ++sha512 a12dff52af876aee0fd89a8d09cdc455f35ec46845e154023202392adc164848faf8ee881b59b681b696e27c69fd143a214014db4214db62f9891a1c8365c040 gcc-9.2.0.tar.xz + + # Locally calculated (fetched from Github) + sha512 c3f63fb601140f92d2dbef96b2dcc025ef754d2f049bfcc3d33e746c7b218b5138f2d8768cd580134858a8d347d234cf3ead276638f6de409f8f07c986e136b6 gcc-arc-2019.03-release.tar.gz +-- +2.21.0 + From 78c85764db52fb79cb89bb74b3f7854387bc3b11 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sat, 21 Dec 2019 17:20:35 +0000 Subject: [PATCH 2/3] sdk: bump to v0.3 Align the versioning scheme with our other first-party containers. Signed-off-by: Ben Cressey --- extras/sdk-container/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/sdk-container/Makefile b/extras/sdk-container/Makefile index 3d315143a9a..b8e7df226f6 100644 --- a/extras/sdk-container/Makefile +++ b/extras/sdk-container/Makefile @@ -1,6 +1,6 @@ ARCH ?= $(shell uname -m) -VERSION := 0.0.2 +VERSION := v0.3 TAG := thar/sdk-$(ARCH):$(VERSION) ARCHIVE := thar-sdk-$(ARCH)-$(VERSION).tar.gz From 68d35872f485d252492170a03e41cc61d4d30e40 Mon Sep 17 00:00:00 2001 From: Ben Cressey Date: Sat, 21 Dec 2019 17:21:36 +0000 Subject: [PATCH 3/3] build: use SDK v0.3 Signed-off-by: Ben Cressey --- Makefile.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index 3290046eaee..f7b5ce06082 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -19,7 +19,7 @@ DOCKER_BUILDKIT = "1" [env.development] # Defined here to allow us to override ${BUILDSYS_ARCH} on the command line. -BUILDSYS_SDK_IMAGE = "thar/sdk-${BUILDSYS_ARCH}:0.0.2" +BUILDSYS_SDK_IMAGE = "thar/sdk-${BUILDSYS_ARCH}:v0.3" # Permit pulling directly Upstream URLs when lookaside cache results in MISSes. BUILDSYS_ALLOW_UPSTREAM_SOURCE_URL = "true" # Extra flags used when spawning containers.