[vlc-devel] [PATCH] contrib: aom: fix lib pthread linkage
Victorien Le Couviour--Tuffet
victorien.lecouviour.tuffet at gmail.com
Mon Oct 15 08:08:44 CEST 2018
Fixes android NDK 17 build: the pthread library (as well as the math and
dynamic loading ones) are builtin parts of the standard C library for
android (Bionic), therefore linking against those generates linker error.
---
contrib/src/aom/aom-android-pthreads.patch | 19 +++++++++++++++++++
contrib/src/aom/rules.mak | 3 +++
2 files changed, 22 insertions(+)
create mode 100644 contrib/src/aom/aom-android-pthreads.patch
diff --git a/contrib/src/aom/aom-android-pthreads.patch b/contrib/src/aom/aom-android-pthreads.patch
new file mode 100644
index 0000000000..8b414772e6
--- /dev/null
+++ b/contrib/src/aom/aom-android-pthreads.patch
@@ -0,0 +1,19 @@
+diff --git a/build/cmake/pkg_config.cmake b/build/cmake/pkg_config.cmake
+index 64e2021..1cab2a3 100644
+--- a/build/cmake/pkg_config.cmake
++++ b/build/cmake/pkg_config.cmake
+@@ -47,12 +47,6 @@ file(APPEND "${pkgconfig_file}"
+ file(APPEND "${pkgconfig_file}" "Version: ${package_version}\n")
+ file(APPEND "${pkgconfig_file}" "Requires:\n")
+ file(APPEND "${pkgconfig_file}" "Conflicts:\n")
+-if(CONFIG_MULTITHREAD AND HAVE_PTHREAD_H)
+- file(APPEND "${pkgconfig_file}"
+- "Libs: -L\${prefix}/lib -l${pkg_name} -lm -lpthread\n")
+- file(APPEND "${pkgconfig_file}" "Libs.private: -lm -lpthread\n")
+-else()
+- file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} -lm\n")
+- file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+-endif()
++file(APPEND "${pkgconfig_file}" "Libs: -L\${prefix}/lib -l${pkg_name} -lm\n")
++file(APPEND "${pkgconfig_file}" "Libs.private: -lm\n")
+ file(APPEND "${pkgconfig_file}" "Cflags: -I\${prefix}/include\n")
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index bc0bca9e65..e704862ca5 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -22,6 +22,9 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
$(APPLY) $(SRC)/aom/0001-film-grain-copy-user_priv-from-the-source-img.patch
ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/aom/aom-pthreads-win32.patch
+endif
+ifdef HAVE_ANDROID
+ $(APPLY) $(SRC)/aom/aom-android-pthreads.patch
endif
$(MOVE)
--
2.19.1
More information about the vlc-devel
mailing list