https://gcc.gnu.org/g:f1cc89423dcf3e06dc9aaa02c6dbbf0437a81556
commit r17-5157-gf1cc89423dcf3e06dc9aaa02c6dbbf0437a81556 Author: Owen Avery <[email protected]> Date: Tue Sep 22 20:03:12 2026 -0400 gccrs: Add script to generate rustc-lib 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]> Diff: --- libgrust/contrib/vendor-libs.sh | 75 +++++++++++++++++++++++++++++++++++++++++ libgrust/rustc-lib/version-info | 1 + 2 files changed, 76 insertions(+) diff --git a/libgrust/contrib/vendor-libs.sh b/libgrust/contrib/vendor-libs.sh new file mode 100755 index 000000000000..de98c92440c0 --- /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 f1f9e9861317..556eb1f0ea7d 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
