testing/wabt: Disable link-time optimization

Wabt compiles two static libraries: libwabt.a and libwasm-rt-impl.a.
When forced to compile with LTO, those libraries end up with LLVM
bytecode files with .o extension, causing linking to fail in a lot of
cases.

CMake lacks sufficient support for LTO to compile static libraries
correctly, so I think the best solution for now is to disable it.
This commit is contained in:
Alexey Yerin 2024-08-17 14:12:50 +03:00 committed by ptrcnull
parent 09ca23bc81
commit 1449b5b4b2

View File

@ -2,21 +2,14 @@
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me> # Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=wabt pkgname=wabt
pkgver=1.0.35 pkgver=1.0.35
pkgrel=0 pkgrel=1
_wasm_c_api="b6dd1fb658a282c64b029867845bc50ae59e1497" _wasm_c_api="b6dd1fb658a282c64b029867845bc50ae59e1497"
_picosha2="27fcf6979298949e8a462e16d09a0351c18fcaf2" _picosha2="27fcf6979298949e8a462e16d09a0351c18fcaf2"
pkgdesc="WebAssembly binary toolkit" pkgdesc="WebAssembly binary toolkit"
# s390x: lld arch="all"
# riscv64: llvm still has broken lto on riscv with floating abi errors
arch="all !s390x !riscv64"
url="https://github.com/WebAssembly/wabt" url="https://github.com/WebAssembly/wabt"
license="Apache-2.0" license="Apache-2.0"
makedepends=" makedepends="cmake samurai"
clang
cmake
lld
samurai
"
subpackages="$pkgname-doc" subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/WebAssembly/wabt/archive/$pkgver.tar.gz source="$pkgname-$pkgver.tar.gz::https://github.com/WebAssembly/wabt/archive/$pkgver.tar.gz
wasm-c-api-$_wasm_c_api.tar.gz::https://github.com/WebAssembly/wasm-c-api/archive/$_wasm_c_api.tar.gz wasm-c-api-$_wasm_c_api.tar.gz::https://github.com/WebAssembly/wasm-c-api/archive/$_wasm_c_api.tar.gz
@ -47,11 +40,8 @@ build() {
local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi fi
CC=clang \ CFLAGS="$CFLAGS -O2" \
CXX=clang++ \ CXXFLAGS="$CXXFLAGS -O2" \
CFLAGS="$CFLAGS -O2 -flto=thin" \
CXXFLAGS="$CXXFLAGS -O2 -flto=thin" \
LDFLAGS="$LDFLAGS -fuse-ld=lld" \
cmake -B build -G Ninja \ cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \ -DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \