dsh-remote 0.8.49 → 0.8.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -0
- package/README.md +2 -0
- package/lib/client.js +11 -3
- package/lib/index.js +173 -27
- package/lib/sshconfig.js +256 -15
- package/node_modules/buildcheck/.eslintrc.js +5 -0
- package/node_modules/buildcheck/.github/workflows/ci.yml +88 -0
- package/node_modules/buildcheck/.github/workflows/lint.yml +27 -0
- package/node_modules/buildcheck/.npmignore +3 -0
- package/node_modules/buildcheck/LICENSE +19 -0
- package/node_modules/buildcheck/README.md +106 -0
- package/node_modules/buildcheck/deps/Find-VisualStudio.cs +250 -0
- package/node_modules/buildcheck/lib/findvs.js +361 -0
- package/node_modules/buildcheck/lib/index.js +738 -0
- package/node_modules/buildcheck/package.json +36 -0
- package/node_modules/buildcheck/test/test.js +8 -0
- package/node_modules/cpu-features/.eslintrc.js +5 -0
- package/node_modules/cpu-features/.github/workflows/ci.yml +74 -0
- package/node_modules/cpu-features/.github/workflows/lint.yml +27 -0
- package/node_modules/cpu-features/LICENSE +19 -0
- package/node_modules/cpu-features/README.md +59 -0
- package/node_modules/cpu-features/binding.gyp +16 -0
- package/node_modules/cpu-features/buildcheck.js +32 -0
- package/node_modules/cpu-features/deps/cpu_features/.clang-format +4 -0
- package/node_modules/cpu-features/deps/cpu_features/.dockerignore +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +5 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +22 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +26 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +43 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +25 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +24 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +29 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +28 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +27 -0
- package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +21 -0
- package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +329 -0
- package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +261 -0
- package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +23 -0
- package/node_modules/cpu-features/deps/cpu_features/LICENSE +230 -0
- package/node_modules/cpu-features/deps/cpu_features/README.md +272 -0
- package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +19 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +5 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +30 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +252 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +40 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +64 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +312 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +7 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +48 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +34 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +22 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +107 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +15 -0
- package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +105 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +54 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +384 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +259 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +121 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +74 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +149 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +72 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +108 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +288 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +40 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +37 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +39 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +240 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +49 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +110 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +70 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +60 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +4 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +205 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +320 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +12 -0
- package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +456 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +165 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +75 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +490 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +19 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +86 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +26 -0
- package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +22 -0
- package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +62 -0
- package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +169 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +88 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +82 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +138 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +212 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +93 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +163 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +111 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +120 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +2055 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +68 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +57 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +132 -0
- package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +192 -0
- package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +461 -0
- package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +114 -0
- package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +53 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +396 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +384 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +176 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +131 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +180 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +82 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +1729 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +103 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +61 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +52 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +31 -0
- package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +132 -0
- package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +202 -0
- package/node_modules/cpu-features/lib/index.js +5 -0
- package/node_modules/cpu-features/package.json +40 -0
- package/node_modules/cpu-features/src/binding.cc +151 -0
- package/node_modules/cpu-features/test/test.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e # Fail on error
|
|
4
|
+
set -u # Treat unset variables as an error and exit immediately
|
|
5
|
+
|
|
6
|
+
ACTION='\033[1;90m'
|
|
7
|
+
FINISHED='\033[1;96m'
|
|
8
|
+
NOCOLOR='\033[0m'
|
|
9
|
+
ERROR='\033[0;31m'
|
|
10
|
+
|
|
11
|
+
echo -e "${ACTION}Checking environnement${NOCOLOR}"
|
|
12
|
+
if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
|
|
13
|
+
then
|
|
14
|
+
echo -e "${ERROR}Invalid version number. Aborting. ${NOCOLOR}"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
declare -r VERSION=$1
|
|
19
|
+
declare -r GIT_TAG="v$1"
|
|
20
|
+
|
|
21
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
22
|
+
if [[ "${BRANCH}" != "main" ]]
|
|
23
|
+
then
|
|
24
|
+
echo -e "${ERROR}Not on main. Aborting. ${NOCOLOR}"
|
|
25
|
+
echo
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
git fetch
|
|
30
|
+
HEADHASH=$(git rev-parse HEAD)
|
|
31
|
+
UPSTREAMHASH=$(git rev-parse main@{upstream})
|
|
32
|
+
|
|
33
|
+
if [[ "${HEADHASH}" != "${UPSTREAMHASH}" ]]
|
|
34
|
+
then
|
|
35
|
+
echo -e "${ERROR}Not up to date with origin. Aborting.${NOCOLOR}"
|
|
36
|
+
echo
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
git update-index -q --refresh
|
|
41
|
+
if ! git diff-index --quiet HEAD --
|
|
42
|
+
then
|
|
43
|
+
echo -e "${ERROR}Branch has uncommited changes. Aborting.${NOCOLOR}"
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if [ ! -z "$(git ls-files --exclude-standard --others)" ]
|
|
48
|
+
then
|
|
49
|
+
echo -e "${ERROR}Branch has untracked files. Aborting.${NOCOLOR}"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
declare -r LATEST_GIT_TAG=$(git describe --tags --abbrev=0)
|
|
54
|
+
declare -r LATEST_VERSION=${LATEST_GIT_TAG#"v"}
|
|
55
|
+
|
|
56
|
+
if ! dpkg --compare-versions "${VERSION}" "gt" "${LATEST_VERSION}"
|
|
57
|
+
then
|
|
58
|
+
echo -e "${ERROR}Invalid version ${VERSION} <= ${LATEST_VERSION} (latest). Aborting.${NOCOLOR}"
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
echo -e "${ACTION}Modifying CMakeLists.txt${NOCOLOR}"
|
|
63
|
+
sed -i "s/CpuFeatures VERSION ${LATEST_VERSION}/CpuFeatures VERSION ${VERSION}/g" CMakeLists.txt
|
|
64
|
+
|
|
65
|
+
echo -e "${ACTION}Commit new revision${NOCOLOR}"
|
|
66
|
+
git add CMakeLists.txt
|
|
67
|
+
git commit -m"Release ${GIT_TAG}"
|
|
68
|
+
|
|
69
|
+
echo -e "${ACTION}Create new tag${NOCOLOR}"
|
|
70
|
+
git tag ${GIT_TAG}
|
|
71
|
+
|
|
72
|
+
echo -e "${FINISHED}Manual steps:${NOCOLOR}"
|
|
73
|
+
echo -e "${FINISHED} - Push the tag upstream 'git push origin ${GIT_TAG}'${NOCOLOR}"
|
|
74
|
+
echo -e "${FINISHED} - Create a new release https://github.com/google/cpu_features/releases/new${NOCOLOR}"
|
|
75
|
+
echo -e "${FINISHED} - Update the Release Notes 'gren release --override'${NOCOLOR}"
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -eo pipefail
|
|
3
|
+
|
|
4
|
+
function extract() {
|
|
5
|
+
echo "Extracting ${1}..."
|
|
6
|
+
case $1 in
|
|
7
|
+
*.tar.bz2) tar xjf "$1" ;;
|
|
8
|
+
*.tar.xz) tar xJf "$1" ;;
|
|
9
|
+
*.tar.gz) tar xzf "$1" ;;
|
|
10
|
+
*)
|
|
11
|
+
>&2 echo "don't know how to extract '$1'..."
|
|
12
|
+
exit 1
|
|
13
|
+
esac
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function unpack() {
|
|
17
|
+
mkdir -p "${ARCHIVE_DIR}"
|
|
18
|
+
cd "${ARCHIVE_DIR}" || exit 2
|
|
19
|
+
local -r URL=$1
|
|
20
|
+
local -r RELATIVE_DIR=$2
|
|
21
|
+
local -r DESTINATION="${ARCHIVE_DIR}/${RELATIVE_DIR}"
|
|
22
|
+
if [[ ! -d "${DESTINATION}" ]] ; then
|
|
23
|
+
echo "Downloading ${URL}..."
|
|
24
|
+
local -r ARCHIVE_NAME=$(basename "${URL}")
|
|
25
|
+
[[ -f "${ARCHIVE_NAME}" ]] || wget --no-verbose "${URL}"
|
|
26
|
+
extract "${ARCHIVE_NAME}"
|
|
27
|
+
rm -f "${ARCHIVE_NAME}"
|
|
28
|
+
fi
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function install_qemu() {
|
|
32
|
+
if [[ "${QEMU_ARCH}" == "DISABLED" ]]; then
|
|
33
|
+
>&2 echo 'QEMU is disabled !'
|
|
34
|
+
return 0
|
|
35
|
+
fi
|
|
36
|
+
local -r QEMU_VERSION=${QEMU_VERSION:=7.1.0}
|
|
37
|
+
local -r QEMU_TARGET=${QEMU_ARCH}-linux-user
|
|
38
|
+
|
|
39
|
+
if echo "${QEMU_VERSION} ${QEMU_TARGET}" | cmp --silent "${QEMU_INSTALL}/.build" -; then
|
|
40
|
+
echo "qemu ${QEMU_VERSION} up to date!"
|
|
41
|
+
return 0
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
echo "QEMU_VERSION: ${QEMU_VERSION}"
|
|
45
|
+
echo "QEMU_TARGET: ${QEMU_TARGET}"
|
|
46
|
+
|
|
47
|
+
rm -rf "${QEMU_INSTALL}"
|
|
48
|
+
|
|
49
|
+
# Checking for a tarball before downloading makes testing easier :-)
|
|
50
|
+
local -r QEMU_URL="http://wiki.qemu-project.org/download/qemu-${QEMU_VERSION}.tar.xz"
|
|
51
|
+
local -r QEMU_DIR="qemu-${QEMU_VERSION}"
|
|
52
|
+
unpack ${QEMU_URL} ${QEMU_DIR}
|
|
53
|
+
cd ${QEMU_DIR} || exit 2
|
|
54
|
+
|
|
55
|
+
# Qemu (meson based build) depends on: pkgconf, libglib2.0, python3, ninja
|
|
56
|
+
./configure \
|
|
57
|
+
--prefix="${QEMU_INSTALL}" \
|
|
58
|
+
--target-list="${QEMU_TARGET}" \
|
|
59
|
+
--audio-drv-list= \
|
|
60
|
+
--disable-brlapi \
|
|
61
|
+
--disable-curl \
|
|
62
|
+
--disable-curses \
|
|
63
|
+
--disable-docs \
|
|
64
|
+
--disable-gcrypt \
|
|
65
|
+
--disable-gnutls \
|
|
66
|
+
--disable-gtk \
|
|
67
|
+
--disable-libnfs \
|
|
68
|
+
--disable-libssh \
|
|
69
|
+
--disable-nettle \
|
|
70
|
+
--disable-opengl \
|
|
71
|
+
--disable-sdl \
|
|
72
|
+
--disable-virglrenderer \
|
|
73
|
+
--disable-vte
|
|
74
|
+
|
|
75
|
+
# wrapper on ninja
|
|
76
|
+
make -j8
|
|
77
|
+
make install
|
|
78
|
+
|
|
79
|
+
echo "$QEMU_VERSION $QEMU_TARGET" > "${QEMU_INSTALL}/.build"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function assert_defined(){
|
|
83
|
+
if [[ -z "${!1}" ]]; then
|
|
84
|
+
>&2 echo "Variable '${1}' must be defined"
|
|
85
|
+
exit 1
|
|
86
|
+
fi
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function clean_build() {
|
|
90
|
+
# Cleanup previous build
|
|
91
|
+
rm -rf "${BUILD_DIR}"
|
|
92
|
+
mkdir -p "${BUILD_DIR}"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function expand_linaro_config() {
|
|
96
|
+
#ref: https://releases.linaro.org/components/toolchain/binaries/
|
|
97
|
+
local -r LINARO_VERSION=7.5-2019.12
|
|
98
|
+
local -r LINARO_ROOT_URL=https://releases.linaro.org/components/toolchain/binaries/${LINARO_VERSION}
|
|
99
|
+
|
|
100
|
+
local -r GCC_VERSION=7.5.0-2019.12
|
|
101
|
+
local -r GCC_URL=${LINARO_ROOT_URL}/${TARGET}/gcc-linaro-${GCC_VERSION}-x86_64_${TARGET}.tar.xz
|
|
102
|
+
local -r GCC_RELATIVE_DIR="gcc-linaro-${GCC_VERSION}-x86_64_${TARGET}"
|
|
103
|
+
unpack "${GCC_URL}" "${GCC_RELATIVE_DIR}"
|
|
104
|
+
|
|
105
|
+
local -r SYSROOT_VERSION=2.25-2019.12
|
|
106
|
+
local -r SYSROOT_URL=${LINARO_ROOT_URL}/${TARGET}/sysroot-glibc-linaro-${SYSROOT_VERSION}-${TARGET}.tar.xz
|
|
107
|
+
local -r SYSROOT_RELATIVE_DIR=sysroot-glibc-linaro-${SYSROOT_VERSION}-${TARGET}
|
|
108
|
+
unpack "${SYSROOT_URL}" "${SYSROOT_RELATIVE_DIR}"
|
|
109
|
+
|
|
110
|
+
local -r SYSROOT_DIR=${ARCHIVE_DIR}/${SYSROOT_RELATIVE_DIR}
|
|
111
|
+
local -r STAGING_DIR=${ARCHIVE_DIR}/${SYSROOT_RELATIVE_DIR}-stage
|
|
112
|
+
local -r GCC_DIR=${ARCHIVE_DIR}/${GCC_RELATIVE_DIR}
|
|
113
|
+
|
|
114
|
+
# Write a Toolchain file
|
|
115
|
+
# note: This is manadatory to use a file in order to have the CMake variable
|
|
116
|
+
# 'CMAKE_CROSSCOMPILING' set to TRUE.
|
|
117
|
+
# ref: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux
|
|
118
|
+
cat >"$TOOLCHAIN_FILE" <<EOL
|
|
119
|
+
set(CMAKE_SYSTEM_NAME Linux)
|
|
120
|
+
set(CMAKE_SYSTEM_PROCESSOR ${TARGET})
|
|
121
|
+
|
|
122
|
+
set(CMAKE_SYSROOT ${SYSROOT_DIR})
|
|
123
|
+
set(CMAKE_STAGING_PREFIX ${STAGING_DIR})
|
|
124
|
+
|
|
125
|
+
set(tools ${GCC_DIR})
|
|
126
|
+
set(CMAKE_C_COMPILER \${tools}/bin/${TARGET}-gcc)
|
|
127
|
+
set(CMAKE_CXX_COMPILER \${tools}/bin/${TARGET}-g++)
|
|
128
|
+
|
|
129
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
130
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
131
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
132
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
133
|
+
EOL
|
|
134
|
+
CMAKE_ADDITIONAL_ARGS+=( -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" )
|
|
135
|
+
QEMU_ARGS+=( -L "${SYSROOT_DIR}" )
|
|
136
|
+
QEMU_ARGS+=( -E LD_LIBRARY_PATH=/lib )
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function expand_bootlin_config() {
|
|
140
|
+
# ref: https://toolchains.bootlin.com/
|
|
141
|
+
local -r GCC_DIR=${ARCHIVE_DIR}/${GCC_RELATIVE_DIR}
|
|
142
|
+
|
|
143
|
+
case "${TARGET}" in
|
|
144
|
+
"aarch64")
|
|
145
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2021.11-1.tar.bz2"
|
|
146
|
+
local -r GCC_PREFIX="aarch64"
|
|
147
|
+
;;
|
|
148
|
+
"aarch64be")
|
|
149
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64be/tarballs/aarch64be--glibc--stable-2021.11-1.tar.bz2"
|
|
150
|
+
local -r GCC_PREFIX="aarch64_be"
|
|
151
|
+
;;
|
|
152
|
+
"ppc64le")
|
|
153
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64le-power8/tarballs/powerpc64le-power8--glibc--stable-2021.11-1.tar.bz2"
|
|
154
|
+
local -r GCC_PREFIX="powerpc64le"
|
|
155
|
+
;;
|
|
156
|
+
"ppc64")
|
|
157
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64-power8/tarballs/powerpc64-power8--glibc--stable-2021.11-1.tar.bz2"
|
|
158
|
+
local -r GCC_PREFIX="powerpc64"
|
|
159
|
+
;;
|
|
160
|
+
"ppc")
|
|
161
|
+
#local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-e500mc/tarballs/powerpc-e500mc--glibc--stable-2021.11-1.tar.bz2"
|
|
162
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc-440fp/tarballs/powerpc-440fp--glibc--stable-2021.11-1.tar.bz2"
|
|
163
|
+
local -r GCC_PREFIX="powerpc"
|
|
164
|
+
;;
|
|
165
|
+
"riscv32")
|
|
166
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/riscv32-ilp32d/tarballs/riscv32-ilp32d--glibc--bleeding-edge-2022.08-1.tar.bz2"
|
|
167
|
+
local -r GCC_PREFIX="riscv32"
|
|
168
|
+
;;
|
|
169
|
+
"riscv64")
|
|
170
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--stable-2022.08-1.tar.bz2"
|
|
171
|
+
local -r GCC_PREFIX="riscv64"
|
|
172
|
+
;;
|
|
173
|
+
"s390x")
|
|
174
|
+
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/s390x-z13/tarballs/s390x-z13--glibc--stable-2022.08-1.tar.bz2"
|
|
175
|
+
local -r GCC_PREFIX="s390x"
|
|
176
|
+
;;
|
|
177
|
+
*)
|
|
178
|
+
>&2 echo 'unknown power platform'
|
|
179
|
+
exit 1 ;;
|
|
180
|
+
esac
|
|
181
|
+
|
|
182
|
+
local -r TOOLCHAIN_RELATIVE_DIR="${TARGET}"
|
|
183
|
+
unpack "${TOOLCHAIN_URL}" "${TOOLCHAIN_RELATIVE_DIR}"
|
|
184
|
+
local -r EXTRACT_DIR="${ARCHIVE_DIR}/$(basename ${TOOLCHAIN_URL%.tar.bz2})"
|
|
185
|
+
|
|
186
|
+
local -r TOOLCHAIN_DIR=${ARCHIVE_DIR}/${TOOLCHAIN_RELATIVE_DIR}
|
|
187
|
+
if [[ -d "${EXTRACT_DIR}" ]]; then
|
|
188
|
+
mv "${EXTRACT_DIR}" "${TOOLCHAIN_DIR}"
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
local -r SYSROOT_DIR="${TOOLCHAIN_DIR}/${GCC_PREFIX}-buildroot-linux-gnu/sysroot"
|
|
192
|
+
#local -r STAGING_DIR=${SYSROOT_DIR}-stage
|
|
193
|
+
|
|
194
|
+
# Write a Toolchain file
|
|
195
|
+
# note: This is manadatory to use a file in order to have the CMake variable
|
|
196
|
+
# 'CMAKE_CROSSCOMPILING' set to TRUE.
|
|
197
|
+
# ref: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux
|
|
198
|
+
cat >"${TOOLCHAIN_FILE}" <<EOL
|
|
199
|
+
set(CMAKE_SYSTEM_NAME Linux)
|
|
200
|
+
set(CMAKE_SYSTEM_PROCESSOR ${GCC_PREFIX})
|
|
201
|
+
|
|
202
|
+
set(CMAKE_SYSROOT ${SYSROOT_DIR})
|
|
203
|
+
#set(CMAKE_STAGING_PREFIX ${STAGING_DIR})
|
|
204
|
+
|
|
205
|
+
set(tools ${TOOLCHAIN_DIR})
|
|
206
|
+
|
|
207
|
+
set(CMAKE_C_COMPILER \${tools}/bin/${GCC_PREFIX}-linux-gcc)
|
|
208
|
+
set(CMAKE_C_FLAGS "${POWER_FLAGS}")
|
|
209
|
+
set(CMAKE_CXX_COMPILER \${tools}/bin/${GCC_PREFIX}-linux-g++)
|
|
210
|
+
set(CMAKE_CXX_FLAGS "${POWER_FLAGS} -L${SYSROOT_DIR}/lib")
|
|
211
|
+
|
|
212
|
+
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
|
|
213
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
214
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
215
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
216
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
217
|
+
EOL
|
|
218
|
+
|
|
219
|
+
CMAKE_ADDITIONAL_ARGS+=( -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" )
|
|
220
|
+
QEMU_ARGS+=( -L "${SYSROOT_DIR}" )
|
|
221
|
+
QEMU_ARGS+=( -E LD_PRELOAD="${SYSROOT_DIR}/usr/lib/libstdc++.so.6:${SYSROOT_DIR}/lib/libgcc_s.so.1" )
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function expand_codescape_config() {
|
|
225
|
+
# https://www.mips.com/develop/tools/codescape-mips-sdk/mips-toolchain-configurations/
|
|
226
|
+
# mips-mti: MIPS32R6 and MIPS64R6
|
|
227
|
+
# mips-img: MIPS32R2 and MIPS64R2
|
|
228
|
+
|
|
229
|
+
# ref: https://codescape.mips.com/components/toolchain/2020.06-01/downloads.html
|
|
230
|
+
local -r DATE=2020.06-01
|
|
231
|
+
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
|
|
232
|
+
local -r GCC_RELATIVE_DIR="mips-mti-linux-gnu/${DATE}"
|
|
233
|
+
|
|
234
|
+
# ref: https://codescape.mips.com/components/toolchain/2019.02-04/downloads.html
|
|
235
|
+
#local -r DATE=2019.02-04
|
|
236
|
+
#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
|
|
237
|
+
#local -r GCC_RELATIVE_DIR="mips-img-linux-gnu/${DATE}"
|
|
238
|
+
|
|
239
|
+
local -r GCC_URL=${CODESCAPE_URL}
|
|
240
|
+
unpack "${GCC_URL}" "${GCC_RELATIVE_DIR}"
|
|
241
|
+
|
|
242
|
+
local -r GCC_DIR=${ARCHIVE_DIR}/${GCC_RELATIVE_DIR}
|
|
243
|
+
local MIPS_FLAGS=""
|
|
244
|
+
local LIBC_DIR_SUFFIX=""
|
|
245
|
+
local FLAVOUR=""
|
|
246
|
+
case "${TARGET}" in
|
|
247
|
+
"mips32")
|
|
248
|
+
MIPS_FLAGS="-EB -mips32r6 -mabi=32"
|
|
249
|
+
FLAVOUR="mips-r6-hard"
|
|
250
|
+
#MIPS_FLAGS="-EB -mips32r2 -mabi=32"
|
|
251
|
+
#FLAVOUR="mips-r2-hard"
|
|
252
|
+
LIBC_DIR_SUFFIX="lib"
|
|
253
|
+
;;
|
|
254
|
+
"mips32el")
|
|
255
|
+
MIPS_FLAGS="-EL -mips32r6 -mabi=32"
|
|
256
|
+
FLAVOUR="mipsel-r6-hard"
|
|
257
|
+
#MIPS_FLAGS="-EL -mips32r2 -mabi=32"
|
|
258
|
+
#FLAVOUR="mipsel-r2-hard"
|
|
259
|
+
LIBC_DIR_SUFFIX="lib"
|
|
260
|
+
;;
|
|
261
|
+
"mips64")
|
|
262
|
+
MIPS_FLAGS="-EB -mips64r6 -mabi=64"
|
|
263
|
+
FLAVOUR="mips-r6-hard"
|
|
264
|
+
#MIPS_FLAGS="-EB -mips64r2 -mabi=64"
|
|
265
|
+
#FLAVOUR="mips-r2-hard"
|
|
266
|
+
LIBC_DIR_SUFFIX="lib64"
|
|
267
|
+
;;
|
|
268
|
+
"mips64el")
|
|
269
|
+
MIPS_FLAGS="-EL -mips64r6 -mabi=64"
|
|
270
|
+
FLAVOUR="mipsel-r6-hard"
|
|
271
|
+
#MIPS_FLAGS="-EL -mips64r2 -mabi=64"
|
|
272
|
+
#FLAVOUR="mipsel-r2-hard"
|
|
273
|
+
LIBC_DIR_SUFFIX="lib64"
|
|
274
|
+
;;
|
|
275
|
+
*)
|
|
276
|
+
>&2 echo 'unknown mips platform'
|
|
277
|
+
exit 1 ;;
|
|
278
|
+
esac
|
|
279
|
+
local -r SYSROOT_DIR=${GCC_DIR}/sysroot
|
|
280
|
+
local -r STAGING_DIR=${SYSROOT_DIR}-stage
|
|
281
|
+
|
|
282
|
+
# Write a Toolchain file
|
|
283
|
+
# note: This is manadatory to use a file in order to have the CMake variable
|
|
284
|
+
# 'CMAKE_CROSSCOMPILING' set to TRUE.
|
|
285
|
+
# ref: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux
|
|
286
|
+
cat >"${TOOLCHAIN_FILE}" <<EOL
|
|
287
|
+
set(CMAKE_SYSTEM_NAME Linux)
|
|
288
|
+
set(CMAKE_SYSTEM_PROCESSOR ${TARGET})
|
|
289
|
+
|
|
290
|
+
set(CMAKE_SYSROOT ${SYSROOT_DIR})
|
|
291
|
+
set(CMAKE_STAGING_PREFIX ${STAGING_DIR})
|
|
292
|
+
|
|
293
|
+
set(tools ${GCC_DIR})
|
|
294
|
+
|
|
295
|
+
# R6
|
|
296
|
+
set(CMAKE_C_COMPILER \${tools}/bin/mips-mti-linux-gnu-gcc)
|
|
297
|
+
set(CMAKE_C_FLAGS "${MIPS_FLAGS}")
|
|
298
|
+
set(CMAKE_CXX_COMPILER \${tools}/bin/mips-mti-linux-gnu-g++)
|
|
299
|
+
set(CMAKE_CXX_FLAGS "${MIPS_FLAGS} -L${SYSROOT_DIR}/usr/lib64")
|
|
300
|
+
|
|
301
|
+
# R2
|
|
302
|
+
#set(CMAKE_C_COMPILER \${tools}/bin/mips-img-linux-gnu-gcc)
|
|
303
|
+
#set(CMAKE_C_FLAGS "${MIPS_FLAGS}")
|
|
304
|
+
#set(CMAKE_CXX_COMPILER \${tools}/bin/mips-img-linux-gnu-g++)
|
|
305
|
+
#set(CMAKE_CXX_FLAGS "${MIPS_FLAGS}")
|
|
306
|
+
|
|
307
|
+
set(CMAKE_FIND_ROOT_PATH ${GCC_DIR})
|
|
308
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
309
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
310
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
311
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
312
|
+
EOL
|
|
313
|
+
|
|
314
|
+
CMAKE_ADDITIONAL_ARGS+=( -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" )
|
|
315
|
+
QEMU_ARGS+=( -L "${SYSROOT_DIR}/${FLAVOUR}" )
|
|
316
|
+
local -r LIBC_DIR=${GCC_DIR}/mips-mti-linux-gnu/lib/${FLAVOUR}/${LIBC_DIR_SUFFIX}
|
|
317
|
+
#local -r LIBC_DIR=${GCC_DIR}/mips-img-linux-gnu/lib/${FLAVOUR}/${LIBC_DIR_SUFFIX}
|
|
318
|
+
QEMU_ARGS+=( -E LD_PRELOAD="${LIBC_DIR}/libstdc++.so.6:${LIBC_DIR}/libgcc_s.so.1" )
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function build() {
|
|
322
|
+
cd "${PROJECT_DIR}" || exit 2
|
|
323
|
+
set -x
|
|
324
|
+
clean_build
|
|
325
|
+
cmake -S. -B"${BUILD_DIR}" "${CMAKE_DEFAULT_ARGS[@]}" "${CMAKE_ADDITIONAL_ARGS[@]}"
|
|
326
|
+
cmake --build "${BUILD_DIR}" --target all -j8 -v
|
|
327
|
+
set +x
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function run_test() {
|
|
331
|
+
assert_defined QEMU_ARCH
|
|
332
|
+
if [[ "${QEMU_ARCH}" == "DISABLED" ]]; then
|
|
333
|
+
>&2 echo "QEMU is disabled for ${TARGET}"
|
|
334
|
+
return
|
|
335
|
+
fi
|
|
336
|
+
install_qemu
|
|
337
|
+
RUN_CMD="${QEMU_INSTALL}/bin/qemu-${QEMU_ARCH} ${QEMU_ARGS[*]}"
|
|
338
|
+
|
|
339
|
+
cd "${BUILD_DIR}" || exit 2
|
|
340
|
+
declare -a TEST_BINARIES=()
|
|
341
|
+
TEST_BINARIES+=($(find "${BUILD_DIR}"/test -executable -type f))
|
|
342
|
+
TEST_BINARIES+=($(find "${BUILD_DIR}" -maxdepth 1 -executable -type f))
|
|
343
|
+
set -x
|
|
344
|
+
set -e
|
|
345
|
+
for test_binary in ${TEST_BINARIES[*]} ; do
|
|
346
|
+
${RUN_CMD} "${test_binary}"
|
|
347
|
+
done
|
|
348
|
+
set +e
|
|
349
|
+
set +x
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function usage() {
|
|
353
|
+
local -r NAME=$(basename "$0")
|
|
354
|
+
echo -e "$NAME - Build using a cross toolchain.
|
|
355
|
+
|
|
356
|
+
SYNOPSIS
|
|
357
|
+
\t$NAME [-h|--help] [toolchain|build|qemu|test|all]
|
|
358
|
+
|
|
359
|
+
DESCRIPTION
|
|
360
|
+
\tCross compile using a cross toolchain.
|
|
361
|
+
|
|
362
|
+
\tYou MUST define the following variables before running this script:
|
|
363
|
+
\t* TARGET:
|
|
364
|
+
\t\tx86_64
|
|
365
|
+
\t\taarch64 aarch64be (bootlin)
|
|
366
|
+
\t\taarch64-linux-gnu aarch64_be-linux-gnu (linaro)
|
|
367
|
+
\t\tarm-linux-gnueabihf armv8l-linux-gnueabihf arm-linux-gnueabi (linaro)
|
|
368
|
+
\t\tarmeb-linux-gnueabihf armeb-linux-gnueabi (linaro)
|
|
369
|
+
\t\tmips32 mips32el (codespace)
|
|
370
|
+
\t\tmips64 mips64el (codespace)
|
|
371
|
+
\t\tppc (bootlin)
|
|
372
|
+
\t\tppc64 ppc64le (bootlin)
|
|
373
|
+
\t\triscv32 riscv64 (bootlin)
|
|
374
|
+
\t\ts390x (bootlin)
|
|
375
|
+
|
|
376
|
+
OPTIONS
|
|
377
|
+
\t-h --help: show this help text
|
|
378
|
+
\ttoolchain: download, unpack toolchain and generate CMake toolchain file
|
|
379
|
+
\tbuild: toolchain + build the project using the toolchain file (note: remove previous build dir)
|
|
380
|
+
\tqemu: download, unpack and build qemu
|
|
381
|
+
\ttest: qemu + run all executable using qemu (note: don't build !)
|
|
382
|
+
\tall: build + test (default)
|
|
383
|
+
|
|
384
|
+
EXAMPLES
|
|
385
|
+
* Using export:
|
|
386
|
+
export TARGET=aarch64-linux-gnu
|
|
387
|
+
$0
|
|
388
|
+
|
|
389
|
+
* One-liner:
|
|
390
|
+
TARGET=aarch64-linux-gnu $0"
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
# Main
|
|
394
|
+
function main() {
|
|
395
|
+
case ${1} in
|
|
396
|
+
-h | --help)
|
|
397
|
+
usage; exit ;;
|
|
398
|
+
esac
|
|
399
|
+
|
|
400
|
+
assert_defined TARGET
|
|
401
|
+
|
|
402
|
+
declare -r PROJECT_DIR="$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)"
|
|
403
|
+
declare -r ARCHIVE_DIR="${PROJECT_DIR}/build_cross/archives"
|
|
404
|
+
declare -r BUILD_DIR="${PROJECT_DIR}/build_cross/${TARGET}"
|
|
405
|
+
declare -r TOOLCHAIN_FILE=${ARCHIVE_DIR}/toolchain_${TARGET}.cmake
|
|
406
|
+
|
|
407
|
+
echo "Target: '${TARGET}'"
|
|
408
|
+
|
|
409
|
+
echo "Project dir: '${PROJECT_DIR}'"
|
|
410
|
+
echo "Archive dir: '${ARCHIVE_DIR}'"
|
|
411
|
+
echo "Build dir: '${BUILD_DIR}'"
|
|
412
|
+
echo "toolchain file: '${TOOLCHAIN_FILE}'"
|
|
413
|
+
|
|
414
|
+
declare -a CMAKE_DEFAULT_ARGS=( -G ${CMAKE_GENERATOR:-"Ninja"} )
|
|
415
|
+
declare -a CMAKE_ADDITIONAL_ARGS=()
|
|
416
|
+
|
|
417
|
+
declare -a QEMU_ARGS=()
|
|
418
|
+
case ${TARGET} in
|
|
419
|
+
x86_64)
|
|
420
|
+
declare -r QEMU_ARCH=x86_64 ;;
|
|
421
|
+
arm-linux-gnueabihf | armv8l-linux-gnueabihf | arm-linux-gnueabi)
|
|
422
|
+
expand_linaro_config
|
|
423
|
+
declare -r QEMU_ARCH=arm ;;
|
|
424
|
+
armeb-linux-gnueabihf | armeb-linux-gnueabi)
|
|
425
|
+
expand_linaro_config
|
|
426
|
+
declare -r QEMU_ARCH=DISABLED ;;
|
|
427
|
+
aarch64-linux-gnu)
|
|
428
|
+
expand_linaro_config
|
|
429
|
+
declare -r QEMU_ARCH=aarch64 ;;
|
|
430
|
+
aarch64_be-linux-gnu)
|
|
431
|
+
expand_linaro_config
|
|
432
|
+
declare -r QEMU_ARCH=aarch64_be ;;
|
|
433
|
+
aarch64)
|
|
434
|
+
expand_bootlin_config
|
|
435
|
+
declare -r QEMU_ARCH=aarch64 ;;
|
|
436
|
+
aarch64be)
|
|
437
|
+
expand_bootlin_config
|
|
438
|
+
declare -r QEMU_ARCH=aarch64_be ;;
|
|
439
|
+
mips32)
|
|
440
|
+
expand_codescape_config
|
|
441
|
+
declare -r QEMU_ARCH=mips ;;
|
|
442
|
+
mips32el)
|
|
443
|
+
expand_codescape_config
|
|
444
|
+
declare -r QEMU_ARCH=mipsel ;;
|
|
445
|
+
mips64)
|
|
446
|
+
expand_codescape_config
|
|
447
|
+
declare -r QEMU_ARCH=mips64 ;;
|
|
448
|
+
mips64el)
|
|
449
|
+
expand_codescape_config
|
|
450
|
+
declare -r QEMU_ARCH=mips64el ;;
|
|
451
|
+
ppc64le)
|
|
452
|
+
expand_bootlin_config
|
|
453
|
+
declare -r QEMU_ARCH=ppc64le ;;
|
|
454
|
+
ppc64)
|
|
455
|
+
expand_bootlin_config
|
|
456
|
+
declare -r QEMU_ARCH=ppc64 ;;
|
|
457
|
+
ppc)
|
|
458
|
+
expand_bootlin_config
|
|
459
|
+
declare -r QEMU_ARCH=ppc ;;
|
|
460
|
+
riscv32)
|
|
461
|
+
expand_bootlin_config
|
|
462
|
+
declare -r QEMU_ARCH=riscv32 ;;
|
|
463
|
+
riscv64)
|
|
464
|
+
expand_bootlin_config
|
|
465
|
+
declare -r QEMU_ARCH=riscv64 ;;
|
|
466
|
+
s390x)
|
|
467
|
+
expand_bootlin_config
|
|
468
|
+
declare -r QEMU_ARCH=s390x ;;
|
|
469
|
+
*)
|
|
470
|
+
>&2 echo "Unknown TARGET '${TARGET}'..."
|
|
471
|
+
exit 1 ;;
|
|
472
|
+
esac
|
|
473
|
+
declare -r QEMU_INSTALL=${ARCHIVE_DIR}/qemu-${QEMU_ARCH}
|
|
474
|
+
|
|
475
|
+
case ${1} in
|
|
476
|
+
toolchain)
|
|
477
|
+
exit ;;
|
|
478
|
+
build)
|
|
479
|
+
build ;;
|
|
480
|
+
qemu)
|
|
481
|
+
install_qemu ;;
|
|
482
|
+
test)
|
|
483
|
+
run_test ;;
|
|
484
|
+
*)
|
|
485
|
+
build
|
|
486
|
+
run_test ;;
|
|
487
|
+
esac
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
main "${1:-all}"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Toolchains for little-endian, 64-bit ARMv8 for GNU/Linux systems
|
|
4
|
+
function set_aarch64-linux-gnu() {
|
|
5
|
+
export TARGET=aarch64-linux-gnu
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
# Toolchains for little-endian, hard-float, 32-bit ARMv7 (and earlier) for GNU/Linux systems
|
|
9
|
+
function set_arm-linux-gnueabihf() {
|
|
10
|
+
export TARGET=arm-linux-gnueabihf
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Toolchains for little-endian, 32-bit ARMv8 for GNU/Linux systems
|
|
14
|
+
function set_armv8l-linux-gnueabihf() {
|
|
15
|
+
export TARGET=armv8l-linux-gnueabihf
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# Toolchains for little-endian, soft-float, 32-bit ARMv7 (and earlier) for GNU/Linux systems
|
|
19
|
+
function set_arm-linux-gnueabi() {
|
|
20
|
+
export TARGET=arm-linux-gnueabi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Toolchains for big-endian, 64-bit ARMv8 for GNU/Linux systems
|
|
24
|
+
function set_aarch64_be-linux-gnu() {
|
|
25
|
+
export TARGET=aarch64_be-linux-gnu
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Toolchains for big-endian, hard-float, 32-bit ARMv7 (and earlier) for GNU/Linux systems
|
|
29
|
+
function set_armeb-linux-gnueabihf() {
|
|
30
|
+
export TARGET=armeb-linux-gnueabihf
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Toolchains for big-endian, soft-float, 32-bit ARMv7 (and earlier) for GNU/Linux systems
|
|
34
|
+
function set_armeb-linux-gnueabi() {
|
|
35
|
+
export TARGET=armeb-linux-gnueabi
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function set_mips32() {
|
|
39
|
+
export TARGET=mips32
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function set_mips32el() {
|
|
43
|
+
export TARGET=mips32el
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function set_mips64() {
|
|
47
|
+
export TARGET=mips64
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function set_mips64el() {
|
|
51
|
+
export TARGET=mips64el
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function set_x86_64() {
|
|
55
|
+
export TARGET=x86_64
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ENVIRONMENTS="
|
|
59
|
+
set_aarch64-linux-gnu
|
|
60
|
+
set_arm-linux-gnueabihf
|
|
61
|
+
set_armv8l-linux-gnueabihf
|
|
62
|
+
set_arm-linux-gnueabi
|
|
63
|
+
set_aarch64_be-linux-gnu
|
|
64
|
+
set_armeb-linux-gnueabihf
|
|
65
|
+
set_armeb-linux-gnueabi
|
|
66
|
+
set_mips32
|
|
67
|
+
set_mips32el
|
|
68
|
+
set_mips64
|
|
69
|
+
set_mips64el
|
|
70
|
+
set_x86_64
|
|
71
|
+
"
|
|
72
|
+
|
|
73
|
+
set -e
|
|
74
|
+
|
|
75
|
+
for SET_ENVIRONMENT in ${ENVIRONMENTS}; do
|
|
76
|
+
echo "testing ${SET_ENVIRONMENT}"
|
|
77
|
+
${SET_ENVIRONMENT}
|
|
78
|
+
./"$(dirname -- "$0")"/run_integration.sh
|
|
79
|
+
done
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2021 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
#include <stddef.h>
|
|
16
|
+
|
|
17
|
+
static void copy(char *__restrict dst, const char *src, size_t count) {
|
|
18
|
+
for (size_t i = 0; i < count; ++i) dst[i] = src[i];
|
|
19
|
+
}
|