blob: 4970cd4dc407053f5bd333242fd2a446c3e1acca [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2020 The Android KVM Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
source "$(dirname "${BASH_SOURCE[0]}")/../common.inc"
QEMU_VERSION="qemu-5.0.0"
OUT_DIR="$1"
TOOLCHAIN_DIR="$2"
CC="${TOOLCHAIN_DIR}/clang"
CXX="${TOOLCHAIN_DIR}/clang++"
OBJCC="${TOOLCHAIN_DIR}/clang"
mkdir -p "${OUT_DIR}"
cd "${OUT_DIR}"
rm -rf "${QEMU_VERSION}".tar.xz "${QEMU_VERSION}"
wget https://download.qemu.org/"${QEMU_VERSION}".tar.xz
tar xJf "${QEMU_VERSION}".tar.xz
cd "${QEMU_VERSION}"
./configure \
--cc="${CC}" \
--host-cc="${CC}" \
--cxx="${CXX}" \
--objcc="${OBJCC}" \
--static \
--target-list=aarch64-softmmu \
--disable-gtk \
--disable-vnc \
--disable-vhost-net \
--disable-vhost-vsock \
--disable-vhost-user \
--disable-vhost-scsi \
--disable-vhost-crypto \
--disable-libxml2 \
--disable-libusb \
--disable-tpm \
--disable-kvm \
--disable-qom-cast-debug \
--disable-guest-agent \
--disable-replication \
--disable-live-block-migration \
--disable-blobs
make -j`nproc`
strip aarch64-softmmu/qemu-system-aarch64
cp aarch64-softmmu/qemu-system-aarch64 ..