fix lto for rust and lame_init_old

This commit is contained in:
2025-12-19 09:56:24 -06:00
parent ff7921c45d
commit fac5951fc9
2 changed files with 17 additions and 11 deletions

View File

@@ -115,12 +115,12 @@ ld.lld:ld:lld:ld"
realT="$(command -v "${realT}")" realT="$(command -v "${realT}")"
# add fuse-ld for the compiler # add fuse-ld for the compiler
local addFlag='' local addFlag='-v'
if line_contains "${realT}" clang; then addFlag="-fuse-ld=${USE_LD}"; fi if line_contains "${realT}" clang; then addFlag+=" -fuse-ld=${USE_LD}"; fi
# create generic tool version # create generic tool version
echo "#!/usr/bin/env bash echo "#!/usr/bin/env bash
echo \$@ > ${compilerDir}/${genericT}.\${RANDOM} echo \$@ > ${compilerDir}/${genericT}.last-command
exec \"${realT}\" ${addFlag} \"\$@\"" >"${compilerDir}/${genericT}" exec \"${realT}\" ${addFlag} \"\$@\"" >"${compilerDir}/${genericT}"
chmod +x "${compilerDir}/${genericT}" chmod +x "${compilerDir}/${genericT}"
echo_if_fail "${compilerDir}/${genericT}" --version || return 1 echo_if_fail "${compilerDir}/${genericT}" --version || return 1
@@ -156,6 +156,7 @@ exec \"${realT}\" ${addFlag} \"\$@\"" >"${compilerDir}/${genericT}"
) )
CARGO_CINSTALL_FLAGS=( CARGO_CINSTALL_FLAGS=(
"--release" "--release"
"--verbose"
"--prefix" "${PREFIX}" "--prefix" "${PREFIX}"
"--libdir" "${LIBDIR}" "--libdir" "${LIBDIR}"
) )
@@ -632,7 +633,8 @@ del_pkgconfig_gcc_s() {
### RUST ### ### RUST ###
meta_cargoc_build() { meta_cargoc_build() {
local destdir="${PWD}/fb-local-install" local destdir="${PWD}/fb-local-install"
cargo cinstall \ # let rust handle its own lto
CFLAGS="${CFLAGS//${LTO_FLAG}/}" cargo cinstall \
--destdir "${destdir}" \ --destdir "${destdir}" \
"${CARGO_CINSTALL_FLAGS[@]}" || return 1 "${CARGO_CINSTALL_FLAGS[@]}" || return 1
# cargo cinstall destdir prepends with entire prefix # cargo cinstall destdir prepends with entire prefix
@@ -915,13 +917,6 @@ build_libx264() {
} }
build_libmp3lame() { build_libmp3lame() {
# https://sourceforge.net/p/lame/mailman/message/36081038/
if is_darwin || is_android; then
remove_line \
'include/libmp3lame.sym' \
'lame_init_old' || return 1
fi
meta_configure_build \ meta_configure_build \
--enable-nasm \ --enable-nasm \
--disable-frontend || return 1 --disable-frontend || return 1

View File

@@ -0,0 +1,11 @@
# https://sourceforge.net/p/lame/mailman/message/36081038/
diff --git a/include/libmp3lame.sym b/include/libmp3lame.sym
index ff7d318..fd120f5 100644
--- a/include/libmp3lame.sym
+++ b/include/libmp3lame.sym
@@ -1,5 +1,4 @@
lame_init
-lame_init_old
lame_set_num_samples
lame_get_num_samples
lame_set_in_samplerate