From c210ca7518143c5c2d2c3b268602d2e0624a8214 Mon Sep 17 00:00:00 2001 From: psykose Date: Fri, 24 Jun 2022 01:54:10 +0000 Subject: [PATCH] nginx-current: enable lto --- nginx-current/APKBUILD | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nginx-current/APKBUILD b/nginx-current/APKBUILD index a09a006..446b3aa 100644 --- a/nginx-current/APKBUILD +++ b/nginx-current/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: psykose pkgname=nginx-current pkgver=1.23.0 -pkgrel=0 +pkgrel=1 pkgdesc="HTTP and reverse proxy server (current version)" url="https://www.nginx.org/" arch="all" @@ -9,10 +9,12 @@ license="BSD-2-Clause" depends="!nginx" makedepends=" brotli-dev + clang file-dev gd-dev libxml2-dev libxslt-dev + lld linux-headers openssl3-dev pcre2-dev @@ -37,6 +39,11 @@ source="https://nginx.org/download/nginx-$pkgver.tar.gz builddir="$srcdir/nginx-$pkgver" options="!check" # no time! +export CC=clang +export CFLAGS="$CFLAGS -flto" +# passed below +export LDFLAGS="$LDFLAGS -flto -fuse-ld=lld -Wl,--icf=all" + _modules_dir="usr/lib/nginx/modules" # Built-in dynamic modules @@ -95,7 +102,7 @@ build() { --group=$_grp_ngx \ --with-threads \ --with-file-aio \ - --with-ld-opt="-lmagic" \ + --with-ld-opt="-lmagic $LDFLAGS" \ \ --with-http_ssl_module \ --with-http_v2_module \