From a28a12c56c1ef225a4c592cee5e7b9d293ab062d Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 31 Oct 2019 22:16:56 +0800 Subject: [PATCH] Fix arm builds --- .travis.yml | 4 ++-- src/build.sh | 1 - src/get-clang.sh | 31 ++++++++++++++++--------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09ea24415e..46df6dcdef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,11 @@ matrix: - name: "linux-arm64" os: linux dist: bionic - env: EXTRA_FLAGS='target_cpu="arm64" use_sysroot=true' + env: EXTRA_FLAGS='target_cpu="arm64"' - name: "linux-arm" os: linux dist: bionic - env: EXTRA_FLAGS='target_cpu="arm" use_sysroot=true' + env: EXTRA_FLAGS='target_cpu="arm"' - name: "osx" os: osx osx_image: xcode10.2 diff --git a/src/build.sh b/src/build.sh index 138fb82f6d..b2e786b667 100755 --- a/src/build.sh +++ b/src/build.sh @@ -37,7 +37,6 @@ flags="$flags"' fatal_linker_warnings=false treat_warnings_as_errors=false - use_sysroot=false fieldtrial_testing_like_official_build=true diff --git a/src/get-clang.sh b/src/get-clang.sh index 52f12c2c0a..6a0159e1e9 100755 --- a/src/get-clang.sh +++ b/src/get-clang.sh @@ -9,25 +9,26 @@ esac eval "$EXTRA_FLAGS" -if [ "$use_sysroot" = true ]; then - ln -sfn / ./build/linux/debian_sid_amd64-sysroot - sudo mount --bind /usr/lib/x86_64-linux-gnu/pkgconfig /usr/lib/pkgconfig +build_sysroot() { + local lower="$(echo "$1" | tr '[:upper:]' '[:lower:]')" + ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh "BuildSysroot$1" + rm -rf "./build/linux/debian_sid_$lower-sysroot" + mkdir "./build/linux/debian_sid_$lower-sysroot" + tar xf "./out/sysroot-build/sid/debian_sid_${lower}_sysroot.tar.xz" -C "./build/linux/debian_sid_$lower-sysroot" +} + +if [ "$ARCH" = Linux ]; then case "$target_cpu" in arm64) - rm -rf ./build/linux/debian_sid_arm64-sysroot - ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootARM64 - mkdir -p ./build/linux/debian_sid_arm64-sysroot - tar xf ./out/sysroot-build/sid/debian_sid_arm64_sysroot.tar.xz -C ./build/linux/debian_sid_arm64-sysroot + build_sysroot Amd64 + build_sysroot ARM64 ;; arm) - rm -rf ./build/linux/debian_sid_arm-sysroot - ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootARM - mkdir -p ./build/linux/debian_sid_arm-sysroot - tar xf ./out/sysroot-build/sid/debian_sid_arm_sysroot.tar.xz -C ./build/linux/debian_sid_arm-sysroot - rm -rf ./build/linux/debian_sid_i386-sysroot - ./build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh BuildSysrootI386 - mkdir -p ./build/linux/debian_sid_i386-sysroot - tar xf ./out/sysroot-build/sid/debian_sid_i386_sysroot.tar.xz -C ./build/linux/debian_sid_i386-sysroot + build_sysroot I386 + build_sysroot ARM + ;; + *) + build_sysroot Amd64 ;; esac fi