From 5354a8dbc73ff839efe8e6f33f8d681ebd5793f6 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Sat, 8 Apr 2023 20:36:07 -0700 Subject: Remove modern lto to fix build errors. --- PKGBUILD | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 618d635..aef98a1 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -13,15 +13,17 @@ url="https://sourceforge.net/projects/lincity-ng.berlios/" license=('GPL' 'custom') depends=('sdl_mixer' 'sdl_ttf' 'sdl_image' 'physfs' 'libxml2' 'sdl_gfx' 'libgl') makedepends=('ftjam' 'mesa' 'glu') -options=('lto') +# # For some reason this breaks compiling. "error: C++ compiler cannot create executables" +# # But old-fashioned raw injection of -flto=auto via export doesn't. +#options=(lto) source=(https://sourceforge.net/projects/${pkgname}.berlios/files/${pkgname}-${pkgver}.tar.bz2) b2sums=('39992e6a2ef78e53eea1b0e347c968f6828089b5267e6d62dac7405ea91b182335431b1718ef9892b649b1437751959deb9fa407dfd899fd1dfca55145d059f2') build() { cd ${pkgname}-${pkgver} - export CFLAGS="$CFLAGS -O3 -fPIE" - export CXXFLAGS="$CXXFLAGS -O3 -fPIE" + export CFLAGS="$CFLAGS -O3 -fPIE -flto=auto" + export CXXFLAGS="$CXXFLAGS -O3 -fPIE -flto=auto" export LDFLAGS="$LDFLAGS,-pie" # Build fails due to -Werror=format-security @@ -39,8 +41,8 @@ package() { # FLAGS are set again here to ensure optimization and prevent build failure. # Madness. - export CFLAGS="$CFLAGS -O3 -fPIE" - export CXXFLAGS="$CXXFLAGS -O3 -fPIE" + export CFLAGS="$CFLAGS -O3 -fPIE -flto=auto" + export CXXFLAGS="$CXXFLAGS -O3 -fPIE -flto=auto" export LDFLAGS="$LDFLAGS,-pie" # Build fails due to -Werror=format-security -- cgit v1.2.1