From 1c6691986b9105f8b2940d8fa45e9358d433d2be Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 28 Nov 2019 23:47:32 +0800 Subject: [PATCH] Support MIPS architectures lld doesn't work with readonly .eh_frame sections on MIPS, see https://reviews.llvm.org/D13104. --- .travis.yml | 24 +++++++++++++++++++ .../sysroot-creator-sid-naive.sh | 6 ++++- src/get-clang.sh | 6 +++++ tests/basic.sh | 2 ++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 80f21f2082..e427ca58ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,30 @@ matrix: os: linux dist: bionic env: EXTRA_FLAGS='target_cpu="arm"' + - name: "linux-mips64el" + os: linux + dist: bionic + env: EXTRA_FLAGS='target_cpu="mips64el" use_lld=false' + addons: + apt: + packages: + - ninja-build + - pkg-config + - libnss3-dev + - qemu-user + - binutils-mips64el-linux-gnuabi64 + - name: "linux-mipsel" + os: linux + dist: bionic + env: EXTRA_FLAGS='target_cpu="mipsel" mips_arch_variant="r2" use_lld=false' + addons: + apt: + packages: + - ninja-build + - pkg-config + - libnss3-dev + - qemu-user + - binutils-mipsel-linux-gnu - name: "osx" os: osx osx_image: xcode10.2 diff --git a/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh b/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh index 9d5a51fc6c..a7530e7130 100755 --- a/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh +++ b/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh @@ -45,16 +45,20 @@ DEBIAN_PACKAGES_ARM64=' libitm1 libubsan0 ' +DEBIAN_PACKAGES_MIPS64EL=' +' # Disables libdbus workarounds ln -sf /bin/true strip ln -sf /bin/true arm-linux-gnueabihf-strip +ln -sf /bin/true mipsel-linux-gnu-strip +ln -sf /bin/true mips64el-linux-gnuabi64-strip export PATH="$PWD:$PATH" cp() { [ "${1##*/}" = libdbus-1-3-symbols ] && return /bin/cp "$@" } -trap "cd $PWD; rm strip arm-linux-gnueabihf-strip" EXIT +trap "cd $PWD; rm strip *-strip" EXIT . "${SCRIPT_DIR}/sysroot-creator.sh" diff --git a/src/get-clang.sh b/src/get-clang.sh index 885c3a2e6f..5dbfb152e1 100755 --- a/src/get-clang.sh +++ b/src/get-clang.sh @@ -30,6 +30,12 @@ if [ "$ARCH" = Linux ]; then x86) build_sysroot I386 ;; + mips64el) + build_sysroot Mips64el + ;; + mipsel) + build_sysroot I386 + build_sysroot Mips esac fi diff --git a/tests/basic.sh b/tests/basic.sh index f27c51ea1e..26105f6cbe 100755 --- a/tests/basic.sh +++ b/tests/basic.sh @@ -8,6 +8,8 @@ if [ "$(uname)" = Linux ]; then arm64) naive="qemu-aarch64 -L src/build/linux/debian_sid_arm64-sysroot $naive";; arm) naive="qemu-arm -L src/build/linux/debian_sid_arm-sysroot $naive";; x86) naive="qemu-i386 -L src/build/linux/debian_sid_i386-sysroot $naive";; + mipsel) naive="qemu-mipsel -L src/build/linux/debian_sid_mips-sysroot $naive";; + mips64el) naive="qemu-mips64el -L src/build/linux/debian_sid_mips64el-sysroot $naive";; esac fi