From: Owen Avery <[email protected]>

This should make it easier to upgrade libraries when we bump the target
rustc version.

libgrust/ChangeLog:

        * rustc-lib/version-info: Regenerate, now mentions stdarch.
        * contrib/vendor-libs.sh: New file.

Signed-off-by: Owen Avery <[email protected]>

Tested on x86_64-pc-linux-gnu.

---
 libgrust/contrib/vendor-libs.sh | 75 +++++++++++++++++++++++++++++++++
 libgrust/rustc-lib/version-info |  1 +
 2 files changed, 76 insertions(+)
 create mode 100755 libgrust/contrib/vendor-libs.sh

diff --git a/libgrust/contrib/vendor-libs.sh b/libgrust/contrib/vendor-libs.sh
new file mode 100755
index 00000000000..de98c92440c
--- /dev/null
+++ b/libgrust/contrib/vendor-libs.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# Copyright (C) 2026 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+set -e
+
+SCRIPT_DIR="$(dirname "$0")"
+
+VENDOR_VERSION=1.49.0
+VENDOR_LIBS="core alloc stdarch"
+
+# double check, rm -rf needs to be safe
+if [ x"${SCRIPT_DIR}" = x ]; then
+    echo "failed to get script directory" >&2
+    exit 2
+fi
+
+VENDOR_DIR="${SCRIPT_DIR}"/../rustc-lib
+
+rm -rf "${VENDOR_DIR}" && mkdir -p "${VENDOR_DIR}"
+
+TEMP_GIT_DIR="$(mktemp -d)"
+
+# double check this too
+if [ x"${TEMP_GIT_DIR}" = x ]; then
+    echo "failed to get temporary directory" >&2
+    exit 2
+fi
+
+rm_git_dir() {
+    rm -rf "${TEMP_GIT_DIR}"
+}
+
+trap rm_git_dir EXIT INT TERM HUP
+
+git clone \
+    --recurse-submodules \
+    --filter=blob:none \
+    --also-filter-submodules \
+    --depth=1 \
+    --shallow-submodules \
+    --branch="${VENDOR_VERSION}" \
+    "[email protected]:rust-lang/rust.git" \
+    "${TEMP_GIT_DIR}"
+
+find "${TEMP_GIT_DIR}" -name .git -exec rm -rf {} +
+
+for FILENAME in LICENSE-MIT LICENSE-APACHE; do
+    cp "${TEMP_GIT_DIR}/${FILENAME}" "${VENDOR_DIR}/${FILENAME}"
+done
+
+for VENDOR_LIB in $VENDOR_LIBS; do
+    cp -R \
+        "${TEMP_GIT_DIR}"/library/"${VENDOR_LIB}" \
+       "${VENDOR_DIR}/${VENDOR_LIB}"
+    echo "lib${VENDOR_LIB}_tag=${VENDOR_VERSION}" \
+        | tr '[:lower:]' '[:upper:]' \
+       >> "${VENDOR_DIR}/version-info"
+done
diff --git a/libgrust/rustc-lib/version-info b/libgrust/rustc-lib/version-info
index f1f9e986131..556eb1f0ea7 100644
--- a/libgrust/rustc-lib/version-info
+++ b/libgrust/rustc-lib/version-info
@@ -1,2 +1,3 @@
 LIBCORE_TAG=1.49.0
 LIBALLOC_TAG=1.49.0
+LIBSTDARCH_TAG=1.49.0
-- 
2.55.0

Reply via email to