Created
June 19, 2021 13:22
-
-
Save Trass3r/270d014a9f34a6be9b9d3bd7c9196eb2 to your computer and use it in GitHub Desktop.
build QEMU with LTO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list | |
apt update && apt build-dep -y qemu | |
apt install -y git clang lld | |
mkdir build && cd build | |
CC=clang CXX=clang++ CFLAGS="-O3 -march=skylake -flto=thin" CXXFLAGS="-O3 -march=skylake -flto=thin" LDFLAGS="-fuse-ld=lld -O3 -march=skylake -flto=thin" \ | |
../configure --prefix=$(pwd)/install --target-list=aarch64-linux-user --static --disable-system --enable-linux-user --enable-lto --disable-stack-protector --disable-pie | |
-gsplit-dwarf | |
--disable-strip | |
ninja qemu-aarch64 && chown -R 1000:1000 . | |
objcopy --only-keep-debug qemu-aarch64 qemu-aarch64.debug && strip -s qemu-aarch64 && objcopy --add-gnu-debuglink=qemu-aarch64.debug qemu-aarch64 | |
--extra-ldflags=-fuse-ld=lld | |
--extra-cflags="-O3 -march=skylake" --extra-cxxflags="-O3 -march=skylake" | |
--enable-avx2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment