├── .github └── workflows │ └── toolchain_build.yml ├── .gitignore ├── README.md ├── build-clang-with-args.sh ├── build-gcc-with-args.sh ├── check-tarball.sh ├── create-prefixed-archive.sh ├── generate-clang-cmake-toolchain.sh ├── generate-clang-meson-cross-file.sh ├── generate-gcc-cmake-toolchain.sh ├── generate-gcc-meson-cross-file.sh ├── install-crosstool-ng.sh ├── libcheck.py ├── local-run-in-container.sh ├── lowrisc-toolchain-gcc-multilib-baremetal.config ├── lowrisc-toolchain-gcc-multilib-linux.config ├── lowrisc-toolchain-gcc-rv32imc.config ├── lowrisc-toolchain-gcc-rv32imcb.config ├── lowrisc-toolchain-gcc-rv64imac.config ├── patches ├── lowrisc-toolchain-gcc-rv32imc │ └── gdb │ │ └── 11.1 │ │ └── 001-glob-libc-config.patch ├── lowrisc-toolchain-gcc-rv32imcb │ ├── binutils │ │ └── git-7c9dd840 │ │ │ └── 001-bitmanip.patch │ └── gdb │ │ └── 11.1 │ │ └── 001-glob-libc-config.patch └── lowrisc-toolchain-gcc-rv64imac │ └── gdb │ └── 11.1 │ └── 001-glob-libc-config.patch ├── prepare-host.sh ├── release_tag.sh └── sw-versions.sh /.github/workflows/toolchain_build.yml: -------------------------------------------------------------------------------- 1 | name: Build toolchains 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | tags: 8 | - "*" 9 | pull_request: 10 | branches: 11 | - master 12 | 13 | env: 14 | ARTIFACT_STAGING_DIR: artifact 15 | 16 | jobs: 17 | build: 18 | strategy: 19 | matrix: 20 | name: [rv32imcb, rv64imac] 21 | os: [ubuntu-latest, ubuntu-24.04-arm] 22 | include: 23 | - os: ubuntu-latest 24 | host_arch: x86_64 25 | - os: ubuntu-24.04-arm 26 | host_arch: aarch64 27 | - name: rv32imcb 28 | display_name: Toolchains targeting Ibex with bit-manipulation extensions 29 | target: riscv32-unknown-elf 30 | output_dir: /tools/riscv 31 | march: rv32imc_zba_zbb_zbc_zbs 32 | mabi: ilp32 33 | mcmodel: medany 34 | - name: rv64imac 35 | display_name: GCC and Clang/LLVM toolchains targeting RV64IMAC (Muntjac) 36 | target: riscv64-unknown-elf 37 | output_dir: /tools/riscv 38 | march: rv64imac 39 | mabi: lp64 40 | mcmodel: medany 41 | # - name: multilib-baremetal 42 | # display_name: RV64 GCC (Multilib Baremetal) 43 | # target: riscv64-unknown-elf 44 | # output_dir: /opt/riscv-baremetal-toolchain 45 | # - name: multilib-linux 46 | # display_name: RV64 GCC (Multilib Linux) 47 | # target: riscv64-unknown-linux-gnu 48 | # output_dir: /opt/riscv-linux-toolchain 49 | 50 | name: ${{ matrix.host_arch }} build of ${{ matrix.display_name }} 51 | runs-on: ${{ matrix.os }} 52 | # This is an AlmaLinux 8 based image 53 | container: quay.io/pypa/manylinux_2_28_${{ matrix.host_arch }} 54 | timeout-minutes: 360 55 | 56 | steps: 57 | - uses: actions/checkout@v4 58 | 59 | - name: Setup environment 60 | run: | 61 | echo ::group::Install dependencies 62 | ./prepare-host.sh 63 | echo ::endgroup:: 64 | 65 | echo ::group::Install crosstool-ng 66 | ./install-crosstool-ng.sh 67 | echo ::endgroup:: 68 | 69 | echo Preparing toolchain destination directory... 70 | sudo mkdir -p /tools/riscv 71 | sudo chmod 0777 /tools/riscv 72 | 73 | echo ::group::Set the host architecture env var 74 | echo "HOST_ARCH=${{ matrix.host_arch }}" >> "$GITHUB_ENV" 75 | echo ::endgroup:: 76 | 77 | echo ::group::Set the release tag env var 78 | echo "RELEASE_TAG=$(./release_tag.sh)" >> "$GITHUB_ENV" 79 | echo ::endgroup:: 80 | 81 | echo Creating artifact staging directory... 82 | mkdir "$ARTIFACT_STAGING_DIR" 83 | 84 | - name: Build GCC toolchain 85 | run: | 86 | ./build-gcc-with-args.sh \ 87 | "lowrisc-toolchain-gcc-${{ matrix.name }}" \ 88 | "${{ matrix.target }}" \ 89 | "${{ matrix.output_dir }}" \ 90 | "${{ matrix.march }}" \ 91 | "${{ matrix.mabi}}" \ 92 | "${{ matrix.mcmodel }}" \ 93 | "${{ matrix.cflags }}" 94 | 95 | - name: Build Clang toolchain 96 | run: | 97 | ./build-clang-with-args.sh \ 98 | "lowrisc-toolchain-${{ matrix.name }}" \ 99 | "${{ matrix.target }}" \ 100 | "${{ matrix.output_dir }}" \ 101 | "${{ matrix.march }}" \ 102 | "${{ matrix.mabi}}" \ 103 | "${{ matrix.mcmodel }}" \ 104 | "${{ matrix.cflags }}" 105 | 106 | - uses: actions/upload-artifact@v4 107 | with: 108 | name: ${{ matrix.name }}-${{ matrix.host_arch }}-toolchains 109 | path: ${{ env.ARTIFACT_STAGING_DIR }} 110 | 111 | - name: Check tarballs 112 | run: | 113 | set -e 114 | for f in "${ARTIFACT_STAGING_DIR}"/*.tar.xz; do 115 | ./check-tarball.sh "$f" 116 | done 117 | 118 | - name: Release 119 | if: github.ref_type == 'tag' 120 | env: 121 | GH_TOKEN: ${{ github.token }} 122 | run: | 123 | # Git warns about this repo having dubious ownership - ignore. 124 | git config --global --add safe.directory /__w/lowrisc-toolchains/lowrisc-toolchains 125 | 126 | # Create the release if it doesn't already exist. 127 | gh release create "$RELEASE_TAG" --prerelease || echo "release exists" 128 | # Upload this job's artifacts. 129 | gh release upload "$RELEASE_TAG" --clobber \ 130 | "${ARTIFACT_STAGING_DIR}/lowrisc-toolchain-${{ matrix.name }}-${HOST_ARCH}-${RELEASE_TAG}.tar.xz" \ 131 | "${ARTIFACT_STAGING_DIR}/lowrisc-toolchain-gcc-${{ matrix.name }}-${HOST_ARCH}-${RELEASE_TAG}.tar.xz" 132 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | lowRISC toolchain builds 2 | ======================== 3 | 4 | This repository contains tools to create toolchains for lowRISC internal 5 | use. The toolchains are *not supported* by lowRISC or recommended to be 6 | used outside of lowRISC. 7 | 8 | Head over to the 9 | [GitHub releases for this repository](https://github.com/lowRISC/lowrisc-toolchains/releases) 10 | for pre-built toolchains. 11 | 12 | * A GCC RV32IMC without hardfloat support, targeting [Ibex](https://github.com/lowRISC/ibex/) 13 | * A GCC RV64IMAC, targeting [Muntjac](https://github.com/lowRISC/muntjac) 14 | * A GCC elf multilib toolchain 15 | * A GCC linux multilib toolchain 16 | 17 | How to do a release 18 | ------------------- 19 | 20 | 1. Modify any of the following variables to configure the build: 21 | - `CROSSTOOL_NG_VERSION` in `install-crosstool-ng.sh` 22 | 23 | 2. Modify any of the `*.config` files to update the crosstool-ng configurations 24 | for a particular toolchain. 25 | 26 | 3. Push the changes or do a pull request, and wait for the CI workflow to 27 | complete. 28 | 29 | The build can be tested by downloading the GitHub artifacts. 30 | 1. Go to the [lowrisc-toolchains Actions page](https://github.com/lowRISC/lowrisc-toolchains/actions). 31 | 2. Select a workflow run from the list. 32 | 4. Download the desired artifact from the bottom of the page and test it. 33 | 34 | 4. Tag a release 35 | 36 | ```bash 37 | VERSION=$(date +%Y%m%d)-1 38 | git tag -a -m "Release version $VERSION" $VERSION 39 | ``` 40 | 41 | 5. Push the tag 42 | 43 | ```bash 44 | git push origin $VERSION 45 | ``` 46 | 47 | Now the release builds on GitHub's CI, and the resulting binaries 48 | will be uploaded to 49 | [GitHub releases](https://github.com/lowRISC/lowrisc-toolchains/releases). 50 | 51 | How to generate the bitmanip patch 52 | ------------------------------------ 53 | 54 | ``` 55 | git clone https://github.com/riscv-collab/riscv-binutils-gdb.git 56 | cd riscv-binutils-gdb 57 | # checkout Pirmin's bitmanip 1.00+0.93 PR (https://github.com/riscv-collab/riscv-binutils-gdb/pull/267) 58 | gh pr checkout 267 59 | # 7c9dd840 (riscv-binutils-2.35-rvb) is our baseline 60 | git diff 7c9dd840 > $TOP/patches/lowrisc-toolchain-gcc-rv32imcb/binutils/git-7c9dd840/001-bitmanip.patch 61 | ``` 62 | How to install pre-built toolchain 63 | ------------------------------------ 64 | 1. Download a tar.gz file from release page. 65 | 2. Decompress files to ~/.local 66 | ``` 67 | tar -xf --strip-components=1 -C ~/.local 68 | ``` 69 | 3. Now you should be able to compile software with lowrisc-toolchain. 70 | -------------------------------------------------------------------------------- /build-clang-with-args.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright lowRISC contributors. 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | ## build-clang-with-args.sh 7 | # 8 | # This requires a gcc toolchain dir made by `build-gcc-with-args.sh` 9 | # 10 | # Builds: 11 | # - Clang/LLVM 12 | # 13 | # Then: 14 | # - Appends to `buildinfo` with the clang info 15 | # - Adds cross-compilation configuration files for certain build systems 16 | # - Creates a tar file of the whole install directory 17 | 18 | set -e 19 | set -x 20 | set -o pipefail 21 | 22 | if ! [ "$#" -ge 3 ]; then 23 | echo "Usage: $0 " 24 | exit 2 25 | fi; 26 | 27 | ## Take configuration from arguments 28 | # This is the name for the tar file. 29 | # Suggested to be the gcc config with s/gcc/clang/. Will be updated if it 30 | # contains 'gcc' 31 | toolchain_name="${1}" 32 | # This is the expected gcc target triple (so we can set a default, and invoke gcc) 33 | toolchain_target="${2}" 34 | # This is the directory where we want the toolchain to added to 35 | toolchain_dest="${3}" 36 | # -march option default value 37 | march="${4}" 38 | # -mabi option default value 39 | mabi="${5}" 40 | # -mcmodel option default value 41 | mcmodel="${6}" 42 | # Remaining cflags for build configurations 43 | toolchain_cflags=("${@:7}") 44 | 45 | build_top_dir="${PWD}" 46 | 47 | # For *_VERSION variables 48 | # shellcheck source=sw-versions.sh 49 | source "${build_top_dir}/sw-versions.sh" 50 | 51 | tag_name="${RELEASE_TAG:-HEAD}" 52 | host_arch="${HOST_ARCH:-x86_64}" 53 | toolchain_full_name="${toolchain_name}-${host_arch}-${tag_name}" 54 | 55 | mkdir -p "${build_top_dir}/build" 56 | cd "${build_top_dir}/build" 57 | 58 | 59 | llvm_dir="${build_top_dir}/build/llvm-project" 60 | if [ ! -d "${llvm_dir}" ]; then 61 | git clone --branch ${LLVM_BRANCH} ${LLVM_URL} "${llvm_dir}" 62 | fi 63 | cd "${llvm_dir}" 64 | git fetch origin 65 | git checkout --force "${LLVM_VERSION}" 66 | 67 | # Clang Symlinks 68 | clang_links_to_create="clang++" 69 | clang_links_to_create+=";${toolchain_target}-clang;${toolchain_target}-clang++" 70 | # LLD Symlinks 71 | lld_links_to_create="ld.lld;ld64.lld" 72 | lld_links_to_create+=";${toolchain_target}-ld.lld;${toolchain_target}-ld64.lld" 73 | 74 | llvm_build_dir="${build_top_dir}/build/llvm-build" 75 | 76 | # Delete old build artifacts (if they exist) 77 | rm -rf "${llvm_build_dir}" 78 | 79 | mkdir -p "${llvm_build_dir}" 80 | cd "${llvm_build_dir}" 81 | 82 | # TODO: 83 | # - Stage 2 Build 84 | # - Build compiler-rt and other runtimes 85 | 86 | llvm_tools="llvm-ar" 87 | llvm_tools+=";llvm-cov" 88 | llvm_tools+=";llvm-dwarfdump" 89 | llvm_tools+=";llvm-nm" 90 | llvm_tools+=";llvm-objcopy" 91 | llvm_tools+=";llvm-objdump" 92 | llvm_tools+=";llvm-profdata" 93 | llvm_tools+=";llvm-ranlib" 94 | llvm_tools+=";llvm-readelf" 95 | llvm_tools+=";llvm-readobj" 96 | llvm_tools+=";llvm-size" 97 | llvm_tools+=";llvm-strings" 98 | llvm_tools+=";llvm-strip" 99 | llvm_tools+=";llvm-symbolizer" 100 | 101 | llvm_distribution_components="clang;" 102 | llvm_distribution_components+=";clang-format" 103 | llvm_distribution_components+=";clang-tidy" 104 | llvm_distribution_components+=";clang-resource-headers" 105 | llvm_distribution_components+=";libclang" 106 | llvm_distribution_components+=";lld" 107 | llvm_distribution_components+=";scan-build" 108 | llvm_distribution_components+=";scan-view" 109 | llvm_distribution_components+=";${llvm_tools}" 110 | 111 | cmake "${llvm_dir}/llvm" \ 112 | -Wno-dev \ 113 | -DCMAKE_BUILD_TYPE=Release \ 114 | -DCMAKE_INSTALL_PREFIX="${toolchain_dest}" \ 115 | -DLLVM_TARGETS_TO_BUILD="RISCV" \ 116 | -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \ 117 | -DLLVM_ENABLE_BACKTRACES=Off \ 118 | -DLLVM_DEFAULT_TARGET_TRIPLE="${toolchain_target}" \ 119 | -DLLVM_STATIC_LINK_CXX_STDLIB=On \ 120 | -DCLANG_VENDOR="lowRISC" \ 121 | -DBUG_REPORT_URL="toolchains@lowrisc.org" \ 122 | -DLLVM_INCLUDE_EXAMPLES=Off \ 123 | -DLLVM_INCLUDE_DOCS=Off \ 124 | -DLLVM_INSTALL_TOOLCHAIN_ONLY=On \ 125 | -DLLVM_INSTALL_BINUTILS_SYMLINKS=Off \ 126 | -DCLANG_LINKS_TO_CREATE="${clang_links_to_create}" \ 127 | -DLLD_SYMLINKS_TO_CREATE="${lld_links_to_create}" \ 128 | -DLLVM_TOOLCHAIN_TOOLS="${llvm_tools}" \ 129 | -DLLVM_DISTRIBUTION_COMPONENTS="${llvm_distribution_components}" 130 | 131 | cmake --build "${llvm_build_dir}" \ 132 | --parallel $(( $(nproc) + 2 )) \ 133 | --target install-distribution 134 | 135 | cd "${build_top_dir}" 136 | 137 | ## Create Toolchain Files! 138 | # These don't yet add cflags ldflags 139 | "${build_top_dir}/generate-clang-cmake-toolchain.sh" \ 140 | "${toolchain_target}" "${toolchain_dest}" "${toolchain_cflags[@]}" 141 | "${build_top_dir}/generate-clang-meson-cross-file.sh" \ 142 | "${toolchain_target}" "${toolchain_dest}" ${march} ${mabi} ${mcmodel} \ 143 | "${toolchain_cflags[@]}" 144 | 145 | # Copy LLVM licenses into toolchain 146 | mkdir -p "${toolchain_dest}/share/licenses/llvm" 147 | cp "${llvm_dir}/llvm/LICENSE.TXT" "${toolchain_dest}/share/licenses/llvm" 148 | 149 | ls -l "${toolchain_dest}" 150 | 151 | # Write out build info 152 | set +o pipefail # head causes pipe failures, so we have to switch off pipefail while we use it. 153 | ct_ng_version_string="$( (set +o pipefail; ct-ng version | head -n1) )" 154 | clang_version_string="$("${toolchain_dest}/bin/clang" --version | head -n1)" 155 | gcc_version_string="$("${toolchain_dest}/bin/${toolchain_target}-gcc" --version | head -n1)" 156 | build_date="$(date -u)" 157 | set -o pipefail 158 | 159 | tee "${toolchain_dest}/buildinfo" < " 22 | exit 2 23 | fi; 24 | 25 | ## Take configuration from arguments 26 | # This is the name for the tar file, and also the basename of the .config file 27 | toolchain_name="${1}" 28 | # This is the expected gcc target triple (so we can invoke gcc) 29 | toolchain_target="${2}" 30 | # This is the directory where we want the toolchain to be installed. 31 | toolchain_dest="${3}" 32 | # -march option default value 33 | march="${4}" 34 | # -mabi option default value 35 | mabi="${5}" 36 | # -mcmodel option default value 37 | mcmodel="${6}" 38 | # Remaining cflags for build configurations 39 | toolchain_cflags=("${@:7}") 40 | 41 | build_top_dir="${PWD}" 42 | 43 | # For *_VERSION variables 44 | # shellcheck source=sw-versions.sh 45 | source "${build_top_dir}/sw-versions.sh" 46 | 47 | tag_name="${RELEASE_TAG:-HEAD}" 48 | host_arch="${HOST_ARCH:-x86_64}" 49 | toolchain_full_name="${toolchain_name}-${host_arch}-${tag_name}" 50 | 51 | # crosstools-NG needs the ability to create and chmod the 52 | # $toolchain_dest directory. 53 | sudo mkdir -p "$(dirname "${toolchain_dest}")" 54 | sudo chmod 777 "$(dirname "${toolchain_dest}")" 55 | 56 | mkdir -p "${toolchain_dest}" 57 | 58 | mkdir -p "${build_top_dir}/build/gcc" 59 | cd "${build_top_dir}/build/gcc" 60 | 61 | # Create crosstool-ng config file with correct `CT_PREFIX_DIR` and `CT_LOCAL_PATCH_DIR` 62 | { 63 | grep -v '^CT_PREFIX_DIR=' "${build_top_dir}/${toolchain_name}.config" 64 | echo "" 65 | echo "# ADDED BY ${0}"; 66 | echo "CT_PREFIX_DIR=\"${toolchain_dest}\"" 67 | echo "CT_LOCAL_PATCH_DIR=\"${build_top_dir}/patches/${toolchain_name}\"" 68 | echo "CT_ALLOW_BUILD_AS_ROOT=y" 69 | echo "CT_ALLOW_BUILD_AS_ROOT_SURE=y" 70 | echo "# END ADDED BY ${0}" 71 | } > .config 72 | ct-ng upgradeconfig 73 | cat .config 74 | 75 | # crosstool-ng doesn't work with some environment variables set, leading to 76 | # errors like "Don't set LD_LIBRARY_PATH. It screws up the build." otherwise. 77 | # Do so in a subshell to avoid disturbing subsequent tasks. 78 | ( 79 | unset LD_LIBRARY_PATH 80 | unset LIBRARY_PATH 81 | unset LPATH 82 | unset CPATH 83 | unset C_INCLUDE_PATH 84 | unset CPLUS_INCLUDE_PATH 85 | unset OBJC_INCLUDE_PATH 86 | unset CFLAGS 87 | unset CXXFLAGS 88 | unset CC 89 | unset CXX 90 | unset GREP_OPTIONS 91 | 92 | # Invoke crosstool-ng 93 | ct-ng build 94 | ) 95 | 96 | cd "${build_top_dir}" 97 | 98 | ## Create Toolchain Files! 99 | # These don't yet add cflags ldflags 100 | "${build_top_dir}/generate-gcc-cmake-toolchain.sh" \ 101 | "${toolchain_target}" "${toolchain_dest}" "${toolchain_cflags[@]}" 102 | "${build_top_dir}/generate-gcc-meson-cross-file.sh" \ 103 | "${toolchain_target}" "${toolchain_dest}" ${march} ${mabi} ${mcmodel} \ 104 | "${toolchain_cflags[@]}" 105 | 106 | ls -l "${toolchain_dest}" 107 | 108 | # Write out build info 109 | set +o pipefail # head causes pipe failures, so we have to switch off pipefail while we use it. 110 | ct_ng_version_string="$(ct-ng version | head -n1)" 111 | gcc_version_string="$("${toolchain_dest}/bin/${toolchain_target}-gcc" --version | head -n1)" 112 | build_date="$(date -u)" 113 | set -o pipefail 114 | 115 | tee "${toolchain_dest}/buildinfo" <" 19 | exit 2 20 | fi; 21 | 22 | tarball="$1" 23 | tarball_dest="$(mktemp -d)" 24 | 25 | found_error=false 26 | 27 | echo "Checking: $1" 28 | 29 | # Extract tarball into `tarball_dest` 30 | echo "Extracting:" 31 | tar -x -v \ 32 | -f "${tarball}" \ 33 | --strip-components=1 \ 34 | -C "${tarball_dest}" 35 | 36 | broken_symlinks="$(mktemp)" 37 | 38 | # Check for broken symlinks 39 | echo "Checking symlinks" 40 | find "${tarball_dest}" -type l \ 41 | -exec test ! -e '{}' \; \ 42 | -print | tee "${broken_symlinks}" 43 | 44 | if [ -s "${broken_symlinks}" ]; then 45 | echo "ERROR: Broken Symlinks Found" 46 | found_error=true 47 | fi 48 | 49 | echo "Checking buidinfo.json" 50 | if ! python3 -mjson.tool "${tarball_dest}/buildinfo.json"; then 51 | echo "ERROR: buildinfo.json not valid json" 52 | found_error=true 53 | fi 54 | 55 | # Check binaries to ensure that they are only linked to a very limited set of 56 | # libraries: 57 | # 58 | # # Linux dynamic linker and kernel interface 59 | # ld-linux.* 60 | # linux-gate.so 61 | # linux-vdso.so 62 | # 63 | # # glibc 64 | # libc.so 65 | # libm.so 66 | # libpthread.so 67 | # librt.so 68 | # libdl.so 69 | # libcrypt.so (NOT libcrypto.so!) 70 | # libutil.so 71 | # libnsl.so 72 | # libresolv.so 73 | 74 | # # GCC runtime 75 | # libgcc_s.so 76 | # 77 | # See 78 | # https://github.com/phusion/holy-build-box/blob/master/ESSENTIAL-SYSTEM-LIBRARIES.md 79 | # for details. 80 | 81 | # Clang and GCC link against the following libraries, which must be present at 82 | # runtime: 83 | # - libz.so.1 (zlib) 84 | # - libncursesw.so.5 and libtinfo.so.5 (ncurses5) 85 | # - libstdc++.so.6 86 | export LIBCHECK_ALLOW='libstdc\+\+|libtinfo|libncursesw|libz' 87 | 88 | libcheck_output="$(mktemp)" 89 | 90 | echo "Checking ELF Binaries for Library Usage" 91 | find "${tarball_dest}/bin" \ 92 | -exec sh -c 'file "$1" | grep -qi ": elf"' _ {} \; \ 93 | -exec python3 libcheck.py {} \; | tee "${libcheck_output}" 94 | if grep "is linked to non-system libraries" "${libcheck_output}"; then 95 | echo "ERROR: Toolchain Executable Linked to non-system library." 96 | found_error=true 97 | fi 98 | 99 | if [ "${found_error}" = "true" ]; then 100 | echo "FAIL! Problems found, see errors above." 101 | exit 1 102 | else 103 | echo "PASS! No problems found." 104 | exit 0 105 | fi 106 | -------------------------------------------------------------------------------- /create-prefixed-archive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright lowRISC contributors. 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | # This will tar-up $toolchain_dest into a tar called $toolchain_full_name.tar.xz 7 | # 8 | # All files in that tarball will be in a directory called $toolchain_full_name, 9 | # not $(basename $toolchain_dest). 10 | 11 | set -e 12 | set -x 13 | set -o pipefail 14 | 15 | if ! [ "$#" = 3 ]; then 16 | echo "Usage: $0 " 17 | exit 2 18 | fi; 19 | 20 | # These arguments are provided by `./build-*-with-args.sh` 21 | toolchain_full_name="$1" 22 | toolchain_dest="$2" 23 | artifact_dir="${3:-.}" 24 | 25 | tar -cJ \ 26 | --show-transformed-names --verbose \ 27 | --directory="$(dirname "${toolchain_dest}")" \ 28 | -f "${artifact_dir}/$toolchain_full_name.tar.xz" \ 29 | --transform="flags=rhS;s@^$(basename "${toolchain_dest}")@$toolchain_full_name@" \ 30 | --owner=0 --group=0 \ 31 | "$(basename "${toolchain_dest}")" 32 | -------------------------------------------------------------------------------- /generate-clang-cmake-toolchain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright lowRISC contributors. 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | ## generate-clang-cmake-toolchain.sh 7 | # 8 | # This generates a cmake-toolchains(7) file to configure CMake for 9 | # cross-compiling with clang. 10 | # 11 | # Docs: https://cmake.org/cmake/help/v3.15/manual/cmake-toolchains.7.html 12 | 13 | set -e 14 | set -x 15 | set -o pipefail 16 | 17 | if ! [ "$#" -ge 2 ]; then 18 | echo "Usage: $0 " 19 | exit 2 20 | fi; 21 | 22 | ## Take configuration from arguments 23 | # This is the gcc target triple 24 | toolchain_target="${1}" 25 | # This is the directory where the toolchain has been installed. 26 | toolchain_dest="${2}" 27 | # Remaining cflags for build configurations 28 | toolchain_cflags=("${@:3}") 29 | 30 | cmake_cflags="" 31 | for flag in "${toolchain_cflags[@]}"; do 32 | if [ -z "${cmake_cflags}" ]; then 33 | cmake_cflags+="${flag}"; 34 | else 35 | cmake_cflags+=";${flag}" 36 | fi 37 | done 38 | 39 | config_dest="${toolchain_dest}/${toolchain_target}-clang.cmake" 40 | sysroot_config="" 41 | system_name="" 42 | 43 | case "${toolchain_target}" in 44 | riscv*-*-linux-gnu) 45 | system_name="Linux" 46 | sysroot_config="set(CMAKE_SYSROOT \"\${LOWRISC_TOOLCHAIN}/${toolchain_target}/sysroot\" CACHE STRING \"\" FORCE)"; 47 | ;; 48 | riscv*-*-elf) 49 | system_name="Generic" 50 | ;; 51 | esac; 52 | 53 | tee "${config_dest}" < " 19 | exit 2 20 | fi; 21 | 22 | ## Take configuration from arguments 23 | # This is the gcc target triple 24 | toolchain_target="${1}" 25 | # This is the directory where the toolchain has been installed. 26 | toolchain_dest="${2}" 27 | # Remaining cflags for build configurations 28 | toolchain_cflags=("${@:3}") 29 | 30 | cmake_cflags="" 31 | for flag in "${toolchain_cflags[@]}"; do 32 | if [ -z "${cmake_cflags}" ]; then 33 | cmake_cflags+="${flag}"; 34 | else 35 | cmake_cflags+=";${flag}" 36 | fi 37 | done 38 | 39 | config_dest="${toolchain_dest}/${toolchain_target}-gcc.cmake" 40 | sysroot_config="" 41 | system_name="" 42 | 43 | case "${toolchain_target}" in 44 | riscv*-*-linux-gnu) 45 | system_name="Linux" 46 | sysroot_config="set(CMAKE_SYSROOT \"\${LOWRISC_TOOLCHAIN}/${toolchain_target}/sysroot\" CACHE STRING \"\" FORCE)"; 47 | ;; 48 | riscv*-*-elf) 49 | system_name="Generic" 50 | ;; 51 | esac; 52 | 53 | tee "${config_dest}" <") 36 | print("Check whether the given executables or shared libraries are linked against non-system libraries.") 37 | print("") 38 | print("By default, these libraries are allowed:") 39 | print("%s" %(SYSTEM_LIBRARIES_REGEX)) 40 | print("") 41 | print("You can allow more libraries by setting $LIBCHECK_ALLOW, e.g.:") 42 | print(" env LIBCHECK_ALLOW='libcurl|libcrypto' libcheck /usr/bin/foo") 43 | sys.exit(1) 44 | 45 | BRACKET = re.compile('\\[') 46 | 47 | if 'LIBCHECK_ALLOW' in os.environ: 48 | WHITELIST_REGEX = re.compile('(' + SYSTEM_LIBRARIES_REGEX + 49 | '|' + os.environ['LIBCHECK_ALLOW'] + ')\\.so') 50 | else: 51 | WHITELIST_REGEX = re.compile('(' + SYSTEM_LIBRARIES_REGEX + ')\\.so') 52 | 53 | INDICATOR_REGEX = re.compile("Shared library:") 54 | 55 | error = False 56 | 57 | for path in sys.argv[1:]: 58 | readelf = subprocess.check_output(['readelf', '-d', path], universal_newlines=True).split('\n') 59 | offenders = [] 60 | for line in readelf: 61 | line = line.strip() 62 | if len(line) > 0 and re.search(INDICATOR_REGEX, line) and not re.search(WHITELIST_REGEX, line): 63 | if re.search(BRACKET, line) is None: 64 | library = line 65 | else: 66 | library = re.split(BRACKET, line, 1)[1] 67 | library = re.sub(r'\]', '', library) 68 | offenders.append(library) 69 | error = True 70 | if len(offenders) > 0: 71 | print("%s is linked to non-system libraries: %s" % (path, offenders)) 72 | 73 | if error: 74 | sys.exit(1) 75 | -------------------------------------------------------------------------------- /local-run-in-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright lowRISC contributors. 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | IMAGE=lowrisc/lowrisc-base-centos6:latest 7 | 8 | exec docker run -t -i \ 9 | -v $(pwd):/home/dev/src \ 10 | --env DEV_UID=$(id -u) --env DEV_GID=$(id -g) \ 11 | "${IMAGE}" \ 12 | "$@" 13 | -------------------------------------------------------------------------------- /lowrisc-toolchain-gcc-multilib-baremetal.config: -------------------------------------------------------------------------------- 1 | CT_CONFIG_VERSION="3" 2 | CT_EXPERIMENTAL=y 3 | CT_ARCH_RISCV=y 4 | CT_ARCH_64=y 5 | CT_ARCH_USE_MMU=y 6 | CT_MULTILIB=y 7 | # CT_DEMULTILIB is not set 8 | CT_CC_LANG_CXX=y 9 | # CT_KERNEL_LINUX is not set 10 | CT_DEBUG_GDB=y 11 | # CT_GDB_CROSS_PYTHON is not set 12 | # CT_GDB_GDBSERVER is not set 13 | CT_ZLIB_NEEDED=y 14 | 15 | # Disable progress bar for CI builds, it generates too much log output 16 | # CT_LOG_PROGRESS_BAR is not set 17 | 18 | # Installation prefix directory; the toolchain will end up in exactly 19 | # this directory. CT_PREFIX_DIR will be added by the 20 | # ./build-gcc-with-args.sh script 21 | 22 | # Don't save tarballs for re-use (needs writable and pre-created 23 | # CT_LOCAL_TARBALLS_DIR otherwise) 24 | # CT_SAVE_TARBALLS is not set 25 | 26 | # Don't chmod the CT_PREFIX_DIR read-only after the install. 27 | # CT_PREFIX_DIR_RO is not set 28 | -------------------------------------------------------------------------------- /lowrisc-toolchain-gcc-multilib-linux.config: -------------------------------------------------------------------------------- 1 | CT_CONFIG_VERSION="3" 2 | CT_EXPERIMENTAL=y 3 | CT_ARCH_RISCV=y 4 | CT_ARCH_64=y 5 | CT_ARCH_USE_MMU=y 6 | 7 | # We wish MULTILIB was supported, but it's not - gcc says its built a multilib 8 | # for rv32, but then glibc fails to build for 32-bit RISC-V. The solution is 9 | # to not do a multilib build for the moment, but to just match the rv64 default 10 | # lib, so that later we can add a multilib without breaking everything 11 | # (hopefully). 12 | # CT_MULTILIB is not set 13 | # CT_ARCH_ARCH="rv64gc" 14 | # CT_ARCH_ABI="lp64d" 15 | 16 | # CT_DEMULTILIB is not set 17 | CT_CC_LANG_CXX=y 18 | CT_KERNEL_LINUX=y 19 | CT_DEBUG_GDB=y 20 | # CT_GDB_CROSS_PYTHON is not set 21 | # CT_GDB_GDBSERVER is not set 22 | CT_ZLIB_NEEDED=y 23 | 24 | # Disable progress bar for CI builds, it generates too much log output 25 | # CT_LOG_PROGRESS_BAR is not set 26 | 27 | # Installation prefix directory; the toolchain will end up in exactly 28 | # this directory. CT_PREFIX_DIR will be added by the 29 | # ./build-gcc-with-args.sh script 30 | 31 | # Don't save tarballs for re-use (needs writable and pre-created 32 | # CT_LOCAL_TARBALLS_DIR otherwise) 33 | # CT_SAVE_TARBALLS is not set 34 | 35 | # Having errors building linux (due to sched.h issues) 36 | # CT_LINUX_V_5_3 is not set 37 | CT_LINUX_V_5_2=y 38 | 39 | # Don't chmod the CT_PREFIX_DIR read-only after the install. 40 | # CT_PREFIX_DIR_RO is not set 41 | -------------------------------------------------------------------------------- /lowrisc-toolchain-gcc-rv32imc.config: -------------------------------------------------------------------------------- 1 | CT_CONFIG_VERSION="3" 2 | CT_EXPERIMENTAL=y 3 | 4 | CT_ARCH_RISCV=y 5 | 6 | # CT_ARCH_ARCH controls the specific architecture that the toolchain's libraries 7 | # are built with. It should specify the minimum RISC-V extensions that need to 8 | # be implemented by any processor that this toolchain will compile programs for. 9 | # 10 | CT_ARCH_ARCH="rv32imc" 11 | 12 | # CT_ARCH_ABI controls the specific ABI that the toolchain's libraries are built 13 | # with. All programs built against this toolchain should follow exactly this 14 | # ABI. 15 | CT_ARCH_ABI="ilp32" 16 | 17 | CT_TARGET_VENDOR="" 18 | CT_TOOLCHAIN_BUGURL="toolchains@lowrisc.org" 19 | 20 | CT_DOWNLOAD_AGENT_CURL=y 21 | 22 | CT_CC_GCC_STATIC_LIBSTDCXX=y 23 | # CT_CC_GCC_LDBL_128 is not set 24 | CT_CC_LANG_CXX=y 25 | CT_GCC_V_9=y 26 | CT_DEBUG_GDB=y 27 | CT_GDB_V_11_1=y 28 | # CT_GDB_CROSS_PYTHON is not set 29 | CT_PATCH_ORDER="bundled,local" 30 | CT_PATCH_BUNDLED_LOCAL=y 31 | CT_PATCH_USE_LOCAL=y 32 | 33 | # Disable progress bar for CI builds, it generates too much log output 34 | # CT_LOG_PROGRESS_BAR is not set 35 | 36 | # Installation prefix directory; the toolchain will end up in exactly 37 | # this directory. 38 | CT_PREFIX_DIR="/tools/riscv" 39 | 40 | # Don't save tarballs for re-use (needs writable and pre-created 41 | # CT_LOCAL_TARBALLS_DIR otherwise) 42 | # CT_SAVE_TARBALLS is not set 43 | 44 | # Don't chmod the CT_PREFIX_DIR read-only after the install. 45 | # CT_PREFIX_DIR_RO is not set 46 | 47 | # Binutils 2.35 (tag binutils-2_35, commit 2cb5c79dad3) 48 | CT_BINUTILS_SRC_DEVEL=y 49 | CT_BINUTILS_DEVEL_VCS_git=y 50 | CT_BINUTILS_DEVEL_URL="https://github.com/bminor/binutils-gdb.git" 51 | CT_BINUTILS_DEVEL_REVISION="2cb5c79dad39dd438fb0f7372ac04cf5aa2a7db7" 52 | 53 | # GCC 10.2.0 (tag releases/gcc-10.2.0, commit ee5c3db6c5b) 54 | CT_GCC_SRC_DEVEL=y 55 | CT_GCC_DEVEL_VCS_git=y 56 | CT_GCC_DEVEL_URL="https://gcc.gnu.org/git/gcc.git" 57 | CT_GCC_DEVEL_REVISION="ee5c3db6c5b2c3332912fb4c9cfa2864569ebd9a" 58 | 59 | # This is a baremetal target so don't use syscalls. 60 | CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y 61 | 62 | # The build script appends a definition of CT_LOCAL_PATCH_DIR down here, that 63 | # points to the repo's patch directory. 64 | -------------------------------------------------------------------------------- /lowrisc-toolchain-gcc-rv32imcb.config: -------------------------------------------------------------------------------- 1 | CT_CONFIG_VERSION="3" 2 | CT_EXPERIMENTAL=y 3 | 4 | CT_ARCH_RISCV=y 5 | 6 | # CT_ARCH_ARCH controls the specific architecture that the toolchain's libraries 7 | # are built with. It should specify the minimum RISC-V extensions that need to 8 | # be implemented by any processor that this toolchain will compile programs for. 9 | # 10 | # 2022-01-13: We can now generally assume that Ibex supports bitmanip, so we can 11 | # compile the toolchain libraries with bitmanip 1.0 support. 12 | # 13 | # N.B. OpenTitan still requires support for Ibex without bitmanip 14 | # (in the English Breakfast toplevel design) but OpenTitan is 15 | # freestanding, so it shouldn't use these libraries. 16 | # 17 | # Unfortunately, when we tried to enable the ratified bitmanip 18 | # subset here by specifying `CT_ARCH_ARCH=rv32imc_zba_zbb_zbc_zbs` 19 | # the toolchain failed to compile, saying that `rol` (from Zbb) 20 | # wasn't a recognized instruction. Until this is solved we don't 21 | # compile the libraries with bitmanip. This doesn't really matter 22 | # for our current use cases. 23 | # 24 | CT_ARCH_ARCH="rv32imc" 25 | 26 | # CT_ARCH_ABI controls the specific ABI that the toolchain's libraries are built 27 | # with. All programs built against this toolchain should follow exactly this 28 | # ABI. 29 | CT_ARCH_ABI="ilp32" 30 | 31 | CT_TARGET_VENDOR="" 32 | CT_TOOLCHAIN_BUGURL="toolchains@lowrisc.org" 33 | 34 | CT_DOWNLOAD_AGENT_CURL=y 35 | 36 | CT_CC_GCC_STATIC_LIBSTDCXX=y 37 | # CT_CC_GCC_LDBL_128 is not set 38 | CT_CC_LANG_CXX=y 39 | CT_GCC_V_9=y 40 | CT_DEBUG_GDB=y 41 | CT_GDB_V_11_1=y 42 | # CT_GDB_CROSS_PYTHON is not set 43 | CT_PATCH_ORDER="bundled,local" 44 | CT_PATCH_BUNDLED_LOCAL=y 45 | CT_PATCH_USE_LOCAL=y 46 | 47 | # Disable progress bar for CI builds, it generates too much log output 48 | # CT_LOG_PROGRESS_BAR is not set 49 | 50 | # Installation prefix directory; the toolchain will end up in exactly 51 | # this directory. 52 | CT_PREFIX_DIR="/tools/riscv" 53 | 54 | # Don't save tarballs for re-use (needs writable and pre-created 55 | # CT_LOCAL_TARBALLS_DIR otherwise) 56 | # CT_SAVE_TARBALLS is not set 57 | 58 | # Don't chmod the CT_PREFIX_DIR read-only after the install. 59 | # CT_PREFIX_DIR_RO is not set 60 | 61 | # Binutils 2.35, RISC-V bitmanip fork (branch riscv-binutils-2.35-rvb, 62 | # commit 7c9dd840fb from 2021-03-10). 63 | # A bitmanip 1.0+0.93 patch will be applied on top. 64 | CT_BINUTILS_SRC_DEVEL=y 65 | CT_BINUTILS_DEVEL_VCS_git=y 66 | CT_BINUTILS_DEVEL_URL="https://github.com/riscv-collab/riscv-binutils-gdb.git" 67 | CT_BINUTILS_DEVEL_REVISION="7c9dd840fbb6a1171a51feb08afb859288615137" 68 | 69 | # GCC 10.2.0, RISC-V bitmanip fork (branch riscv-gcc-10.2.0-rvb, 70 | # commit 73055647d33 from 2021-07-09) 71 | CT_GCC_SRC_DEVEL=y 72 | CT_GCC_DEVEL_VCS_git=y 73 | CT_GCC_DEVEL_URL="https://github.com/riscv-collab/riscv-gcc" 74 | CT_GCC_DEVEL_REVISION="73055647d33c0b63a3125c372019d1dac0f8ac34" 75 | 76 | # This is a baremetal target so don't use syscalls. 77 | CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y 78 | 79 | # The build script appends a definition of CT_LOCAL_PATCH_DIR down here, that 80 | # points to the repo's patch directory. 81 | -------------------------------------------------------------------------------- /lowrisc-toolchain-gcc-rv64imac.config: -------------------------------------------------------------------------------- 1 | CT_CONFIG_VERSION="3" 2 | CT_EXPERIMENTAL=y 3 | 4 | CT_ARCH_RISCV=y 5 | CT_ARCH_64=y 6 | 7 | # CT_ARCH_ARCH controls the specific architecture that the toolchain's libraries 8 | # are built with. It should specify the minimum RISC-V extensions that need to 9 | # be implemented by any processor that this toolchain will compile programs for. 10 | CT_ARCH_ARCH="rv64imac" 11 | 12 | # CT_ARCH_ABI controls the specific ABI that the toolchain's libraries are built 13 | # with. All programs built against this toolchain should follow exactly this 14 | # ABI. 15 | CT_ARCH_ABI="lp64" 16 | 17 | CT_TARGET_CFLAGS="-mcmodel=medany" 18 | 19 | CT_TARGET_VENDOR="" 20 | CT_TOOLCHAIN_BUGURL="toolchains@lowrisc.org" 21 | 22 | CT_DOWNLOAD_AGENT_CURL=y 23 | 24 | CT_CC_GCC_STATIC_LIBSTDCXX=y 25 | # CT_CC_GCC_LDBL_128 is not set 26 | CT_CC_LANG_CXX=y 27 | CT_GCC_V_9=y 28 | CT_DEBUG_GDB=y 29 | CT_GDB_V_11_1=y 30 | # CT_GDB_CROSS_PYTHON is not set 31 | CT_PATCH_ORDER="bundled,local" 32 | CT_PATCH_BUNDLED_LOCAL=y 33 | CT_PATCH_USE_LOCAL=y 34 | 35 | # Disable progress bar for CI builds, it generates too much log output 36 | # CT_LOG_PROGRESS_BAR is not set 37 | 38 | # Installation prefix directory; the toolchain will end up in exactly 39 | # this directory. 40 | CT_PREFIX_DIR="/tools/riscv" 41 | 42 | # Don't save tarballs for re-use (needs writable and pre-created 43 | # CT_LOCAL_TARBALLS_DIR otherwise) 44 | # CT_SAVE_TARBALLS is not set 45 | 46 | # Don't chmod the CT_PREFIX_DIR read-only after the install. 47 | # CT_PREFIX_DIR_RO is not set 48 | 49 | # Binutils 2.35 (tag binutils-2_35, commit 2cb5c79dad3) 50 | CT_BINUTILS_SRC_DEVEL=y 51 | CT_BINUTILS_DEVEL_VCS_git=y 52 | CT_BINUTILS_DEVEL_URL="https://github.com/bminor/binutils-gdb.git" 53 | CT_BINUTILS_DEVEL_REVISION="2cb5c79dad39dd438fb0f7372ac04cf5aa2a7db7" 54 | 55 | # GCC 10.2.0 (tag releases/gcc-10.2.0, commit ee5c3db6c5b) 56 | CT_GCC_SRC_DEVEL=y 57 | CT_GCC_DEVEL_VCS_git=y 58 | CT_GCC_DEVEL_URL="https://gcc.gnu.org/git/gcc.git" 59 | CT_GCC_DEVEL_REVISION="ee5c3db6c5b2c3332912fb4c9cfa2864569ebd9a" 60 | 61 | # The build script appends a definition of CT_LOCAL_PATCH_DIR down here, that 62 | # points to the repo's patch directory. 63 | -------------------------------------------------------------------------------- /patches/lowrisc-toolchain-gcc-rv32imc/gdb/11.1/001-glob-libc-config.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gnulib/import/glob.c b/gnulib/import/glob.c 2 | index 1bfcafb..9947f24 100644 3 | --- a/gnulib/import/glob.c 4 | +++ b/gnulib/import/glob.c 5 | @@ -21,7 +21,7 @@ 6 | optimizes away the pattern == NULL test below. */ 7 | # define _GL_ARG_NONNULL(params) 8 | 9 | -# include 10 | +# include 11 | 12 | #endif 13 | 14 | diff --git a/gnulib/import/libc-config.h b/gnulib/import/libc-config.h 15 | index e3571ee..44c3d0f 100644 16 | --- a/gnulib/import/libc-config.h 17 | +++ b/gnulib/import/libc-config.h 18 | @@ -189,3 +189,7 @@ 19 | #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 20 | #define compat_symbol(lib, local, symbol, version) extern int dummy 21 | #define versioned_symbol(lib, local, symbol, version) extern int dummy 22 | + 23 | +#ifndef __THROWNL 24 | +#define __THROWNL __THROW 25 | +#endif 26 | -------------------------------------------------------------------------------- /patches/lowrisc-toolchain-gcc-rv32imcb/binutils/git-7c9dd840/001-bitmanip.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h 2 | index 53b5e143bc..3ba700f234 100644 3 | --- a/include/opcode/riscv-opc.h 4 | +++ b/include/opcode/riscv-opc.h 5 | @@ -195,32 +195,40 @@ 6 | #define MASK_ORN 0xfe00707f 7 | #define MATCH_XNOR 0x40004033 8 | #define MASK_XNOR 0xfe00707f 9 | +#define MATCH_SLO 0x20001033 10 | +#define MASK_SLO 0xfe00707f 11 | +#define MATCH_SRO 0x20005033 12 | +#define MASK_SRO 0xfe00707f 13 | #define MATCH_ROL 0x60001033 14 | #define MASK_ROL 0xfe00707f 15 | #define MATCH_ROR 0x60005033 16 | #define MASK_ROR 0xfe00707f 17 | -#define MATCH_SBCLR 0x48001033 18 | -#define MASK_SBCLR 0xfe00707f 19 | -#define MATCH_SBSET 0x28001033 20 | -#define MASK_SBSET 0xfe00707f 21 | -#define MATCH_SBINV 0x68001033 22 | -#define MASK_SBINV 0xfe00707f 23 | -#define MATCH_SBEXT 0x48005033 24 | -#define MASK_SBEXT 0xfe00707f 25 | +#define MATCH_BCLR 0x48001033 26 | +#define MASK_BCLR 0xfe00707f 27 | +#define MATCH_BSET 0x28001033 28 | +#define MASK_BSET 0xfe00707f 29 | +#define MATCH_BINV 0x68001033 30 | +#define MASK_BINV 0xfe00707f 31 | +#define MATCH_BEXT 0x48005033 32 | +#define MASK_BEXT 0xfe00707f 33 | #define MATCH_GORC 0x28005033 34 | #define MASK_GORC 0xfe00707f 35 | #define MATCH_GREV 0x68005033 36 | #define MASK_GREV 0xfe00707f 37 | +#define MATCH_SLOI 0x20001013 38 | +#define MASK_SLOI 0xfc00707f 39 | +#define MATCH_SROI 0x20005013 40 | +#define MASK_SROI 0xfc00707f 41 | #define MATCH_RORI 0x60005013 42 | #define MASK_RORI 0xfc00707f 43 | -#define MATCH_SBCLRI 0x48001013 44 | -#define MASK_SBCLRI 0xfc00707f 45 | -#define MATCH_SBSETI 0x28001013 46 | -#define MASK_SBSETI 0xfc00707f 47 | -#define MATCH_SBINVI 0x68001013 48 | -#define MASK_SBINVI 0xfc00707f 49 | -#define MATCH_SBEXTI 0x48005013 50 | -#define MASK_SBEXTI 0xfc00707f 51 | +#define MATCH_BCLRI 0x48001013 52 | +#define MASK_BCLRI 0xfc00707f 53 | +#define MATCH_BSETI 0x28001013 54 | +#define MASK_BSETI 0xfc00707f 55 | +#define MATCH_BINVI 0x68001013 56 | +#define MASK_BINVI 0xfc00707f 57 | +#define MATCH_BEXTI 0x48005013 58 | +#define MASK_BEXTI 0xfc00707f 59 | #define MATCH_GORCI 0x28005013 60 | #define MASK_GORCI 0xfc00707f 61 | #define MATCH_GREVI 0x68005013 62 | @@ -239,8 +247,8 @@ 63 | #define MASK_CLZ 0xfff0707f 64 | #define MATCH_CTZ 0x60101013 65 | #define MASK_CTZ 0xfff0707f 66 | -#define MATCH_PCNT 0x60201013 67 | -#define MASK_PCNT 0xfff0707f 68 | +#define MATCH_CPOP 0x60201013 69 | +#define MASK_CPOP 0xfff0707f 70 | #define MATCH_SEXT_B 0x60401013 71 | #define MASK_SEXT_B 0xfff0707f 72 | #define MATCH_SEXT_H 0x60501013 73 | @@ -281,10 +289,10 @@ 74 | #define MASK_SHFL 0xfe00707f 75 | #define MATCH_UNSHFL 0x8005033 76 | #define MASK_UNSHFL 0xfe00707f 77 | -#define MATCH_BEXT 0x8006033 78 | -#define MASK_BEXT 0xfe00707f 79 | -#define MATCH_BDEP 0x48006033 80 | -#define MASK_BDEP 0xfe00707f 81 | +#define MATCH_BCOMPRESS 0x8006033 82 | +#define MASK_BCOMPRESS 0xfe00707f 83 | +#define MATCH_BDECOMPRESS 0x48006033 84 | +#define MASK_BDECOMPRESS 0xfe00707f 85 | #define MATCH_PACK 0x8004033 86 | #define MASK_PACK 0xfe00707f 87 | #define MATCH_PACKU 0x48004033 88 | @@ -307,34 +315,42 @@ 89 | #define MASK_BMATOR 0xfe00707f 90 | #define MATCH_BMATXOR 0x48003033 91 | #define MASK_BMATXOR 0xfe00707f 92 | -#define MATCH_SLLIU_W 0x800101b 93 | -#define MASK_SLLIU_W 0xfc00707f 94 | -#define MATCH_ADDU_W 0x800003b 95 | -#define MASK_ADDU_W 0xfe00707f 96 | +#define MATCH_SLLI_UW 0x800101b 97 | +#define MASK_SLLI_UW 0xfc00707f 98 | +#define MATCH_ADD_UW 0x800003b 99 | +#define MASK_ADD_UW 0xfe00707f 100 | +#define MATCH_SLOW 0x2000103b 101 | +#define MASK_SLOW 0xfe00707f 102 | +#define MATCH_SROW 0x2000503b 103 | +#define MASK_SROW 0xfe00707f 104 | #define MATCH_ROLW 0x6000103b 105 | #define MASK_ROLW 0xfe00707f 106 | #define MATCH_RORW 0x6000503b 107 | #define MASK_RORW 0xfe00707f 108 | -#define MATCH_SBCLRW 0x4800103b 109 | -#define MASK_SBCLRW 0xfe00707f 110 | -#define MATCH_SBSETW 0x2800103b 111 | -#define MASK_SBSETW 0xfe00707f 112 | -#define MATCH_SBINVW 0x6800103b 113 | -#define MASK_SBINVW 0xfe00707f 114 | -#define MATCH_SBEXTW 0x4800503b 115 | -#define MASK_SBEXTW 0xfe00707f 116 | +#define MATCH_BCLRW 0x4800103b 117 | +#define MASK_BCLRW 0xfe00707f 118 | +#define MATCH_BSETW 0x2800103b 119 | +#define MASK_BSETW 0xfe00707f 120 | +#define MATCH_BINVW 0x6800103b 121 | +#define MASK_BINVW 0xfe00707f 122 | +#define MATCH_BEXTW 0x4800503b 123 | +#define MASK_BEXTW 0xfe00707f 124 | #define MATCH_GORCW 0x2800503b 125 | #define MASK_GORCW 0xfe00707f 126 | #define MATCH_GREVW 0x6800503b 127 | #define MASK_GREVW 0xfe00707f 128 | +#define MATCH_SLOIW 0x2000101b 129 | +#define MASK_SLOIW 0xfe00707f 130 | +#define MATCH_SROIW 0x2000501b 131 | +#define MASK_SROIW 0xfe00707f 132 | #define MATCH_RORIW 0x6000501b 133 | #define MASK_RORIW 0xfe00707f 134 | -#define MATCH_SBCLRIW 0x4800101b 135 | -#define MASK_SBCLRIW 0xfe00707f 136 | -#define MATCH_SBSETIW 0x2800101b 137 | -#define MASK_SBSETIW 0xfe00707f 138 | -#define MATCH_SBINVIW 0x6800101b 139 | -#define MASK_SBINVIW 0xfe00707f 140 | +#define MATCH_BCLRIW 0x4800101b 141 | +#define MASK_BCLRIW 0xfe00707f 142 | +#define MATCH_BSETIW 0x2800101b 143 | +#define MASK_BSETIW 0xfe00707f 144 | +#define MATCH_BINVIW 0x6800101b 145 | +#define MASK_BINVIW 0xfe00707f 146 | #define MATCH_GORCIW 0x2800501b 147 | #define MASK_GORCIW 0xfe00707f 148 | #define MATCH_GREVIW 0x6800501b 149 | @@ -349,22 +365,22 @@ 150 | #define MASK_CLZW 0xfff0707f 151 | #define MATCH_CTZW 0x6010101b 152 | #define MASK_CTZW 0xfff0707f 153 | -#define MATCH_PCNTW 0x6020101b 154 | -#define MASK_PCNTW 0xfff0707f 155 | -#define MATCH_SH1ADDU_W 0x2000203b 156 | -#define MASK_SH1ADDU_W 0xfe00707f 157 | -#define MATCH_SH2ADDU_W 0x2000403b 158 | -#define MASK_SH2ADDU_W 0xfe00707f 159 | -#define MATCH_SH3ADDU_W 0x2000603b 160 | -#define MASK_SH3ADDU_W 0xfe00707f 161 | +#define MATCH_CPOPW 0x6020101b 162 | +#define MASK_CPOPW 0xfff0707f 163 | +#define MATCH_SH1ADD_UW 0x2000203b 164 | +#define MASK_SH1ADD_UW 0xfe00707f 165 | +#define MATCH_SH2ADD_UW 0x2000403b 166 | +#define MASK_SH2ADD_UW 0xfe00707f 167 | +#define MATCH_SH3ADD_UW 0x2000603b 168 | +#define MASK_SH3ADD_UW 0xfe00707f 169 | #define MATCH_SHFLW 0x800103b 170 | #define MASK_SHFLW 0xfe00707f 171 | #define MATCH_UNSHFLW 0x800503b 172 | #define MASK_UNSHFLW 0xfe00707f 173 | -#define MATCH_BEXTW 0x800603b 174 | -#define MASK_BEXTW 0xfe00707f 175 | -#define MATCH_BDEPW 0x4800603b 176 | -#define MASK_BDEPW 0xfe00707f 177 | +#define MATCH_BCOMPRESSW 0x800603b 178 | +#define MASK_BCOMPRESSW 0xfe00707f 179 | +#define MATCH_BDECOMPRESSW 0x4800603b 180 | +#define MASK_BDECOMPRESSW 0xfe00707f 181 | #define MATCH_PACKW 0x800403b 182 | #define MASK_PACKW 0xfe00707f 183 | #define MATCH_PACKUW 0x4800403b 184 | @@ -1121,19 +1137,23 @@ DECLARE_INSN(remuw, MATCH_REMUW, MASK_REMUW) 185 | DECLARE_INSN(andn, MATCH_ANDN, MASK_ANDN) 186 | DECLARE_INSN(orn, MATCH_ORN, MASK_ORN) 187 | DECLARE_INSN(xnor, MATCH_XNOR, MASK_XNOR) 188 | +DECLARE_INSN(slo, MATCH_SLO, MASK_SLO) 189 | +DECLARE_INSN(sro, MATCH_SRO, MASK_SRO) 190 | DECLARE_INSN(rol, MATCH_ROL, MASK_ROL) 191 | DECLARE_INSN(ror, MATCH_ROR, MASK_ROR) 192 | -DECLARE_INSN(sbclr, MATCH_SBCLR, MASK_SBCLR) 193 | -DECLARE_INSN(sbset, MATCH_SBSET, MASK_SBSET) 194 | -DECLARE_INSN(sbinv, MATCH_SBINV, MASK_SBINV) 195 | -DECLARE_INSN(sbext, MATCH_SBEXT, MASK_SBEXT) 196 | +DECLARE_INSN(bclr, MATCH_BCLR, MASK_BCLR) 197 | +DECLARE_INSN(bset, MATCH_BSET, MASK_BSET) 198 | +DECLARE_INSN(binv, MATCH_BINV, MASK_BINV) 199 | +DECLARE_INSN(bext, MATCH_BEXT, MASK_BEXT) 200 | DECLARE_INSN(gorc, MATCH_GORC, MASK_GORC) 201 | DECLARE_INSN(grev, MATCH_GREV, MASK_GREV) 202 | +DECLARE_INSN(sloi, MATCH_SLOI, MASK_SLOI) 203 | +DECLARE_INSN(sroi, MATCH_SROI, MASK_SROI) 204 | DECLARE_INSN(rori, MATCH_RORI, MASK_RORI) 205 | -DECLARE_INSN(sbclri, MATCH_SBCLRI, MASK_SBCLRI) 206 | -DECLARE_INSN(sbseti, MATCH_SBSETI, MASK_SBSETI) 207 | -DECLARE_INSN(sbinvi, MATCH_SBINVI, MASK_SBINVI) 208 | -DECLARE_INSN(sbexti, MATCH_SBEXTI, MASK_SBEXTI) 209 | +DECLARE_INSN(bclri, MATCH_BCLRI, MASK_BCLRI) 210 | +DECLARE_INSN(bseti, MATCH_BSETI, MASK_BSETI) 211 | +DECLARE_INSN(binvi, MATCH_BINVI, MASK_BINVI) 212 | +DECLARE_INSN(bexti, MATCH_BEXTI, MASK_BEXTI) 213 | DECLARE_INSN(gorci, MATCH_GORCI, MASK_GORCI) 214 | DECLARE_INSN(grevi, MATCH_GREVI, MASK_GREVI) 215 | DECLARE_INSN(cmix, MATCH_CMIX, MASK_CMIX) 216 | @@ -1143,7 +1163,7 @@ DECLARE_INSN(fsr, MATCH_FSR, MASK_FSR) 217 | DECLARE_INSN(fsri, MATCH_FSRI, MASK_FSRI) 218 | DECLARE_INSN(clz, MATCH_CLZ, MASK_CLZ) 219 | DECLARE_INSN(ctz, MATCH_CTZ, MASK_CTZ) 220 | -DECLARE_INSN(pcnt, MATCH_PCNT, MASK_PCNT) 221 | +DECLARE_INSN(cpop, MATCH_CPOP, MASK_CPOP) 222 | DECLARE_INSN(sext_b, MATCH_SEXT_B, MASK_SEXT_B) 223 | DECLARE_INSN(sext_h, MATCH_SEXT_H, MASK_SEXT_H) 224 | DECLARE_INSN(crc32_b, MATCH_CRC32_B, MASK_CRC32_B) 225 | @@ -1164,8 +1184,8 @@ DECLARE_INSN(minu, MATCH_MINU, MASK_MINU) 226 | DECLARE_INSN(maxu, MATCH_MAXU, MASK_MAXU) 227 | DECLARE_INSN(shfl, MATCH_SHFL, MASK_SHFL) 228 | DECLARE_INSN(unshfl, MATCH_UNSHFL, MASK_UNSHFL) 229 | -DECLARE_INSN(bext, MATCH_BEXT, MASK_BEXT) 230 | -DECLARE_INSN(bdep, MATCH_BDEP, MASK_BDEP) 231 | +DECLARE_INSN(bcompress, MATCH_BCOMPRESS, MASK_BCOMPRESS) 232 | +DECLARE_INSN(bdecompress, MATCH_BDECOMPRESS, MASK_BDECOMPRESS) 233 | DECLARE_INSN(pack, MATCH_PACK, MASK_PACK) 234 | DECLARE_INSN(packu, MATCH_PACKU, MASK_PACKU) 235 | DECLARE_INSN(packh, MATCH_PACKH, MASK_PACKH) 236 | @@ -1177,20 +1197,24 @@ DECLARE_INSN(crc32_d, MATCH_CRC32_D, MASK_CRC32_D) 237 | DECLARE_INSN(crc32c_d, MATCH_CRC32C_D, MASK_CRC32C_D) 238 | DECLARE_INSN(bmator, MATCH_BMATOR, MASK_BMATOR) 239 | DECLARE_INSN(bmatxor, MATCH_BMATXOR, MASK_BMATXOR) 240 | -DECLARE_INSN(slliu_w, MATCH_SLLIU_W, MASK_SLLIU_W) 241 | -DECLARE_INSN(addu_w, MATCH_ADDU_W, MASK_ADDU_W) 242 | +DECLARE_INSN(slli_uw, MATCH_SLLI_UW, MASK_SLLI_UW) 243 | +DECLARE_INSN(add_uw, MATCH_ADD_UW, MASK_ADD_UW) 244 | +DECLARE_INSN(slow, MATCH_SLOW, MASK_SLOW) 245 | +DECLARE_INSN(srow, MATCH_SROW, MASK_SROW) 246 | DECLARE_INSN(rolw, MATCH_ROLW, MASK_ROLW) 247 | DECLARE_INSN(rorw, MATCH_RORW, MASK_RORW) 248 | -DECLARE_INSN(sbclrw, MATCH_SBCLRW, MASK_SBCLRW) 249 | -DECLARE_INSN(sbsetw, MATCH_SBSETW, MASK_SBSETW) 250 | -DECLARE_INSN(sbinvw, MATCH_SBINVW, MASK_SBINVW) 251 | -DECLARE_INSN(sbextw, MATCH_SBEXTW, MASK_SBEXTW) 252 | +DECLARE_INSN(bclrw, MATCH_BCLRW, MASK_BCLRW) 253 | +DECLARE_INSN(bsetw, MATCH_BSETW, MASK_BSETW) 254 | +DECLARE_INSN(binvw, MATCH_BINVW, MASK_BINVW) 255 | +DECLARE_INSN(bextw, MATCH_BEXTW, MASK_BEXTW) 256 | DECLARE_INSN(gorcw, MATCH_GORCW, MASK_GORCW) 257 | DECLARE_INSN(grevw, MATCH_GREVW, MASK_GREVW) 258 | +DECLARE_INSN(sloiw, MATCH_SLOIW, MASK_SLOIW) 259 | +DECLARE_INSN(sroiw, MATCH_SROIW, MASK_SROIW) 260 | DECLARE_INSN(roriw, MATCH_RORIW, MASK_RORIW) 261 | -DECLARE_INSN(sbclriw, MATCH_SBCLRIW, MASK_SBCLRIW) 262 | -DECLARE_INSN(sbsetiw, MATCH_SBSETIW, MASK_SBSETIW) 263 | -DECLARE_INSN(sbinviw, MATCH_SBINVIW, MASK_SBINVIW) 264 | +DECLARE_INSN(bclriw, MATCH_BCLRIW, MASK_BCLRIW) 265 | +DECLARE_INSN(bsetiw, MATCH_BSETIW, MASK_BSETIW) 266 | +DECLARE_INSN(binviw, MATCH_BINVIW, MASK_BINVIW) 267 | DECLARE_INSN(gorciw, MATCH_GORCIW, MASK_GORCIW) 268 | DECLARE_INSN(greviw, MATCH_GREVIW, MASK_GREVIW) 269 | DECLARE_INSN(fslw, MATCH_FSLW, MASK_FSLW) 270 | @@ -1198,14 +1222,14 @@ DECLARE_INSN(fsrw, MATCH_FSRW, MASK_FSRW) 271 | DECLARE_INSN(fsriw, MATCH_FSRIW, MASK_FSRIW) 272 | DECLARE_INSN(clzw, MATCH_CLZW, MASK_CLZW) 273 | DECLARE_INSN(ctzw, MATCH_CTZW, MASK_CTZW) 274 | -DECLARE_INSN(pcntw, MATCH_PCNTW, MASK_PCNTW) 275 | -DECLARE_INSN(sh1addu_w, MATCH_SH1ADDU_W, MASK_SH1ADDU_W) 276 | -DECLARE_INSN(sh2addu_w, MATCH_SH2ADDU_W, MASK_SH2ADDU_W) 277 | -DECLARE_INSN(sh3addu_w, MATCH_SH3ADDU_W, MASK_SH3ADDU_W) 278 | +DECLARE_INSN(cpopw, MATCH_CPOPW, MASK_CPOPW) 279 | +DECLARE_INSN(sh1add_uw, MATCH_SH1ADD_UW, MASK_SH1ADD_UW) 280 | +DECLARE_INSN(sh2add_uw, MATCH_SH2ADD_UW, MASK_SH2ADD_UW) 281 | +DECLARE_INSN(sh3add_uw, MATCH_SH3ADD_UW, MASK_SH3ADD_UW) 282 | DECLARE_INSN(shflw, MATCH_SHFLW, MASK_SHFLW) 283 | DECLARE_INSN(unshflw, MATCH_UNSHFLW, MASK_UNSHFLW) 284 | -DECLARE_INSN(bextw, MATCH_BEXTW, MASK_BEXTW) 285 | -DECLARE_INSN(bdepw, MATCH_BDEPW, MASK_BDEPW) 286 | +DECLARE_INSN(bcompressw, MATCH_BCOMPRESSW, MASK_BCOMPRESSW) 287 | +DECLARE_INSN(bdecompressw, MATCH_BDECOMPRESSW, MASK_BDECOMPRESSW) 288 | DECLARE_INSN(packw, MATCH_PACKW, MASK_PACKW) 289 | DECLARE_INSN(packuw, MATCH_PACKUW, MASK_PACKUW) 290 | DECLARE_INSN(bfpw, MATCH_BFPW, MASK_BFPW) 291 | diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c 292 | index 3a59630101..0d962fa8a5 100644 293 | --- a/opcodes/riscv-opc.c 294 | +++ b/opcodes/riscv-opc.c 295 | @@ -502,24 +502,30 @@ const struct riscv_opcode riscv_opcodes[] = 296 | {"andn", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,t", MATCH_ANDN, MASK_ANDN, match_opcode, 0 }, 297 | {"orn", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,t", MATCH_ORN, MASK_ORN, match_opcode, 0 }, 298 | {"xnor", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,t", MATCH_XNOR, MASK_XNOR, match_opcode, 0 }, 299 | +{"sloi", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_SLOI, MASK_SLOI, match_opcode, 0 }, 300 | +{"sroi", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_SROI, MASK_SROI, match_opcode, 0 }, 301 | {"rori", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,>", MATCH_RORI, MASK_RORI, match_opcode, 0 }, 302 | +{"slo", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_SLO, MASK_SLO, match_opcode, 0 }, 303 | +{"slo", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_SLOI, MASK_SLOI, match_opcode, INSN_ALIAS }, 304 | +{"sro", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_SRO, MASK_SRO, match_opcode, 0 }, 305 | +{"sro", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_SROI, MASK_SROI, match_opcode, INSN_ALIAS }, 306 | {"rol", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_ROL, MASK_ROL, match_opcode, 0 }, 307 | {"ror", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,t", MATCH_ROR, MASK_ROR, match_opcode, 0 }, 308 | {"ror", 0, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,>", MATCH_RORI, MASK_RORI, match_opcode, INSN_ALIAS }, 309 | -{"sbclri", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBCLRI, MASK_SBCLRI, match_opcode, 0 }, 310 | -{"sbseti", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBSETI, MASK_SBSETI, match_opcode, 0 }, 311 | -{"sbinvi", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBINVI, MASK_SBINVI, match_opcode, 0 }, 312 | -{"sbexti", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBEXTI, MASK_SBEXTI, match_opcode, 0 }, 313 | +{"bclri", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BCLRI, MASK_BCLRI, match_opcode, 0 }, 314 | +{"bseti", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BSETI, MASK_BSETI, match_opcode, 0 }, 315 | +{"binvi", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BINVI, MASK_BINVI, match_opcode, 0 }, 316 | +{"bexti", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BEXTI, MASK_BEXTI, match_opcode, 0 }, 317 | {"gorci", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_GORCI, MASK_GORCI, match_opcode, 0 }, 318 | {"grevi", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_GREVI, MASK_GREVI, match_opcode, 0 }, 319 | -{"sbclr", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBCLR, MASK_SBCLR, match_opcode, 0 }, 320 | -{"sbclr", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBCLRI, MASK_SBCLRI, match_opcode, INSN_ALIAS }, 321 | -{"sbset", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBSET, MASK_SBSET, match_opcode, 0 }, 322 | -{"sbset", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBSETI, MASK_SBSETI, match_opcode, INSN_ALIAS }, 323 | -{"sbinv", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBINV, MASK_SBINV, match_opcode, 0 }, 324 | -{"sbinv", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBINVI, MASK_SBINVI, match_opcode, INSN_ALIAS }, 325 | -{"sbext", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBEXT, MASK_SBEXT, match_opcode, 0 }, 326 | -{"sbext", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_SBEXTI, MASK_SBEXTI, match_opcode, INSN_ALIAS }, 327 | +{"bclr", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BCLR, MASK_BCLR, match_opcode, 0 }, 328 | +{"bclr", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BCLRI, MASK_BCLRI, match_opcode, INSN_ALIAS }, 329 | +{"bset", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BSET, MASK_BSET, match_opcode, 0 }, 330 | +{"bset", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BSETI, MASK_BSETI, match_opcode, INSN_ALIAS }, 331 | +{"binv", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BINV, MASK_BINV, match_opcode, 0 }, 332 | +{"binv", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BINVI, MASK_BINVI, match_opcode, INSN_ALIAS }, 333 | +{"bext", 0, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BEXT, MASK_BEXT, match_opcode, 0 }, 334 | +{"bext", 0, INSN_CLASS_B_OR_ZBS, "d,s,>", MATCH_BEXTI, MASK_BEXTI, match_opcode, INSN_ALIAS }, 335 | {"gorc", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_GORC, MASK_GORC, match_opcode, 0 }, 336 | {"gorc", 0, INSN_CLASS_B_OR_ZBP, "d,s,>", MATCH_GORCI, MASK_GORCI, match_opcode, INSN_ALIAS }, 337 | {"grev", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_GREV, MASK_GREV, match_opcode, 0 }, 338 | @@ -532,7 +538,7 @@ const struct riscv_opcode riscv_opcodes[] = 339 | {"fsr", 0, INSN_CLASS_B_OR_ZBT, "d,s,r,>", MATCH_FSRI, MASK_FSRI, match_opcode, INSN_ALIAS }, 340 | {"clz", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CLZ, MASK_CLZ, match_opcode, 0 }, 341 | {"ctz", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CTZ, MASK_CTZ, match_opcode, 0 }, 342 | -{"pcnt", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_PCNT, MASK_PCNT, match_opcode, 0 }, 343 | +{"cpop", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CPOP, MASK_CPOP, match_opcode, 0 }, 344 | {"sext.b", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_SEXT_B, MASK_SEXT_B, match_opcode, 0 }, 345 | {"sext.h", 0, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_SEXT_H, MASK_SEXT_H, match_opcode, 0 }, 346 | {"bmatflip", 64, INSN_CLASS_B_OR_ZBM, "d,s", MATCH_BMATFLIP, MASK_BMATFLIP, match_opcode, 0 }, 347 | @@ -560,8 +566,8 @@ const struct riscv_opcode riscv_opcodes[] = 348 | {"shfl", 0, INSN_CLASS_B_OR_ZBP, "d,s,|", MATCH_SHFLI, MASK_SHFLI, match_opcode, INSN_ALIAS }, 349 | {"unshfl", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_UNSHFL, MASK_UNSHFL, match_opcode, 0 }, 350 | {"unshfl", 0, INSN_CLASS_B_OR_ZBP, "d,s,|", MATCH_UNSHFLI, MASK_UNSHFLI, match_opcode, INSN_ALIAS }, 351 | -{"bdep", 0, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BDEP, MASK_BDEP, match_opcode, 0 }, 352 | -{"bext", 0, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BEXT, MASK_BEXT, match_opcode, 0 }, 353 | +{"bdecompress", 0, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BDECOMPRESS, MASK_BDECOMPRESS, match_opcode, 0 }, 354 | +{"bcompress", 0, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BCOMPRESS, MASK_BCOMPRESS, match_opcode, 0 }, 355 | {"pack", 0, INSN_CLASS_B_OR_ZBF_OR_ZBP, "d,s,t", MATCH_PACK, MASK_PACK, match_opcode, 0 }, 356 | {"zext.h", 32, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_PACK, MASK_PACK | MASK_RS2, match_opcode, 0 }, 357 | {"zext.h", 64, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_PACKW, MASK_PACKW | MASK_RS2, match_opcode, 0 }, 358 | @@ -571,24 +577,30 @@ const struct riscv_opcode riscv_opcodes[] = 359 | {"bmator", 64, INSN_CLASS_B_OR_ZBM, "d,s,t", MATCH_BMATOR, MASK_BMATOR, match_opcode, 0 }, 360 | {"bmatxor", 64, INSN_CLASS_B_OR_ZBM, "d,s,t", MATCH_BMATXOR, MASK_BMATXOR, match_opcode, 0 }, 361 | {"bfp", 0, INSN_CLASS_B_OR_ZBF, "d,s,t", MATCH_BFP, MASK_BFP, match_opcode, 0 }, 362 | -{"slliu.w", 64, INSN_CLASS_B_OR_ZBA, "d,s,>", MATCH_SLLIU_W, MASK_SLLIU_W, match_opcode, 0 }, 363 | -{"addu.w", 64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_ADDU_W, MASK_ADDU_W, match_opcode, 0 }, 364 | +{"slli.uw", 64, INSN_CLASS_B_OR_ZBA, "d,s,>", MATCH_SLLI_UW, MASK_SLLI_UW, match_opcode, 0 }, 365 | +{"add.uw", 64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_ADD_UW, MASK_ADD_UW, match_opcode, 0 }, 366 | +{"sloiw", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_SLOIW, MASK_SLOIW, match_opcode, 0 }, 367 | +{"sroiw", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_SROIW, MASK_SROIW, match_opcode, 0 }, 368 | {"roriw", 64, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,<", MATCH_RORIW, MASK_RORIW, match_opcode, 0 }, 369 | +{"slow", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_SLOW, MASK_SLOW, match_opcode, 0 }, 370 | +{"slow", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_SLOIW, MASK_SLOIW, match_opcode, INSN_ALIAS }, 371 | +{"srow", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_SROW, MASK_SROW, match_opcode, 0 }, 372 | +{"srow", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_SROIW, MASK_SROIW, match_opcode, INSN_ALIAS }, 373 | {"rolw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_ROLW, MASK_ROLW, match_opcode, 0 }, 374 | {"rorw", 64, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,t", MATCH_RORW, MASK_RORW, match_opcode, 0 }, 375 | {"rorw", 64, INSN_CLASS_B_OR_ZBB_OR_ZBP, "d,s,<", MATCH_RORIW, MASK_RORIW, match_opcode, INSN_ALIAS }, 376 | -{"sbclriw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBCLRIW, MASK_SBCLRIW, match_opcode, 0 }, 377 | -{"sbsetiw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBSETIW, MASK_SBSETIW, match_opcode, 0 }, 378 | -{"sbinviw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBINVIW, MASK_SBINVIW, match_opcode, 0 }, 379 | +{"bclriw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BCLRIW, MASK_BCLRIW, match_opcode, 0 }, 380 | +{"bsetiw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BSETIW, MASK_BSETIW, match_opcode, 0 }, 381 | +{"binviw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BINVIW, MASK_BINVIW, match_opcode, 0 }, 382 | {"gorciw", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_GORCIW, MASK_GORCIW, match_opcode, 0 }, 383 | {"greviw", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_GREVIW, MASK_GREVIW, match_opcode, 0 }, 384 | -{"sbclrw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBCLRW, MASK_SBCLRW, match_opcode, 0 }, 385 | -{"sbclrw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBCLRIW, MASK_SBCLRIW, match_opcode, INSN_ALIAS }, 386 | -{"sbsetw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBSETW, MASK_SBSETW, match_opcode, 0 }, 387 | -{"sbsetw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBSETIW, MASK_SBSETIW, match_opcode, INSN_ALIAS }, 388 | -{"sbinvw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBINVW, MASK_SBINVW, match_opcode, 0 }, 389 | -{"sbinvw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_SBINVIW, MASK_SBINVIW, match_opcode, INSN_ALIAS }, 390 | -{"sbextw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_SBEXTW, MASK_SBEXTW, match_opcode, 0 }, 391 | +{"bclrw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BCLRW, MASK_BCLRW, match_opcode, 0 }, 392 | +{"bclrw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BCLRIW, MASK_BCLRIW, match_opcode, INSN_ALIAS }, 393 | +{"bsetw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BSETW, MASK_BSETW, match_opcode, 0 }, 394 | +{"bsetw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BSETIW, MASK_BSETIW, match_opcode, INSN_ALIAS }, 395 | +{"binvw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BINVW, MASK_BINVW, match_opcode, 0 }, 396 | +{"binvw", 64, INSN_CLASS_B_OR_ZBS, "d,s,<", MATCH_BINVIW, MASK_BINVIW, match_opcode, INSN_ALIAS }, 397 | +{"bextw", 64, INSN_CLASS_B_OR_ZBS, "d,s,t", MATCH_BEXTW, MASK_BEXTW, match_opcode, 0 }, 398 | {"gorcw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_GORCW, MASK_GORCW, match_opcode, 0 }, 399 | {"gorcw", 64, INSN_CLASS_B_OR_ZBP, "d,s,<", MATCH_GORCIW, MASK_GORCIW, match_opcode, INSN_ALIAS }, 400 | {"grevw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_GREVW, MASK_GREVW, match_opcode, 0 }, 401 | @@ -599,21 +611,21 @@ const struct riscv_opcode riscv_opcodes[] = 402 | {"fsrw", 64, INSN_CLASS_B_OR_ZBT, "d,s,r,<", MATCH_FSRIW, MASK_FSRIW, match_opcode, INSN_ALIAS }, 403 | {"clzw", 64, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CLZW, MASK_CLZW, match_opcode, 0 }, 404 | {"ctzw", 64, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CTZW, MASK_CTZW, match_opcode, 0 }, 405 | -{"pcntw", 64, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_PCNTW, MASK_PCNTW, match_opcode, 0 }, 406 | -{"sh1addu.w",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH1ADDU_W, MASK_SH1ADDU_W, match_opcode, 0 }, 407 | -{"sh2addu.w",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH2ADDU_W, MASK_SH2ADDU_W, match_opcode, 0 }, 408 | -{"sh3addu.w",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH3ADDU_W, MASK_SH3ADDU_W, match_opcode, 0 }, 409 | +{"cpopw", 64, INSN_CLASS_B_OR_ZBB, "d,s", MATCH_CPOPW, MASK_CPOPW, match_opcode, 0 }, 410 | +{"sh1add.uw",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH1ADD_UW, MASK_SH1ADD_UW, match_opcode, 0 }, 411 | +{"sh2add.uw",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH2ADD_UW, MASK_SH2ADD_UW, match_opcode, 0 }, 412 | +{"sh3add.uw",64, INSN_CLASS_B_OR_ZBA, "d,s,t", MATCH_SH3ADD_UW, MASK_SH3ADD_UW, match_opcode, 0 }, 413 | {"shflw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_SHFLW, MASK_SHFLW, match_opcode, 0 }, 414 | {"unshflw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_UNSHFLW, MASK_UNSHFLW, match_opcode, 0 }, 415 | -{"bdepw", 64, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BDEPW, MASK_BDEPW, match_opcode, 0 }, 416 | -{"bextw", 64, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BEXTW, MASK_BEXTW, match_opcode, 0 }, 417 | +{"bdecompressw", 64, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BDECOMPRESSW, MASK_BDECOMPRESSW, match_opcode, 0 }, 418 | +{"bcompressw", 64, INSN_CLASS_B_OR_ZBE, "d,s,t", MATCH_BCOMPRESSW, MASK_BCOMPRESSW, match_opcode, 0 }, 419 | {"packw", 64, INSN_CLASS_B_OR_ZBF_OR_ZBP, "d,s,t", MATCH_PACKW, MASK_PACKW, match_opcode, 0 }, 420 | {"packuw", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_PACKUW, MASK_PACKUW, match_opcode, 0 }, 421 | {"bfpw", 64, INSN_CLASS_B_OR_ZBF, "d,s,t", MATCH_BFPW, MASK_BFPW, match_opcode, 0 }, 422 | {"xperm.n", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_XPERMN, MASK_XPERMN, match_opcode, 0 }, 423 | {"xperm.b", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_XPERMB, MASK_XPERMB, match_opcode, 0 }, 424 | {"xperm.h", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_XPERMH, MASK_XPERMH, match_opcode, 0 }, 425 | -{"xperm.w", 0, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_XPERMW, MASK_XPERMW, match_opcode, 0 }, 426 | +{"xperm.w", 64, INSN_CLASS_B_OR_ZBP, "d,s,t", MATCH_XPERMW, MASK_XPERMW, match_opcode, 0 }, 427 | 428 | /* Bitmanip pseudo-instructions */ 429 | {"rev.p", 0, INSN_CLASS_B_OR_ZBP, "d,s", 0, (int) M_PERM, match_never, INSN_MACRO }, 430 | @@ -1133,17 +1145,17 @@ const struct riscv_ext_version riscv_ext_version_table[] = 431 | {"zvlsseg", ISA_SPEC_CLASS_NONE, 1, 0}, 432 | {"zvqmac", ISA_SPEC_CLASS_NONE, 1, 0}, 433 | 434 | -{"b", ISA_SPEC_CLASS_NONE, 0, 92}, 435 | -{"zbb", ISA_SPEC_CLASS_NONE, 0, 92}, 436 | -{"zbs", ISA_SPEC_CLASS_NONE, 0, 92}, 437 | -{"zba", ISA_SPEC_CLASS_NONE, 0, 92}, 438 | -{"zbp", ISA_SPEC_CLASS_NONE, 0, 92}, 439 | -{"zbe", ISA_SPEC_CLASS_NONE, 0, 92}, 440 | -{"zbf", ISA_SPEC_CLASS_NONE, 0, 92}, 441 | -{"zbc", ISA_SPEC_CLASS_NONE, 0, 92}, 442 | -{"zbr", ISA_SPEC_CLASS_NONE, 0, 92}, 443 | -{"zbm", ISA_SPEC_CLASS_NONE, 0, 92}, 444 | -{"zbt", ISA_SPEC_CLASS_NONE, 0, 92}, 445 | +{"b", ISA_SPEC_CLASS_NONE, 0, 93}, 446 | +{"zbb", ISA_SPEC_CLASS_NONE, 0, 93}, 447 | +{"zbs", ISA_SPEC_CLASS_NONE, 0, 93}, 448 | +{"zba", ISA_SPEC_CLASS_NONE, 0, 93}, 449 | +{"zbp", ISA_SPEC_CLASS_NONE, 0, 93}, 450 | +{"zbe", ISA_SPEC_CLASS_NONE, 0, 93}, 451 | +{"zbf", ISA_SPEC_CLASS_NONE, 0, 93}, 452 | +{"zbc", ISA_SPEC_CLASS_NONE, 0, 93}, 453 | +{"zbr", ISA_SPEC_CLASS_NONE, 0, 93}, 454 | +{"zbm", ISA_SPEC_CLASS_NONE, 0, 93}, 455 | +{"zbt", ISA_SPEC_CLASS_NONE, 0, 93}, 456 | 457 | /* Terminate the list. */ 458 | {NULL, 0, 0, 0} 459 | -------------------------------------------------------------------------------- /patches/lowrisc-toolchain-gcc-rv32imcb/gdb/11.1/001-glob-libc-config.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gnulib/import/glob.c b/gnulib/import/glob.c 2 | index 1bfcafb..9947f24 100644 3 | --- a/gnulib/import/glob.c 4 | +++ b/gnulib/import/glob.c 5 | @@ -21,7 +21,7 @@ 6 | optimizes away the pattern == NULL test below. */ 7 | # define _GL_ARG_NONNULL(params) 8 | 9 | -# include 10 | +# include 11 | 12 | #endif 13 | 14 | diff --git a/gnulib/import/libc-config.h b/gnulib/import/libc-config.h 15 | index e3571ee..44c3d0f 100644 16 | --- a/gnulib/import/libc-config.h 17 | +++ b/gnulib/import/libc-config.h 18 | @@ -189,3 +189,7 @@ 19 | #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 20 | #define compat_symbol(lib, local, symbol, version) extern int dummy 21 | #define versioned_symbol(lib, local, symbol, version) extern int dummy 22 | + 23 | +#ifndef __THROWNL 24 | +#define __THROWNL __THROW 25 | +#endif 26 | -------------------------------------------------------------------------------- /patches/lowrisc-toolchain-gcc-rv64imac/gdb/11.1/001-glob-libc-config.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gnulib/import/glob.c b/gnulib/import/glob.c 2 | index 1bfcafb..9947f24 100644 3 | --- a/gnulib/import/glob.c 4 | +++ b/gnulib/import/glob.c 5 | @@ -21,7 +21,7 @@ 6 | optimizes away the pattern == NULL test below. */ 7 | # define _GL_ARG_NONNULL(params) 8 | 9 | -# include 10 | +# include 11 | 12 | #endif 13 | 14 | diff --git a/gnulib/import/libc-config.h b/gnulib/import/libc-config.h 15 | index e3571ee..44c3d0f 100644 16 | --- a/gnulib/import/libc-config.h 17 | +++ b/gnulib/import/libc-config.h 18 | @@ -189,3 +189,7 @@ 19 | #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 20 | #define compat_symbol(lib, local, symbol, version) extern int dummy 21 | #define versioned_symbol(lib, local, symbol, version) extern int dummy 22 | + 23 | +#ifndef __THROWNL 24 | +#define __THROWNL __THROW 25 | +#endif 26 | -------------------------------------------------------------------------------- /prepare-host.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright lowRISC contributors. 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. 4 | # SPDX-License-Identifier: Apache-2.0 5 | 6 | set -e 7 | set -x 8 | 9 | # Repository for the `gh` GitHub CLI tool used for creating releases. 10 | dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo 11 | 12 | dnf install -y \ 13 | sudo \ 14 | gh \ 15 | git \ 16 | shadow-utils \ 17 | bison \ 18 | flex \ 19 | texinfo \ 20 | help2man \ 21 | gawk \ 22 | gettext \ 23 | curl \ 24 | xz \ 25 | ncurses-devel \ 26 | pixman-devel \ 27 | python36 \ 28 | zlib-devel \ 29 | zlib-static \ 30 | libffi-devel 31 | -------------------------------------------------------------------------------- /release_tag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Determine the release tag from Git based on the type of release being made. 4 | 5 | set -e 6 | set -x 7 | 8 | # git-describe --always almost does what we want, but we need to connect the 9 | # `RELEASE_TAG` variable contents to how this build was triggered, which we 10 | # will find out using `$GITHUB_REF_TYPE` (a GitHub Actions variable). 11 | # 12 | # Importantly, a few things are going on here: 13 | # - If we were triggered by a tag, we need to output exactly the tag name, 14 | # so that the artifacts are named correctly. If we cannot do this, the 15 | # build needs to fail rather than uploading artifacts to some other 16 | # random tag. 17 | # - If we were triggered by a branch build, we need to be more careful, as 18 | # tagged commits are also pushed to branches. Branch builds explicitly use 19 | # the longer format so that if the built commit matches a tag, the 20 | # `RELEASE_TAG` is not a tag name. 21 | if [[ "$GITHUB_REF_TYPE" == tag ]]; then 22 | echo "$GITHUB_REF_NAME" 23 | else 24 | # Branch Build: Always use '--' format. 25 | git describe --long 26 | fi 27 | -------------------------------------------------------------------------------- /sw-versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This documents the versions of any software checked out from git 4 | 5 | # crosstool-ng-1.26.0-rc1 6 | export CROSSTOOL_NG_URL=https://github.com/crosstool-ng/crosstool-ng.git 7 | export CROSSTOOL_NG_VERSION=5a09578b6798f426b62d97b2ece1ba5e7b82990b 8 | 9 | # v4.0.1 10 | export QEMU_VERSION=23967e5b2a6c6d04b8db766a8a149f3631a7b899 11 | 12 | # LLVM 16.0.2 plus: 13 | # - hardening patches 14 | # - unratified bitmanip extensions 15 | # - `.option arch` assembly directive 16 | # - single-byte code coverage 17 | export LLVM_URL=https://github.com/lowRISC/llvm-project.git 18 | export LLVM_BRANCH=ot-llvm-16-hardening 19 | export LLVM_VERSION=50254b2020b89264c88e635745a3808a1cdf9641 20 | --------------------------------------------------------------------------------