Fix libvpx x86 build

This commit is contained in:
luvletter2333 2022-02-04 15:06:59 +08:00
parent 8d07f4d1ad
commit 672c7e8688
4 changed files with 31 additions and 7 deletions

View File

@ -25,10 +25,6 @@ else()
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,-exclude-libs,ALL -Wl,--gc-sections -Wl,--strip-all")
endif()
message("CFLAGS ${C_FLAGS}")
message("CXX_FLAGS ${CXX_FLAGS}")
if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a")
enable_language(ASM)
else()

View File

@ -26,8 +26,11 @@ function build_one {
export CPPFLAGS="${CFLAGS}"
export CXXFLAGS="${CFLAGS} -std=c++11"
export ASFLAGS="-D__ANDROID__"
export LDFLAGS="-L$${PLATFORM}/usr/lib"
export LDFLAGS="-L${PLATFORM}/usr/lib"
if [ "x86" = ${ARCH} ]; then
patch -p1 < ../patches/libvpx_x86_fix.patch
fi
echo "Cleaning..."
make clean || true
@ -60,6 +63,10 @@ function build_one {
--disable-webm-io
make -j$COMPILATION_PROC_COUNT install
if [ "x86" = ${ARCH} ]; then
patch -p1 -R < ../patches/libvpx_x86_fix.patch
fi
}
function setCurrentPlatform {
@ -115,6 +122,7 @@ function build {
for arg in "$@"; do
case "${arg}" in
x86_64)
ANDROID_API=21
ARCH=x86_64
ARCH_NAME=x86_64
PREBUILT_ARCH=x86_64
@ -128,6 +136,7 @@ function build {
build_one
;;
x86)
ANDROID_API=21
ARCH=x86
ARCH_NAME=i686
PREBUILT_ARCH=x86
@ -141,6 +150,7 @@ function build {
build_one
;;
arm64)
ANDROID_API=21
ARCH=arm64
ARCH_NAME=aarch64
PREBUILT_ARCH=aarch64
@ -154,6 +164,7 @@ function build {
build_one
;;
arm)
ANDROID_API=21
ARCH=arm
ARCH_NAME=arm
PREBUILT_ARCH=arm
@ -173,7 +184,7 @@ function build {
}
if (( $# == 0 )); then
build x86_64 x86 arm arm64
build x86 x86_64 arm arm64
else
build $@
fi

View File

@ -0,0 +1,17 @@
Index: vpx_dsp/add_noise.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vpx_dsp/add_noise.c b/vpx_dsp/add_noise.c
--- a/vpx_dsp/add_noise.c (revision 626ff35955c2c35b806b3e0ecf551a1a8611cdbf)
+++ b/vpx_dsp/add_noise.c (date 1643957537362)
@@ -18,6 +18,8 @@
#include "vpx_dsp/postproc.h"
#include "vpx_ports/mem.h"
+#define rand() ((int)lrand48())
+
void vpx_plane_add_noise_c(uint8_t *start, const int8_t *noise, int blackclamp,
int whiteclamp, int width, int height, int pitch) {
int i, j;

View File

@ -2,6 +2,6 @@
source "bin/init/env.sh"
bin/init/libs/libvpx.sh
bin/init/libs/ffmpeg.sh
bin/init/libs/boringssl.sh
bin/init/libs/libvpx.sh