Compile integrated utils with clang and LTO

This commit is contained in:
Kron4ek 2023-09-27 13:39:13 +05:00 committed by GitHub
parent 7e0dd38074
commit ec9d261c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ script_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# Set to true to compile dwarfs instead of squashfuse # Set to true to compile dwarfs instead of squashfuse
build_dwarfs="${build_dwarfs:-false}" build_dwarfs="${build_dwarfs:-false}"
squashfuse_version="0.2.0" squashfuse_version="0.5.0"
bwrap_version="0.8.0" bwrap_version="0.8.0"
lz4_version="1.9.4" lz4_version="1.9.4"
zstd_version="1.5.5" zstd_version="1.5.5"
@ -24,10 +24,10 @@ unionfs_fuse_version="3.3"
busybox_version="1.36.1" busybox_version="1.36.1"
bash_version="5.2.15" bash_version="5.2.15"
export CC=gcc export CC=clang
export CXX=g++ export CXX=clang++
export CFLAGS="-O3" export CFLAGS="-O3 -flto"
export CXXFLAGS="${CFLAGS}" export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed" export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
@ -127,13 +127,6 @@ if ! ldd utils/squashfuse | grep -q libfuse.so.2; then
fi fi
if [ "${build_dwarfs}" = "true" ]; then if [ "${build_dwarfs}" = "true" ]; then
if command -v clang++ 1>/dev/null; then
export CC=clang
export CXX=clang++
export CFLAGS="${CFLAGS} -O3"
export CXXFLAGS="${CFLAGS}"
fi
git clone https://github.com/mhx/dwarfs.git --recursive git clone https://github.com/mhx/dwarfs.git --recursive
cd dwarfs || exit 1 cd dwarfs || exit 1