From 7f66d2ea41abd92704c0173e94d7747b71244100 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 2 Nov 2022 17:55:05 +0100 Subject: [PATCH 1/5] script: rename few variables in expand_bootlin --- scripts/run_integration.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/run_integration.sh b/scripts/run_integration.sh index 9dbec05c..8376360d 100755 --- a/scripts/run_integration.sh +++ b/scripts/run_integration.sh @@ -142,28 +142,28 @@ function expand_bootlin_config() { case "${TARGET}" in "aarch64") - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2021.11-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="aarch64" ;; "aarch64be") - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64be/tarballs/aarch64be--glibc--stable-2021.11-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64be/tarballs/aarch64be--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="aarch64_be" ;; "ppc64le") - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64le-power8/tarballs/powerpc64le-power8--glibc--stable-2021.11-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64le-power8/tarballs/powerpc64le-power8--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="powerpc64le" ;; "ppc64") - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64-power8/tarballs/powerpc64-power8--glibc--stable-2021.11-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64-power8/tarballs/powerpc64-power8--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="powerpc64" ;; "ppc") - #local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-e500mc/tarballs/powerpc-e500mc--glibc--stable-2021.11-1.tar.bz2" - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-440fp/tarballs/powerpc-440fp--glibc--stable-2021.11-1.tar.bz2" + #local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-e500mc/tarballs/powerpc-e500mc--glibc--stable-2021.11-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-440fp/tarballs/powerpc-440fp--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="powerpc" ;; "s390x") - local -r POWER_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/s390x-z13/tarballs/s390x-z13--glibc--stable-2022.08-1.tar.bz2" + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/s390x-z13/tarballs/s390x-z13--glibc--stable-2022.08-1.tar.bz2" local -r GCC_PREFIX="s390x" ;; *) @@ -171,16 +171,16 @@ function expand_bootlin_config() { exit 1 ;; esac - local -r POWER_RELATIVE_DIR="${TARGET}" - unpack "${POWER_URL}" "${POWER_RELATIVE_DIR}" - local -r EXTRACT_DIR="${ARCHIVE_DIR}/$(basename ${POWER_URL%.tar.bz2})" + local -r TOOLCHAIN_RELATIVE_DIR="${TARGET}" + unpack "${TOOLCHAIN_URL}" "${TOOLCHAIN_RELATIVE_DIR}" + local -r EXTRACT_DIR="${ARCHIVE_DIR}/$(basename ${TOOLCHAIN_URL%.tar.bz2})" - local -r POWER_DIR=${ARCHIVE_DIR}/${POWER_RELATIVE_DIR} + local -r TOOLCHAIN_DIR=${ARCHIVE_DIR}/${TOOLCHAIN_RELATIVE_DIR} if [[ -d "${EXTRACT_DIR}" ]]; then - mv "${EXTRACT_DIR}" "${POWER_DIR}" + mv "${EXTRACT_DIR}" "${TOOLCHAIN_DIR}" fi - local -r SYSROOT_DIR="${POWER_DIR}/${GCC_PREFIX}-buildroot-linux-gnu/sysroot" + local -r SYSROOT_DIR="${TOOLCHAIN_DIR}/${GCC_PREFIX}-buildroot-linux-gnu/sysroot" #local -r STAGING_DIR=${SYSROOT_DIR}-stage # Write a Toolchain file @@ -194,14 +194,14 @@ set(CMAKE_SYSTEM_PROCESSOR ${GCC_PREFIX}) set(CMAKE_SYSROOT ${SYSROOT_DIR}) #set(CMAKE_STAGING_PREFIX ${STAGING_DIR}) -set(tools ${POWER_DIR}) +set(tools ${TOOLCHAIN_DIR}) set(CMAKE_C_COMPILER \${tools}/bin/${GCC_PREFIX}-linux-gcc) set(CMAKE_C_FLAGS "${POWER_FLAGS}") set(CMAKE_CXX_COMPILER \${tools}/bin/${GCC_PREFIX}-linux-g++) set(CMAKE_CXX_FLAGS "${POWER_FLAGS} -L${SYSROOT_DIR}/lib") -set(CMAKE_FIND_ROOT_PATH ${POWER_DIR}) +set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From 21c38a0099dd281ce61ecde87d35ca48f462fa9b Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 2 Nov 2022 17:55:25 +0100 Subject: [PATCH 2/5] script: Add riscv(32|64) support --- scripts/run_integration.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/run_integration.sh b/scripts/run_integration.sh index 8376360d..d076f6a2 100755 --- a/scripts/run_integration.sh +++ b/scripts/run_integration.sh @@ -162,6 +162,14 @@ function expand_bootlin_config() { local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-440fp/tarballs/powerpc-440fp--glibc--stable-2021.11-1.tar.bz2" local -r GCC_PREFIX="powerpc" ;; + "riscv32") + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/riscv32-ilp32d/tarballs/riscv32-ilp32d--glibc--bleeding-edge-2022.08-1.tar.bz2" + local -r GCC_PREFIX="riscv32" + ;; + "riscv64") + local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--stable-2022.08-1.tar.bz2" + local -r GCC_PREFIX="riscv64" + ;; "s390x") local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/s390x-z13/tarballs/s390x-z13--glibc--stable-2022.08-1.tar.bz2" local -r GCC_PREFIX="s390x" @@ -357,6 +365,7 @@ DESCRIPTION \t\tmips64 mips64el (codespace) \t\tppc (bootlin) \t\tppc64 ppc64le (bootlin) +\t\triscv32 riscv64 (bootlin) \t\ts390x (bootlin) OPTIONS @@ -443,6 +452,12 @@ function main() { ppc) expand_bootlin_config declare -r QEMU_ARCH=ppc ;; + riscv32) + expand_bootlin_config + declare -r QEMU_ARCH=riscv32 ;; + riscv64) + expand_bootlin_config + declare -r QEMU_ARCH=riscv64 ;; s390x) expand_bootlin_config declare -r QEMU_ARCH=s390x ;; From 7dba44dfef675fe7745e0ed75fb444a4a674aed1 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 2 Nov 2022 17:55:39 +0100 Subject: [PATCH 3/5] cmake(ci): Add riscv support --- cmake/ci/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/ci/Makefile b/cmake/ci/Makefile index 3ec93cd4..f655fc35 100644 --- a/cmake/ci/Makefile +++ b/cmake/ci/Makefile @@ -55,6 +55,8 @@ help: @echo -e "\t\t${BOLD}ppc${RESET} (bootlin toolchain)" @echo -e "\t\t${BOLD}ppc64${RESET} (bootlin toolchain)" @echo -e "\t\t${BOLD}ppc64le${RESET} (bootlin toolchain)" + @echo -e "\t\t${BOLD}riscv32${RESET} (bootlin toolchain)" + @echo -e "\t\t${BOLD}riscv64${RESET} (bootlin toolchain)" @echo -e "\t\t${BOLD}s390x${RESET} (bootlin toolchain)" @echo @echo -e "\tWith ${BOLD}${RESET}:" @@ -154,6 +156,7 @@ TOOLCHAIN_TARGETS = \ aarch64-linux-gnu aarch64_be-linux-gnu \ mips32 mips32el mips64 mips64el \ ppc ppc64 ppc64le \ + riscv32 riscv64 \ s390x TOOLCHAIN_STAGES = env devel build test define toolchain-stage-target = From 788983581eef05e47d60a5ff76a7911900e3c516 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 2 Nov 2022 17:55:57 +0100 Subject: [PATCH 4/5] ci: add riscv workflows --- .github/workflows/riscv_linux_cmake.yml | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/riscv_linux_cmake.yml diff --git a/.github/workflows/riscv_linux_cmake.yml b/.github/workflows/riscv_linux_cmake.yml new file mode 100644 index 00000000..ef7586ab --- /dev/null +++ b/.github/workflows/riscv_linux_cmake.yml @@ -0,0 +1,28 @@ +name: RISCV Linux CMake + +on: + push: + pull_request: + schedule: + # min hours day(month) month day(week) + - cron: '0 0 7,22 * *' + +jobs: + # Building using the github runner environement directly. + make: + runs-on: ubuntu-latest + strategy: + matrix: + targets: [ + [riscv32], + [riscv64], + ] + fail-fast: false + env: + TARGET: ${{ matrix.targets[0] }} + steps: + - uses: actions/checkout@v2 + - name: Build + run: make --directory=cmake/ci ${TARGET}_build + - name: Test + run: make --directory=cmake/ci ${TARGET}_test From 63151685c53a731a5df0da0b2bddcfeaa4f683a3 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 2 Nov 2022 17:56:24 +0100 Subject: [PATCH 5/5] Readme: add riscv badge --- scripts/generate_badges.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/generate_badges.d b/scripts/generate_badges.d index 2e357a52..1cb81593 100644 --- a/scripts/generate_badges.d +++ b/scripts/generate_badges.d @@ -18,8 +18,9 @@ enum Cpu AArch64, ARM, MIPS, - s390x, POWER, + RISCV, + s390x, } enum Os