From c03253427aac5317404d113636864bc1be2ea1e0 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Fri, 9 Aug 2024 14:35:07 +0800 Subject: [PATCH] Upgrade crosstool for loongarch64-unknown-linux-gnu target Fixes #1538 --- .changes/1540.json | 5 +++++ README.md | 2 +- docker/Dockerfile.loongarch64-unknown-linux-gnu | 2 +- .../loongarch64-unknown-linux-gnu.config | 4 ++-- docker/crosstool-ng.sh | 11 +++++++---- 5 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .changes/1540.json diff --git a/.changes/1540.json b/.changes/1540.json new file mode 100644 index 000000000..ae5b2f7e2 --- /dev/null +++ b/.changes/1540.json @@ -0,0 +1,5 @@ +{ + "description": "Upgrade the crosstool for the loongarch64-unknown-linux-gnu target", + "issues": [1538], + "type": "fixed" +} diff --git a/README.md b/README.md index 6d0bb7298..b51cf93c4 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ terminate. | `i686-linux-android` [1] | 9.0.8 | 9.0.8 | ✓ | 6.1.0 | ✓ | | `i686-pc-windows-gnu` | N/A | 9.4 | ✓ | N/A | ✓ | | `i686-unknown-linux-gnu` | 2.31 | 9.4.0 | ✓ | 6.1.0 | ✓ | -| `loongarch64-unknown-linux-gnu` | 2.36 | 13.2.0 | ✓ | 8.2.2 | ✓ | +| `loongarch64-unknown-linux-gnu` | 2.36 | 14.2.0 | ✓ | 8.2.2 | ✓ | | `mips-unknown-linux-gnu` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | | `mips-unknown-linux-musl` | 1.2.3 | 9.2.0 | ✓ | 6.1.0 | ✓ | | `mips64-unknown-linux-gnuabi64` | 2.30 | 9.4.0 | ✓ | 6.1.0 | ✓ | diff --git a/docker/Dockerfile.loongarch64-unknown-linux-gnu b/docker/Dockerfile.loongarch64-unknown-linux-gnu index 58340b4ae..8991dd8e9 100644 --- a/docker/Dockerfile.loongarch64-unknown-linux-gnu +++ b/docker/Dockerfile.loongarch64-unknown-linux-gnu @@ -15,7 +15,7 @@ FROM cross-base as build ARG VERBOSE COPY crosstool-ng.sh / COPY crosstool-config/loongarch64-unknown-linux-gnu.config / -RUN /crosstool-ng.sh loongarch64-unknown-linux-gnu.config 5 +RUN /crosstool-ng.sh loongarch64-unknown-linux-gnu.config 5 ed12fa68402f58e171a6f79500f73f4781fdc9e5 ENV PATH /x-tools/loongarch64-unknown-linux-gnu/bin/:$PATH diff --git a/docker/crosstool-config/loongarch64-unknown-linux-gnu.config b/docker/crosstool-config/loongarch64-unknown-linux-gnu.config index f45344d87..7de2835c4 100644 --- a/docker/crosstool-config/loongarch64-unknown-linux-gnu.config +++ b/docker/crosstool-config/loongarch64-unknown-linux-gnu.config @@ -21,9 +21,9 @@ CT_GLIBC_VERSION="2.36" CT_GLIBC_2_17_or_later=y CT_GLIBC_later_than_2_14=y CT_GLIBC_2_14_or_later=y -CT_GCC_V_13=y +CT_GCC_V_14=y # CT_GCC_NO_VERSIONS is not set -CT_GCC_VERSION="13.2.0" +CT_GCC_VERSION="14.2.0" CT_GCC_later_than_7=y CT_GCC_7_or_later=y CT_GCC_later_than_6=y diff --git a/docker/crosstool-ng.sh b/docker/crosstool-ng.sh index fd5a5c8b8..012dc4dc0 100755 --- a/docker/crosstool-ng.sh +++ b/docker/crosstool-ng.sh @@ -17,8 +17,8 @@ silence_stdout() { main() { local config="${1}" local nproc="${2}" - local ctng_version=1.26.0 - local ctng_url="https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-${ctng_version}.tar.gz" + local ctng_version=${3:-crosstool-ng-1.26.0} + local ctng_url="https://github.com/crosstool-ng/crosstool-ng" local username=crosstool local crosstooldir=/opt/crosstool local buildir @@ -51,8 +51,11 @@ main() { pushd "${td}" - curl --retry 3 -sSfL "${ctng_url}" | tar xzf - - pushd "crosstool-ng-crosstool-ng-${ctng_version}" + mkdir "crosstool-ng-${ctng_version}" + pushd "crosstool-ng-${ctng_version}" + git init + git fetch --depth=1 "${ctng_url}" "${ctng_version}" + git reset --hard FETCH_HEAD ./bootstrap ./configure --prefix="${crosstooldir}" make -j"${nproc}"