Auto merge of #58541 - kennytm:fix-publish-toolstate-py-again, r=oli-obk

publish_toolstate.py: further fix the runtime errors

The regex was missing a `,`, causing `relevant_pr_match` to become None and set the PR number to -1 and assigned the new issue to `@<unknown user>`. This causes the 422 error when creating the issue due to invalid assignee and unable to leave the tool-is-broken comment since PR -1 does not exist.

The default user names are now also changed to @ghost to prevent the 422 error in case anything goes wrong again.
diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md
index 8d4dbc3..34320ab 100644
--- a/src/ci/docker/README.md
+++ b/src/ci/docker/README.md
@@ -131,13 +131,15 @@
 For targets: `arm-unknown-linux-gnueabi`
 
 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
 - Target options > Target Architecture = arm
 - Target options > Architecture level = armv6 -- (+)
 - Target options > Floating point = software (no FPU) -- (\*)
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
 - C compiler > C++ = ENABLE -- to cross compile LLVM
 
 ### `arm-linux-gnueabihf.config`
@@ -145,6 +147,8 @@
 For targets: `arm-unknown-linux-gnueabihf`
 
 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
 - Target options > Target Architecture = arm
 - Target options > Architecture level = armv6 -- (+)
 - Target options > Use specific FPU = vfp -- (+)
@@ -152,8 +156,8 @@
 - Target options > Default instruction set mode = arm -- (+)
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
 - C compiler > C++ = ENABLE -- to cross compile LLVM
 
 ### `armv7-linux-gnueabihf.config`
@@ -161,6 +165,8 @@
 For targets: `armv7-unknown-linux-gnueabihf`
 
 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
 - Target options > Target Architecture = arm
 - Target options > Suffix to the arch-part = v7
 - Target options > Architecture level = armv7-a -- (+)
@@ -169,8 +175,8 @@
 - Target options > Default instruction set mode = thumb -- (\*)
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
 - C compiler > C++ = ENABLE -- to cross compile LLVM
 
 (\*) These options have been selected to match the configuration of the arm
@@ -204,7 +210,7 @@
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
 - C compiler > C++ = ENABLE -- to cross compile LLVM
 
 ### `powerpc64-linux-gnu.config`
@@ -221,7 +227,7 @@
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
 - C compiler > C++ = ENABLE -- to cross compile LLVM
 
 (+) These CPU options match the configuration of the toolchains in RHEL6.
@@ -232,12 +238,12 @@
 
 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
 - Path and misc options > Patches origin = Bundled, then local
-- Path and misc options > Local patch directory = /build/patches
+- Path and misc options > Local patch directory = /tmp/patches
 - Target options > Target Architecture = s390
 - Target options > Bitness = 64-bit
 - Operating System > Target OS = linux
 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
 - C compiler > gcc extra config = --with-arch=z10 -- LLVM's minimum support
 - C compiler > C++ = ENABLE -- to cross compile LLVM
diff --git a/src/ci/docker/dist-arm-linux/Dockerfile b/src/ci/docker/dist-arm-linux/Dockerfile
index 6ddc5c1..48851ae 100644
--- a/src/ci/docker/dist-arm-linux/Dockerfile
+++ b/src/ci/docker/dist-arm-linux/Dockerfile
@@ -16,6 +16,7 @@
 USER rustbuild
 WORKDIR /tmp
 
+COPY dist-arm-linux/patches/ /tmp/patches/
 COPY dist-arm-linux/arm-linux-gnueabi.config dist-arm-linux/build-toolchains.sh /tmp/
 RUN ./build-toolchains.sh
 
diff --git a/src/ci/docker/dist-arm-linux/arm-linux-gnueabi.config b/src/ci/docker/dist-arm-linux/arm-linux-gnueabi.config
index f73ad06..4185112 100644
--- a/src/ci/docker/dist-arm-linux/arm-linux-gnueabi.config
+++ b/src/ci/docker/dist-arm-linux/arm-linux-gnueabi.config
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@
 # CT_FORCE_EXTRACT is not set
 CT_OVERIDE_CONFIG_GUESS_SUB=y
 # CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
 # CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
 # CT_PATCH_LOCAL_BUNDLED is not set
 # CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
 # CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
 # CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
 
 #
 # Build behavior
@@ -391,8 +394,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -407,8 +410,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -420,7 +424,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -492,7 +496,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -500,7 +503,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -526,15 +528,13 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
 # CT_CLOOG_V_0_18_1 is not set
 # CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644
index 0000000..871d522
--- /dev/null
+++ b/src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
@@ -0,0 +1,48 @@
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Tue May 20 21:27:13 2014 +0000
+
+    Fix ARM build with GCC trunk.
+    
+    sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+    sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+    variables that are written in C code but only read from toplevel asms.
+    Current GCC trunk now optimizes away such apparently write-only static
+    variables, so causing a build failure.  This patch marks those
+    variables with __attribute_used__ to avoid that optimization.
+    
+    Tested that this fixes the build for ARM.
+    
+            * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+            (libgcc_s_resume): Use __attribute_used__.
+            * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+            Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+ 
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+ 
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ 
diff --git a/src/ci/docker/dist-armhf-linux/Dockerfile b/src/ci/docker/dist-armhf-linux/Dockerfile
index e4d4b2f..d1dd9fa 100644
--- a/src/ci/docker/dist-armhf-linux/Dockerfile
+++ b/src/ci/docker/dist-armhf-linux/Dockerfile
@@ -16,6 +16,7 @@
 USER rustbuild
 WORKDIR /tmp
 
+COPY dist-armhf-linux/patches/ /tmp/patches/
 COPY dist-armhf-linux/arm-linux-gnueabihf.config dist-armhf-linux/build-toolchains.sh /tmp/
 RUN ./build-toolchains.sh
 
diff --git a/src/ci/docker/dist-armhf-linux/arm-linux-gnueabihf.config b/src/ci/docker/dist-armhf-linux/arm-linux-gnueabihf.config
index 1feeef1..bebbcd1 100644
--- a/src/ci/docker/dist-armhf-linux/arm-linux-gnueabihf.config
+++ b/src/ci/docker/dist-armhf-linux/arm-linux-gnueabihf.config
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@
 # CT_FORCE_EXTRACT is not set
 CT_OVERIDE_CONFIG_GUESS_SUB=y
 # CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
 # CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
 # CT_PATCH_LOCAL_BUNDLED is not set
 # CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
 # CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
 # CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
 
 #
 # Build behavior
@@ -392,8 +395,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -408,8 +411,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -421,7 +425,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -493,7 +497,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -501,7 +504,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -527,15 +529,13 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
 # CT_CLOOG_V_0_18_1 is not set
 # CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644
index 0000000..871d522
--- /dev/null
+++ b/src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
@@ -0,0 +1,48 @@
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Tue May 20 21:27:13 2014 +0000
+
+    Fix ARM build with GCC trunk.
+    
+    sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+    sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+    variables that are written in C code but only read from toplevel asms.
+    Current GCC trunk now optimizes away such apparently write-only static
+    variables, so causing a build failure.  This patch marks those
+    variables with __attribute_used__ to avoid that optimization.
+    
+    Tested that this fixes the build for ARM.
+    
+            * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+            (libgcc_s_resume): Use __attribute_used__.
+            * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+            Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+ 
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+ 
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ 
diff --git a/src/ci/docker/dist-armv7-linux/Dockerfile b/src/ci/docker/dist-armv7-linux/Dockerfile
index 99fe7bd..170b813 100644
--- a/src/ci/docker/dist-armv7-linux/Dockerfile
+++ b/src/ci/docker/dist-armv7-linux/Dockerfile
@@ -16,6 +16,7 @@
 USER rustbuild
 WORKDIR /tmp
 
+COPY dist-armv7-linux/patches/ /tmp/patches/
 COPY dist-armv7-linux/build-toolchains.sh dist-armv7-linux/armv7-linux-gnueabihf.config /tmp/
 RUN ./build-toolchains.sh
 
diff --git a/src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config b/src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config
index 79d6c77..5cccfd8 100644
--- a/src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config
+++ b/src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@
 # CT_FORCE_EXTRACT is not set
 CT_OVERIDE_CONFIG_GUESS_SUB=y
 # CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
 # CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
 # CT_PATCH_LOCAL_BUNDLED is not set
 # CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
 # CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
 # CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
 
 #
 # Build behavior
@@ -155,12 +158,6 @@
 # CT_ARCH_FLOAT_AUTO is not set
 # CT_ARCH_FLOAT_SOFTFP is not set
 CT_ARCH_FLOAT="hard"
-# CT_ARCH_ALPHA_EV4 is not set
-# CT_ARCH_ALPHA_EV45 is not set
-# CT_ARCH_ALPHA_EV5 is not set
-# CT_ARCH_ALPHA_EV56 is not set
-# CT_ARCH_ALPHA_EV6 is not set
-# CT_ARCH_ALPHA_EV67 is not set
 
 #
 # arm other options
@@ -311,8 +308,6 @@
 CT_LIBC_VERSION="2.16.0"
 CT_LIBC_glibc=y
 # CT_LIBC_musl is not set
-# CT_LIBC_newlib is not set
-# CT_LIBC_none is not set
 # CT_LIBC_uClibc is not set
 CT_LIBC_avr_libc_AVAILABLE=y
 CT_LIBC_glibc_AVAILABLE=y
@@ -400,8 +395,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -416,8 +411,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -429,7 +425,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -501,7 +497,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -509,7 +504,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -535,15 +529,13 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
 # CT_CLOOG_V_0_18_1 is not set
 # CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644
index 0000000..871d522
--- /dev/null
+++ b/src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
@@ -0,0 +1,48 @@
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date:   Tue May 20 21:27:13 2014 +0000
+
+    Fix ARM build with GCC trunk.
+    
+    sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+    sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+    variables that are written in C code but only read from toplevel asms.
+    Current GCC trunk now optimizes away such apparently write-only static
+    variables, so causing a build failure.  This patch marks those
+    variables with __attribute_used__ to avoid that optimization.
+    
+    Tested that this fixes the build for ARM.
+    
+            * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+            (libgcc_s_resume): Use __attribute_used__.
+            * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+            Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+ 
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+ 
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++  __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ 
diff --git a/src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch b/src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch
new file mode 100644
index 0000000..a96b488
--- /dev/null
+++ b/src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch
@@ -0,0 +1,26 @@
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+   ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+-    3.4* | 4.[0-9]* )
++    3.4* | [4-9].* )
+        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ 
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+-  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+   critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
diff --git a/src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config b/src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config
index 984a0a0..7df41da 100644
--- a/src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config
+++ b/src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config
@@ -359,8 +359,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -375,8 +375,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -388,7 +389,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -460,7 +461,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -468,7 +468,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -494,15 +493,13 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
 # CT_CLOOG_V_0_18_1 is not set
 # CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch b/src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch
new file mode 100644
index 0000000..a96b488
--- /dev/null
+++ b/src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch
@@ -0,0 +1,26 @@
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+   ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+-    3.4* | 4.[0-9]* )
++    3.4* | [4-9].* )
+        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ 
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+-  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+   critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
diff --git a/src/ci/docker/dist-powerpc64-linux/powerpc64-linux-gnu.config b/src/ci/docker/dist-powerpc64-linux/powerpc64-linux-gnu.config
index c2d02ee..4aab4f4 100644
--- a/src/ci/docker/dist-powerpc64-linux/powerpc64-linux-gnu.config
+++ b/src/ci/docker/dist-powerpc64-linux/powerpc64-linux-gnu.config
@@ -359,8 +359,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -375,8 +375,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -388,7 +389,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -460,7 +461,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -468,7 +468,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -494,15 +493,10 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
-# CT_CLOOG_V_0_18_1 is not set
-# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch b/src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch
new file mode 100644
index 0000000..a96b488
--- /dev/null
+++ b/src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch
@@ -0,0 +1,26 @@
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+   ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+-    3.4* | 4.[0-9]* )
++    3.4* | [4-9].* )
+        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ 
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+-  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+   critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
diff --git a/src/ci/docker/dist-s390x-linux/s390x-linux-gnu.config b/src/ci/docker/dist-s390x-linux/s390x-linux-gnu.config
index fa5e451..cd1c41b 100644
--- a/src/ci/docker/dist-s390x-linux/s390x-linux-gnu.config
+++ b/src/ci/docker/dist-s390x-linux/s390x-linux-gnu.config
@@ -339,8 +339,8 @@
 CT_CC_CORE_PASS_2_NEEDED=y
 CT_CC_gcc=y
 # CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
 # CT_CC_GCC_V_4_8_5 is not set
 # CT_CC_GCC_V_4_7_4 is not set
 # CT_CC_GCC_V_4_6_4 is not set
@@ -355,8 +355,9 @@
 CT_CC_GCC_4_6_or_later=y
 CT_CC_GCC_4_7_or_later=y
 CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
 CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
 CT_CC_GCC_HAS_GRAPHITE=y
 CT_CC_GCC_USE_GRAPHITE=y
 CT_CC_GCC_HAS_LTO=y
@@ -368,7 +369,7 @@
 CT_CC_GCC_USE_MPC=y
 CT_CC_GCC_HAS_LIBQUADMATH=y
 CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
 # CT_CC_LANG_FORTRAN is not set
 CT_CC_GCC_ENABLE_CXX_FLAGS=""
 CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
@@ -440,7 +441,6 @@
 CT_GMP_NEEDED=y
 CT_MPFR_NEEDED=y
 CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
 CT_MPC_NEEDED=y
 CT_COMPLIBS=y
 CT_LIBICONV=y
@@ -448,7 +448,6 @@
 CT_GMP=y
 CT_MPFR=y
 CT_ISL=y
-CT_CLOOG=y
 CT_MPC=y
 CT_LIBICONV_V_1_14=y
 CT_LIBICONV_VERSION="1.14"
@@ -474,15 +473,13 @@
 # CT_MPFR_V_2_4_0 is not set
 CT_MPFR_VERSION="3.1.3"
 CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
 CT_ISL_V_0_14_or_later=y
 CT_ISL_V_0_12_or_later=y
 CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
 # CT_CLOOG_V_0_18_1 is not set
 # CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
 CT_MPC_V_1_0_3=y
 # CT_MPC_V_1_0_2 is not set
 # CT_MPC_V_1_0_1 is not set
diff --git a/src/ci/docker/dist-x86_64-linux/build-clang.sh b/src/ci/docker/dist-x86_64-linux/build-clang.sh
index ff5b501..ac681b7 100755
--- a/src/ci/docker/dist-x86_64-linux/build-clang.sh
+++ b/src/ci/docker/dist-x86_64-linux/build-clang.sh
@@ -4,26 +4,14 @@
 
 source shared.sh
 
-# Currently these commits are all tip-of-tree as of 2018-12-16, used to pick up
-# a fix for rust-lang/rust#56849
-LLVM=032b00a5404865765cda7db3039f39d54964d8b0
-LLD=3e4aa4e8671523321af51449e0569f455ef3ad43
-CLANG=a6b9739069763243020f4ea6fe586bc135fde1f9
+LLVM=llvmorg-8.0.0-rc2
 
-mkdir clang
-cd clang
+mkdir llvm-project
+cd llvm-project
 
-curl -L https://github.com/llvm-mirror/llvm/archive/$LLVM.tar.gz | \
+curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
   tar xzf - --strip-components=1
 
-mkdir -p tools/clang
-curl -L https://github.com/llvm-mirror/clang/archive/$CLANG.tar.gz | \
-  tar xzf - --strip-components=1 -C tools/clang
-
-mkdir -p tools/lld
-curl -L https://github.com/llvm-mirror/lld/archive/$LLD.tar.gz | \
-  tar zxf - --strip-components=1 -C tools/lld
-
 mkdir clang-build
 cd clang-build
 
@@ -39,20 +27,21 @@
 #
 # [1]: https://sourceware.org/ml/crossgcc/2008-11/msg00028.html
 INC="/rustroot/include"
-INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include-fixed"
+INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed"
 INC="$INC:/usr/include"
 
 hide_output \
-    cmake .. \
+    cmake ../llvm \
       -DCMAKE_C_COMPILER=/rustroot/bin/gcc \
       -DCMAKE_CXX_COMPILER=/rustroot/bin/g++ \
       -DCMAKE_BUILD_TYPE=Release \
       -DCMAKE_INSTALL_PREFIX=/rustroot \
       -DLLVM_TARGETS_TO_BUILD=X86 \
+      -DLLVM_ENABLE_PROJECTS="clang;lld" \
       -DC_INCLUDE_DIRS="$INC"
 
 hide_output make -j10
 hide_output make install
 
 cd ../..
-rm -rf clang
+rm -rf llvm-project
diff --git a/src/ci/docker/dist-x86_64-linux/build-gcc.sh b/src/ci/docker/dist-x86_64-linux/build-gcc.sh
index 9f3ae55..7f6e94d 100755
--- a/src/ci/docker/dist-x86_64-linux/build-gcc.sh
+++ b/src/ci/docker/dist-x86_64-linux/build-gcc.sh
@@ -3,9 +3,9 @@
 
 source shared.sh
 
-GCC=4.8.5
+GCC=5.5.0
 
-curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf -
+curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | xzcat | tar xf -
 cd gcc-$GCC
 
 # FIXME(#49246): Remove the `sed` below.
diff --git a/src/ci/docker/dist-x86_64-linux/build-perl.sh b/src/ci/docker/dist-x86_64-linux/build-perl.sh
index a6c3d5c..a678d35 100755
--- a/src/ci/docker/dist-x86_64-linux/build-perl.sh
+++ b/src/ci/docker/dist-x86_64-linux/build-perl.sh
@@ -11,7 +11,8 @@
 # Gotta do some hackery to tell python about our custom OpenSSL build, but other
 # than that fairly normal.
 CC=gcc \
-CFLAGS='-I /rustroot/include' LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
+CFLAGS='-I /rustroot/include -fgnu89-inline' \
+LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
     hide_output ./configure.gnu
 hide_output make -j10
 hide_output make install
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index d046236..f2165c6 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -124,6 +124,7 @@
 #![feature(adx_target_feature)]
 #![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
 #![feature(unrestricted_attribute_tokens)]
+#![feature(external_doc)]
 
 #[prelude_import]
 #[allow(unused)]
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index e0b0e72..43afc9a 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -1185,14 +1185,6 @@
         ManuallyDrop::into_inner(self.value)
     }
 
-    /// Deprecated alternative to `into_initialized`. Will never get stabilized.
-    /// Exists only to transition stdsimd to `into_initialized`.
-    #[inline(always)]
-    #[allow(unused)]
-    pub(crate) unsafe fn into_inner(self) -> T {
-        self.into_initialized()
-    }
-
     /// Gets a reference to the contained value.
     ///
     /// # Unsafety
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index 92876f7..7d60a17 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -47,7 +47,7 @@
 cc = "1.0"
 
 [features]
-default = ["compiler_builtins_c"]
+default = ["compiler_builtins_c", "std_detect_file_io", "std_detect_dlsym_getauxval"]
 
 backtrace = ["backtrace-sys"]
 panic-unwind = ["panic_unwind"]
@@ -66,3 +66,8 @@
 # the environment for hooking up some thread-related information like the
 # current thread id and accessing/getting the current thread's TCB
 wasm-bindgen-threads = []
+
+# Enable std_detect default features for stdsimd:
+# https://github.com/rust-lang-nursery/stdsimd/blob/master/crates/std_detect/Cargo.toml
+std_detect_file_io = []
+std_detect_dlsym_getauxval = []
diff --git a/src/stdsimd b/src/stdsimd
index b235413..9a60697 160000
--- a/src/stdsimd
+++ b/src/stdsimd
@@ -1 +1 @@
-Subproject commit b23541340b5941749e5fbb1930e666bbd1375244
+Subproject commit 9a60697044088f6704a40da78dee25eb6d55fd6f