From 61025818bb20a0e984c0fa9cc025dc4202ac2d26 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sat, 10 Jul 2021 01:57:11 -0500 Subject: [PATCH] Optimize binary size - Use the gcc "-s" option when compiling Libreswan. This reduces binary size by ~80%. --- extras/vpnupgrade.sh | 2 +- extras/vpnupgrade_amzn.sh | 2 +- extras/vpnupgrade_centos.sh | 2 +- vpnsetup.sh | 2 +- vpnsetup_amzn.sh | 2 +- vpnsetup_centos.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index e675fbc..e681812 100755 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -200,7 +200,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 [ "$SWAN_VER" = "4.1" ] && sed -i 's/ sysv )/ sysvinit )/' programs/setup/setup.in cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false EOF if [ "$SWAN_VER" = "3.32" ] || ! grep -qs 'VERSION_CODENAME=' /etc/os-release; then diff --git a/extras/vpnupgrade_amzn.sh b/extras/vpnupgrade_amzn.sh index 8c462db..5afebb4 100755 --- a/extras/vpnupgrade_amzn.sh +++ b/extras/vpnupgrade_amzn.sh @@ -174,7 +174,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 [ "$SWAN_VER" = "4.1" ] && sed -i 's/ sysv )/ sysvinit )/' programs/setup/setup.in cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false EOF echo "USE_DH2=true" >> Makefile.inc.local diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index d271d5d..80dc740 100755 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -206,7 +206,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 [ "$SWAN_VER" = "4.1" ] && sed -i 's/ sysv )/ sysvinit )/' programs/setup/setup.in cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false EOF echo "USE_DH2=true" >> Makefile.inc.local diff --git a/vpnsetup.sh b/vpnsetup.sh index b38807c..e79200e 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -220,7 +220,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false USE_DH2=true USE_NSS_KDF=false diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index 246f0e8..7988894 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -184,7 +184,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false USE_DH2=true USE_NSS_KDF=false diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 7b35e6f..43482a6 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -233,7 +233,7 @@ bigecho "Compiling and installing Libreswan, please wait..." cd "libreswan-$SWAN_VER" || exit 1 cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS=-w +WERROR_CFLAGS=-w -s USE_DNSSEC=false USE_DH2=true USE_NSS_KDF=false