-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve CI (Aarch64, Power) #285
Changes from all commits
e432cad
d5230c4
b8d91dd
c40f7bb
580c23f
531faee
deb3dd9
55114e6
ab29f34
43aafe3
764f273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: POWER 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: [ | ||
[ppc], | ||
[ppc64], | ||
[ppc64le], | ||
] | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ function unpack() { | |
if [[ ! -d "${DESTINATION}" ]] ; then | ||
echo "Downloading ${URL}..." | ||
local -r ARCHIVE_NAME=$(basename "${URL}") | ||
test -f "${ARCHIVE_NAME}" || wget --no-verbose "${URL}" | ||
[[ -f "${ARCHIVE_NAME}" ]] || wget --no-verbose "${URL}" | ||
extract "${ARCHIVE_NAME}" | ||
rm -f "${ARCHIVE_NAME}" | ||
fi | ||
|
@@ -33,7 +33,7 @@ function install_qemu() { | |
>&2 echo 'QEMU is disabled !' | ||
return 0 | ||
fi | ||
local -r QEMU_VERSION=${QEMU_VERSION:=5.2.0} | ||
local -r QEMU_VERSION=${QEMU_VERSION:=7.1.0} | ||
local -r QEMU_TARGET=${QEMU_ARCH}-linux-user | ||
|
||
if echo "${QEMU_VERSION} ${QEMU_TARGET}" | cmp --silent "${QEMU_INSTALL}/.build" -; then | ||
|
@@ -70,11 +70,7 @@ function install_qemu() { | |
--disable-opengl \ | ||
--disable-sdl \ | ||
--disable-virglrenderer \ | ||
--disable-vte \ | ||
--enable-modules | ||
|
||
# --static Not supported on Archlinux | ||
# so we use --enable-modules | ||
--disable-vte | ||
|
||
# wrapper on ninja | ||
make -j8 | ||
|
@@ -145,6 +141,27 @@ function expand_bootlin_config() { | |
local -r GCC_DIR=${ARCHIVE_DIR}/${GCC_RELATIVE_DIR} | ||
|
||
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 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 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 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 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 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 GCC_PREFIX="s390x" | ||
|
@@ -197,15 +214,21 @@ QEMU_ARGS+=( -E LD_PRELOAD="${SYSROOT_DIR}/usr/lib/libstdc++.so.6:${SYSROOT_DIR} | |
} | ||
|
||
function expand_codescape_config() { | ||
# https://www.mips.com/develop/tools/codescape-mips-sdk/mips-toolchain-configurations/ | ||
# mips-mti: MIPS32R6 and MIPS64R6 | ||
# mips-img: MIPS32R2 and MIPS64R2 | ||
|
||
# ref: https://codescape.mips.com/components/toolchain/2020.06-01/downloads.html | ||
# ref: https://codescape.mips.com/components/toolchain/2019.02-04/downloads.html | ||
local -r DATE=2020.06-01 | ||
#local -r DATE=2019.02-04 | ||
local -r CODESCAPE_URL=https://codescape.mips.com/components/toolchain/${DATE}/Codescape.GNU.Tools.Package.${DATE}.for.MIPS.MTI.Linux.CentOS-6.x86_64.tar.gz | ||
#local -r CODESCAPE_URL=https://codescape.mips.com/components/toolchain/${DATE}/Codescape.GNU.Tools.Package.${DATE}.for.MIPS.IMG.Linux.CentOS-6.x86_64.tar.gz | ||
local -r GCC_URL=${CODESCAPE_URL} | ||
local -r GCC_RELATIVE_DIR="mips-mti-linux-gnu/${DATE}" | ||
|
||
# ref: https://codescape.mips.com/components/toolchain/2019.02-04/downloads.html | ||
#local -r DATE=2019.02-04 | ||
#local -r CODESCAPE_URL=https://codescape.mips.com/components/toolchain/${DATE}/Codescape.GNU.Tools.Package.${DATE}.for.MIPS.IMG.Linux.CentOS-6.x86_64.tar.gz | ||
#local -r GCC_RELATIVE_DIR="mips-img-linux-gnu/${DATE}" | ||
|
||
local -r GCC_URL=${CODESCAPE_URL} | ||
unpack "${GCC_URL}" "${GCC_RELATIVE_DIR}" | ||
|
||
local -r GCC_DIR=${ARCHIVE_DIR}/${GCC_RELATIVE_DIR} | ||
|
@@ -230,12 +253,14 @@ function expand_codescape_config() { | |
"mips64") | ||
MIPS_FLAGS="-EB -mips64r6 -mabi=64" | ||
FLAVOUR="mips-r6-hard" | ||
#MIPS_FLAGS="-EB -mips64r2 -mabi=64" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here and below, why do you need to keep these comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here maybe we could have a flag to decide which version to use so user can easily reuse this script to target the correct CPU by just changing one line, so while we only enable one flavor it's easy for the community to adapt. Or again we should/could have both |
||
#FLAVOUR="mips-r2-hard" | ||
LIBC_DIR_SUFFIX="lib64" | ||
;; | ||
"mips64el") | ||
MIPS_FLAGS="-EL -mips64r6 -mabi=64" | ||
FLAVOUR="mipsel-r6-hard" | ||
#MIPS_FLAGS="-EL -mips64r2 -mabi=64" | ||
#FLAVOUR="mipsel-r2-hard" | ||
LIBC_DIR_SUFFIX="lib64" | ||
;; | ||
|
@@ -259,13 +284,17 @@ set(CMAKE_STAGING_PREFIX ${STAGING_DIR}) | |
|
||
set(tools ${GCC_DIR}) | ||
|
||
# R6 | ||
set(CMAKE_C_COMPILER \${tools}/bin/mips-mti-linux-gnu-gcc) | ||
#set(CMAKE_C_COMPILER \${tools}/bin/mips-img-linux-gnu-gcc) | ||
set(CMAKE_C_FLAGS "${MIPS_FLAGS}") | ||
|
||
set(CMAKE_CXX_COMPILER \${tools}/bin/mips-mti-linux-gnu-g++) | ||
set(CMAKE_CXX_FLAGS "${MIPS_FLAGS} -L${SYSROOT_DIR}/usr/lib64") | ||
|
||
# R2 | ||
#set(CMAKE_C_COMPILER \${tools}/bin/mips-img-linux-gnu-gcc) | ||
#set(CMAKE_C_FLAGS "${MIPS_FLAGS}") | ||
#set(CMAKE_CXX_COMPILER \${tools}/bin/mips-img-linux-gnu-g++) | ||
set(CMAKE_CXX_FLAGS "${MIPS_FLAGS}") | ||
#set(CMAKE_CXX_FLAGS "${MIPS_FLAGS}") | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${GCC_DIR}) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
@@ -320,11 +349,14 @@ DESCRIPTION | |
\tYou MUST define the following variables before running this script: | ||
\t* TARGET: | ||
\t\tx86_64 | ||
\t\taarch64-linux-gnu aarch64_be-linux-gnu | ||
\t\tarm-linux-gnueabihf armv8l-linux-gnueabihf arm-linux-gnueabi | ||
\t\tarmeb-linux-gnueabihf armeb-linux-gnueabi | ||
\t\tmips32 mips32el | ||
\t\tmips64 mips64el | ||
\t\taarch64 aarch64be (bootlin) | ||
\t\taarch64-linux-gnu aarch64_be-linux-gnu (linaro) | ||
\t\tarm-linux-gnueabihf armv8l-linux-gnueabihf arm-linux-gnueabi (linaro) | ||
\t\tarmeb-linux-gnueabihf armeb-linux-gnueabi (linaro) | ||
\t\tmips32 mips32el (codespace) | ||
\t\tmips64 mips64el (codespace) | ||
\t\tppc (bootlin) | ||
\t\tppc64 ppc64le (bootlin) | ||
\t\ts390x (bootlin) | ||
|
||
OPTIONS | ||
|
@@ -383,7 +415,13 @@ function main() { | |
declare -r QEMU_ARCH=aarch64 ;; | ||
aarch64_be-linux-gnu) | ||
expand_linaro_config | ||
declare -r QEMU_ARCH=DISABLED ;; | ||
declare -r QEMU_ARCH=aarch64_be ;; | ||
aarch64) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=aarch64 ;; | ||
aarch64be) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=aarch64_be ;; | ||
mips32) | ||
expand_codescape_config | ||
declare -r QEMU_ARCH=mips ;; | ||
|
@@ -396,6 +434,15 @@ function main() { | |
mips64el) | ||
expand_codescape_config | ||
declare -r QEMU_ARCH=mips64el ;; | ||
ppc64le) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=ppc64le ;; | ||
ppc64) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=ppc64 ;; | ||
ppc) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=ppc ;; | ||
s390x) | ||
expand_bootlin_config | ||
declare -r QEMU_ARCH=s390x ;; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While QEmu provide a single
ppc
target (as well as docker), bootlin provide several flavors440fp
ande500mc
for PowerPC while here I arbitrarily the440fp
we could have choose the other one...An other way would be to have
ppc-e500mc
andppc-440fp
(andppc
alias ofppc-440fp
?)ref:
note: same issue with
ppc64[le]
:power8
,e5500
, 'e6500',le-power8
...