fix: adjust agressive optimization options

Sorry for my incompetence in C/C++

Credits: matrix @fox:matrix.org
This commit is contained in:
DarkCat09 2024-12-21 21:29:59 +04:00
parent d9b3be5c72
commit d956601ed1
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82
3 changed files with 13 additions and 2 deletions

View file

@ -20,8 +20,17 @@ clone () {
# optimizations # optimizations
set_cflags () { set_cflags () {
export \ export \
CFLAGS="-Ofast" CPPFLAGS="-Ofast" LDFLAGS="-Wl,-O3 -Wl,-S" \ CFLAGS="-std=gnu2x -Ofast -march=native" \
RUSTFLAGS="-C target-cpu=native" CPPFLAGS="-Ofast -march=native" \
LDFLAGS="-Wl,-O3" \
RUSTFLAGS="-C target-cpu=native -C panic=abort"
}
# in a separate fn because ring does not build with LTO
use_lto () {
export \
CFLAGS="$CFLAGS -flto=auto -fwhole-program" \
CPPFLAGS="$CPPFLAGS -flto=auto -fwhole-program"
} }
# make -j12 # make -j12

View file

@ -16,6 +16,7 @@ clone https://gitlab.isc.org/isc-projects/bind9.git bind9
cd bind9 cd bind9
trap 'cd ..' EXIT trap 'cd ..' EXIT
set_cflags set_cflags
use_lto
echo echo
echo '==> autoreconf -fi' echo '==> autoreconf -fi'

View file

@ -17,6 +17,7 @@ clone https://github.com/NLnetLabs/ldns.git ldns
cd ldns cd ldns
trap 'cd ..' EXIT trap 'cd ..' EXIT
set_cflags set_cflags
use_lto
echo echo
echo '==> libtoolize -ci' echo '==> libtoolize -ci'