Upgraded aom from 3.1.2 to 3.7.0

This commit is contained in:
dslm4515
2023-11-03 18:28:57 -05:00
parent 686b3831d4
commit f11a0cf0d0
2 changed files with 7 additions and 84 deletions

View File

@ -1,7 +1,7 @@
#! /bin/bash
# AOM
# Source: https://aomedia.googlesource.com/aom/+archive/v3.1.2.tar.gz
# Source: https://storage.googleapis.com/aom-releases/libaom-3.7.0.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
@ -13,7 +13,7 @@
#
# Source does not unpack into a directory
patch -Np1 -i ../patches/aom-alpine/fix-stack-size-e53da0b.patch
#patch -Np1 -i ../patches/aom-alpine/fix-stack-size-e53da0b.patch
case $(uname -m) in
arm*) export ECONF="-DENABLE_NEON=OFF" ;;
@ -22,9 +22,10 @@ mkdir BUILD && cd BUILD &&
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=None $ECONF \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" .. &&
-DENABLE_NASM=ON \
-DENABLE_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release $ECONF ..
read -p "Compile?" && make -j2 &&
unset ECONF &&
sudo -S make DESTDIR=$BUILD install &&
@ -52,5 +53,5 @@ aom:
aom:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/aom-3.1.2-$(uname -m)-mlfs.txz &&
sudo -S makepkg -l y -c n $PKGS/aom-3.7.0-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*

View File

@ -1,78 +0,0 @@
From e53da0b1bf2652896bed7b65929a1d8d0729d922 Mon Sep 17 00:00:00 2001
From: Wan-Teh Chang <wtc@google.com>
Date: Thu, 27 Aug 2020 20:49:03 -0700
Subject: [PATCH] Ensure thread stack size is at least 256 KB
BUG=aomedia:2754
Change-Id: Ia6e211f9b87bc2efe376e7b9f4adb11741850b18
---
diff --git a/aom_util/aom_thread.c b/aom_util/aom_thread.c
index a749a22..8411569 100644
--- a/aom_util/aom_thread.c
+++ b/aom_util/aom_thread.c
@@ -133,16 +133,39 @@
goto Error;
}
if (pthread_cond_init(&worker->impl_->condition_, NULL)) {
- pthread_mutex_destroy(&worker->impl_->mutex_);
- goto Error;
+ goto Error1;
}
+ pthread_attr_t *attr = NULL;
+#if HAVE_PTHREAD_H
+ pthread_attr_t thread_attributes;
+ attr = &thread_attributes;
+ if (pthread_attr_init(attr)) {
+ goto Error2;
+ }
+ size_t stack_size;
+ if (pthread_attr_getstacksize(attr, &stack_size)) {
+ pthread_attr_destroy(attr);
+ goto Error2;
+ }
+ const size_t kMinStackSize = 256 * 1024;
+ if (stack_size < kMinStackSize &&
+ pthread_attr_setstacksize(attr, kMinStackSize)) {
+ pthread_attr_destroy(attr);
+ goto Error2;
+ }
+#endif // HAVE_PTHREAD_H
pthread_mutex_lock(&worker->impl_->mutex_);
- ok = !pthread_create(&worker->impl_->thread_, NULL, thread_loop, worker);
+ ok = !pthread_create(&worker->impl_->thread_, attr, thread_loop, worker);
if (ok) worker->status_ = OK;
pthread_mutex_unlock(&worker->impl_->mutex_);
+#if HAVE_PTHREAD_H
+ pthread_attr_destroy(attr);
+#endif
if (!ok) {
- pthread_mutex_destroy(&worker->impl_->mutex_);
+ Error2:
pthread_cond_destroy(&worker->impl_->condition_);
+ Error1:
+ pthread_mutex_destroy(&worker->impl_->mutex_);
Error:
aom_free(worker->impl_);
worker->impl_ = NULL;
diff --git a/aom_util/aom_thread.h b/aom_util/aom_thread.h
index 8d04312..efbed78 100644
--- a/aom_util/aom_thread.h
+++ b/aom_util/aom_thread.h
@@ -32,6 +32,7 @@
#include <process.h> // NOLINT
#include <windows.h> // NOLINT
typedef HANDLE pthread_t;
+typedef int pthread_attr_t;
typedef CRITICAL_SECTION pthread_mutex_t;
#if _WIN32_WINNT < 0x0600
@@ -147,6 +148,7 @@
#include <sys/builtin.h> // NOLINT
#define pthread_t TID
+#define pthread_attr_t int
#define pthread_mutex_t HMTX
typedef struct {