diff --git a/src/build.sh b/src/build.sh index 4824ea364d..a4ebaac262 100755 --- a/src/build.sh +++ b/src/build.sh @@ -34,6 +34,7 @@ fi flags="$flags"' is_clang=true linux_use_bundled_binutils=false + use_sysroot=false fatal_linker_warnings=false treat_warnings_as_errors=false @@ -62,6 +63,21 @@ if [ "$(uname)" = Linux ]; then ozone_auto_platforms=false ozone_platform="headless" ozone_platform_headless=true' + if [ ! "$target_sysroot" ]; then + eval "$EXTRA_FLAGS" + sysroot_type='' + case "$target_cpu" in + x64) sysroot_type=amd64;; + x86) sysroot_type=i386;; + arm64) sysroot_type=arm64;; + arm) sysroot_type=arm;; + mipsel) sysroot_type=mips;; + esac + if [ "$sysroot_type" ]; then + flags="$flags"' + target_sysroot="//out/sysroot-build/sid/sid_'"$sysroot_type"'_staging"' + fi + fi fi rm -rf "./$out" 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 a7530e7130..4fa58e8976 100755 --- a/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh +++ b/src/build/linux/sysroot_scripts/sysroot-creator-sid-naive.sh @@ -58,6 +58,9 @@ cp() { [ "${1##*/}" = libdbus-1-3-symbols ] && return /bin/cp "$@" } +tar() { + echo tar "$@" +} trap "cd $PWD; rm strip *-strip" EXIT diff --git a/src/get-clang.sh b/src/get-clang.sh index 5dbfb152e1..d5090f98a7 100755 --- a/src/get-clang.sh +++ b/src/get-clang.sh @@ -10,32 +10,17 @@ esac eval "$EXTRA_FLAGS" 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 - build_sysroot Amd64 case "$target_cpu" in - arm64) - build_sysroot ARM64 - ;; - arm) - build_sysroot I386 - build_sysroot ARM - ;; - x86) - build_sysroot I386 - ;; - mips64el) - build_sysroot Mips64el - ;; - mipsel) - build_sysroot I386 - build_sysroot Mips + x64) build_sysroot Amd64;; + x86) build_sysroot I386;; + arm64) build_sysroot ARM64;; + arm) build_sysroot ARM;; + mips64el) build_sysroot Mips64el;; + mipsel) build_sysroot Mips;; esac fi