fix: adjust agressive optimization options
Sorry for my incompetence in C/C++ Credits: matrix @fox:matrix.org
This commit is contained in:
parent
d9b3be5c72
commit
d956601ed1
3 changed files with 13 additions and 2 deletions
13
.build.sh
13
.build.sh
|
@ -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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Add table
Reference in a new issue