chore: upgrade gcc to 13.1.0

This commit is contained in:
Drew Richardson 2024-04-22 10:48:27 -07:00
parent d6a53d492b
commit 80e1137356
No known key found for this signature in database
6 changed files with 94 additions and 2 deletions

View file

@ -1,8 +1,8 @@
FROM scratch as base
ENV VERSION 12.2.0
ENV VERSION 13.1.0
ENV SRC_FILE gcc-$VERSION.tar.xz
ENV SRC_SITE https://mirrors.kernel.org/gnu/gcc/gcc-${VERSION}/${SRC_FILE}
ENV SRC_HASH e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
ENV SRC_HASH 61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86
ENV DEP_SITE https://gcc.gnu.org/pub/gcc/infrastructure/
ENV GMP_FILE gmp-6.2.1.tar.bz2
ENV GMP_HASH eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c

View file

@ -23,6 +23,8 @@ WORKDIR llvm-project-${VERSION}.src
ADD *.patch .
RUN --network=none <<-EOF
set -eux
patch -p1 < gcc-13-base64.patch
patch -p1 < gcc-13-signals.patch
python -c "import setuptools; print(setuptools.__version__)"
cmake \
-B build \

View file

@ -0,0 +1,29 @@
From 5e9be93566f39ee6cecd579401e453eccfbe81e5 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Mon, 23 May 2022 08:39:48 +0100
Subject: [PATCH] [Support] Add missing <cstdint> header to Base64.h
Without the change llvm build fails on this week's gcc-13 snapshot as:
[ 91%] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/Base64Test.cpp.o
In file included from llvm/unittests/Support/Base64Test.cpp:14:
llvm/include/llvm/Support/Base64.h: In function 'std::string llvm::encodeBase64(const InputBytes&)':
llvm/include/llvm/Support/Base64.h:29:5: error: 'uint32_t' was not declared in this scope
29 | uint32_t x = ((unsigned char)Bytes[i] << 16) |
| ^~~~~~~~
---
llvm/include/llvm/Support/Base64.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 62064a35aa3448..da4ae1688574f9 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -13,6 +13,7 @@
#ifndef LLVM_SUPPORT_BASE64_H
#define LLVM_SUPPORT_BASE64_H
+#include <cstdint>
#include <string>
namespace llvm {

View file

@ -0,0 +1,28 @@
From ff1681ddb303223973653f7f5f3f3435b48a1983 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Mon, 23 May 2022 08:03:23 +0100
Subject: [PATCH] [Support] Add missing <cstdint> header to Signals.h
Without the change llvm build fails on this week's gcc-13 snapshot as:
[ 0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o
In file included from llvm/lib/Support/Signals.cpp:14:
llvm/include/llvm/Support/Signals.h:119:8: error: variable or field 'CleanupOnSignal' declared void
119 | void CleanupOnSignal(uintptr_t Context);
| ^~~~~~~~~~~~~~~
---
llvm/include/llvm/Support/Signals.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h
index 44f5a750ff5cb0..937e0572d4a725 100644
--- a/llvm/include/llvm/Support/Signals.h
+++ b/llvm/include/llvm/Support/Signals.h
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_SIGNALS_H
#define LLVM_SUPPORT_SIGNALS_H
+#include <cstdint>
#include <string>
namespace llvm {

View file

@ -73,6 +73,7 @@ COPY --from=stagex/musl . /
FROM build-base as build-mrustc
COPY --from=stagex/llvm13 . /
ADD gcc_version.patch .
RUN tar -xzf ${MRUSTC_SRC_FILE}
RUN mv lrvick-mrustc-* mrustc
ENV MRUSTC_TARGET_VER=1.54
@ -86,6 +87,7 @@ RUN <<-EOF
set -eux
cp rustc-1.54.0-src.tar.gz mrustc
cd mrustc
patch -p1 < ../gcc_version.patch
tar -xzf rustc-1.54.0-src.tar.gz
cd rustc-1.54.0-src
patch -p0 < ../rustc-1.54.0-src.patch

View file

@ -0,0 +1,31 @@
diff --git a/run_rustc/Makefile b/run_rustc/Makefile
index 996bf346c17b..7eca3f102be2 100644
--- a/run_rustc/Makefile
+++ b/run_rustc/Makefile
@@ -163,7 +163,7 @@ $(LIBDIR_S)libstd.rlib: $(BINDIR_S)rustc $(MINICARGO) Makefile
mkdir -p $(LIBDIR_S)
#HACK - figure out how to inject these as search paths
cp /usr/lib/*.o /usr/lib/*.a $(LIBDIR_S)
- cp /usr/lib/gcc/x86_64-linux-musl/12.2.0/*.o $(LIBDIR_S)
+ cp /usr/lib/gcc/x86_64-linux-musl/13.1.0/*.o $(LIBDIR_S)
$V+MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)std
$V+MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)panic_unwind
$V+MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)test
@@ -182,7 +182,7 @@ $(LIBDIR_2)libtest.rlib: $(LIBDIR_S)libstd.rlib $(BINDIR_2)rustc $(BINDIR_S)rust
@mkdir -p $(LIBDIR_2)
#HACK - figure out how to inject these as search paths
cp /usr/lib/*.o /usr/lib/*.a $(LIBDIR_2)
- cp /usr/lib/gcc/x86_64-linux-musl/12.2.0/*.o $(LIBDIR_2)
+ cp /usr/lib/gcc/x86_64-linux-musl/13.1.0/*.o $(LIBDIR_2)
@echo [CARGO] $(RUST_SRC_LIBS)test/Cargo.toml '>' $(OUTDIR)build-std2
ifeq ($(TARGETVER_LEAST_1_39),)
$V$(CARGO_ENV_STAGE2_STD) $(BINDIR)cargo build $(CARGO_FLAGS) --manifest-path $(RUST_SRC_LIBS)std/Cargo.toml --features panic-unwind
@@ -220,7 +220,7 @@ endif
@mkdir -p $(LIBDIR)
#HACK - figure out how to inject these as search paths
cp /usr/lib/*.o /usr/lib/*.a $(LIBDIR)
- cp /usr/lib/gcc/x86_64-linux-musl/12.2.0/*.o $(LIBDIR)
+ cp /usr/lib/gcc/x86_64-linux-musl/13.1.0/*.o $(LIBDIR)
$Vcp $(LIBDIR_2)*.$(DYLIB_EXT) $(PREFIX)lib
$Vcp $(CARGO_OUTDIR_RUSTC)deps/*.rlib $(LIBDIR)
$Vcp $(CARGO_OUTDIR_RUSTC)deps/*.$(DYLIB_EXT) $(LIBDIR)