remove libc, add patches

This commit is contained in:
2025-08-24 12:44:23 -05:00
parent e2366892ca
commit 49f9181f9d
3 changed files with 16 additions and 58 deletions

View File

@@ -41,7 +41,6 @@ set_compile_opts() {
) )
PKG_CONFIG_PATH="${LIBDIR}/pkgconfig" PKG_CONFIG_PATH="${LIBDIR}/pkgconfig"
export PKG_CONFIG_PATH export PKG_CONFIG_PATH
export PKG_CONFIG_DEBUG_SPEW=1
# add prefix include # add prefix include
C_FLAGS+=("-I${PREFIX}/include") C_FLAGS+=("-I${PREFIX}/include")
@@ -55,7 +54,10 @@ set_compile_opts() {
LTO_SWITCH='ON' LTO_SWITCH='ON'
LTO_FLAG='-flto' LTO_FLAG='-flto'
C_FLAGS+=("${LTO_FLAG}") C_FLAGS+=("${LTO_FLAG}")
CONFIGURE_FLAGS+=('--enable-lto') # https://trac.ffmpeg.org/ticket/11479
if ! is_darwin; then
CONFIGURE_FLAGS+=('--enable-lto')
fi
MESON_FLAGS+=("-Db_lto=true") MESON_FLAGS+=("-Db_lto=true")
RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1") RUSTFLAGS+=("-C lto=yes" "-C inline-threshold=1000" "-C codegen-units=1")
CARGO_BUILD_TYPE=release CARGO_BUILD_TYPE=release
@@ -177,17 +179,6 @@ set_compile_opts() {
get_build_conf() { get_build_conf() {
local getBuild="${1}" local getBuild="${1}"
local libcVer='X.X'
if test "${getBuild}" == 'libc' && has_cmd ldd; then
local srcTest="${TMP_DIR}/libc-ver"
echo '#include <gnu/libc-version.h>
#include <stdio.h>
#include <unistd.h>
int main() { puts(gnu_get_libc_version()); return 0; }' >"${srcTest}.c"
gcc "${srcTest}.c" -o "${srcTest}"
libcVer="$("${srcTest}")"
fi
# name version file-extension url dep1,dep2 # name version file-extension url dep1,dep2
# shellcheck disable=SC2016 # shellcheck disable=SC2016
local BUILDS_CONF=' local BUILDS_CONF='
@@ -203,8 +194,6 @@ libopus 1.5.2 tar.gz https://github.com/xiph/opus/releases/download
libdav1d 1.5.1 tar.xz http://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext} libdav1d 1.5.1 tar.xz http://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext}
cpuinfo latest git https://github.com/pytorch/cpuinfo/ cpuinfo latest git https://github.com/pytorch/cpuinfo/
' '
BUILDS_CONF+="libc ${libcVer} tar.xz"
BUILDS_CONF+=' https://ftpmirror.gnu.org/glibc/glibc-${ver}.${ext}'
local supported_builds=() local supported_builds=()
unset ver ext url deps extracted_dir unset ver ext url deps extracted_dir
@@ -326,6 +315,11 @@ do_build() {
get_build_conf "${build}" || return 1 get_build_conf "${build}" || return 1
echo_info "building ${build}" echo_info "building ${build}"
pushd "$extracted_dir" >/dev/null || return 1 pushd "$extracted_dir" >/dev/null || return 1
# check for any patches
for patch in "${PATCHES_DIR}/${build}"/*.patch; do
test -f "${patch}" || continue
patch -p1 -i "${patch}" || return 1
done
echo_if_fail build_"${build}" echo_if_fail build_"${build}"
retval=$? retval=$?
popd >/dev/null || return 1 popd >/dev/null || return 1
@@ -562,46 +556,6 @@ build_libvmaf() {
} }
### AUTOTOOLS ### ### AUTOTOOLS ###
# special function mainly for arm64 builds
# since most distros do not compile libc
# with -fPIC for some reason
build_libc() (
# only for arm64
test "${HOSTTYPE}" != "aarch64" && exit 0
# only for static builds
test "${STATIC}" == 'false' && exit 0
# only for glibc
has_cmd ldd || exit 0
# only build once
test -f "${LIBDIR}/libc.a" && exit 0
rm -rf build
mkdir build
cd build || exit 1
# manually set flags since these are
# not intended to be user-controlled
unset CFLAGS CXXFLAGS
export CFLAGS='-fPIC -O3 -U_FORTIFY_SOURCE'
export CXXFLAGS="${CFLAGS}"
libc_prefix="${PWD}/local-install"
libc_libdir="${libc_prefix}/lib"
./../configure \
--prefix="${libc_prefix}" \
--libdir="${libc_libdir}" \
--disable-werror || exit 1
make -j"${JOBS}" all || exit 1
# install only the -fPIC static libraries
for picLib in ./**_pic.a; do
echo_warn "${picLib}"
done
# exit 1
# cd "${libc_libdir}" || exit 1
# cp ./*.a "${LIBDIR}" || exit 1
exit 0
)
add_project_versioning_to_ffmpeg() { add_project_versioning_to_ffmpeg() {
local optFile local optFile
local fname='ffmpeg_opt.c' local fname='ffmpeg_opt.c'
@@ -653,8 +607,10 @@ build_ffmpeg() {
"${FFMPEG_EXTRA_FLAGS[@]}" \ "${FFMPEG_EXTRA_FLAGS[@]}" \
--pkg-config='pkg-config' \ --pkg-config='pkg-config' \
--pkg-config-flags="${PKG_CFG_FLAGS}" \ --pkg-config-flags="${PKG_CFG_FLAGS}" \
--cpu="${CPU}" --arch="${ARCH}" \ --arch="${ARCH}" \
--enable-gpl --enable-version3 \ --cpu="${CPU}" \
--enable-gpl \
--enable-version3 \
--enable-nonfree \ --enable-nonfree \
--disable-htmlpages \ --disable-htmlpages \
--disable-podpages \ --disable-podpages \

View File

@@ -14,7 +14,8 @@ DL_DIR="${IGN_DIR}/downloads"
BUILD_DIR="${IGN_DIR}/builds" BUILD_DIR="${IGN_DIR}/builds"
CCACHE_DIR="${IGN_DIR}/ccache" CCACHE_DIR="${IGN_DIR}/ccache"
DOCKER_DIR="${IGN_DIR}/docker" DOCKER_DIR="${IGN_DIR}/docker"
export REPO_DIR IGN_DIR TMP_DIR DL_DIR BUILD_DIR CCACHE_DIR DOCKER_DIR PATCHES_DIR="${IGN_DIR}/patches"
export REPO_DIR IGN_DIR TMP_DIR DL_DIR BUILD_DIR CCACHE_DIR DOCKER_DIR PATCHES_DIR
# function names, descriptions, completions # function names, descriptions, completions
unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION unset FB_FUNC_NAMES FB_FUNC_DESCS FB_FUNC_COMPLETION

View File

@@ -1,3 +1,4 @@
# https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2265
commit 5def505f7f193d890be61e869831378f212a07bd commit 5def505f7f193d890be61e869831378f212a07bd
Author: Salome Thirot <salome.thirot@arm.com> Author: Salome Thirot <salome.thirot@arm.com>
Date: Fri May 2 11:20:54 2025 +0100 Date: Fri May 2 11:20:54 2025 +0100