aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2018-06-13 13:27:53 +0000
committerJan Beich <jbeich@FreeBSD.org>2018-06-13 13:27:53 +0000
commit364ffd22f9df7c30c383e9301ffc7244df77c158 (patch)
treea3616d690f048455454721de3d9e2ff86f328b72
parentfac87fa00e85df03ad90b7041534f3dd7c36a10f (diff)
downloadports-364ffd22f9df7c30c383e9301ffc7244df77c158.tar.gz
ports-364ffd22f9df7c30c383e9301ffc7244df77c158.zip
MFH: r472311
multimedia/libvpx: unbreak on powerpc* - newer libstdc++ ABI is required by many consumers - -mspe and -maltivec are mutually exclusive - implement VSX detection for powerpc and powerpc64 PR: 228586 Submitted by: jhibbits (based on) Approved by: ports-secteam blanket
Notes
Notes: svn path=/branches/2018Q2/; revision=472322
-rw-r--r--multimedia/libvpx/Makefile3
-rw-r--r--multimedia/libvpx/files/patch-libs.mk11
-rw-r--r--multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c66
3 files changed, 68 insertions, 12 deletions
diff --git a/multimedia/libvpx/Makefile b/multimedia/libvpx/Makefile
index 8477862eb91f..0ee77611f9b9 100644
--- a/multimedia/libvpx/Makefile
+++ b/multimedia/libvpx/Makefile
@@ -17,7 +17,7 @@ BUILD_DEPENDS= nasm:devel/nasm
USE_GITHUB= yes
GH_ACCOUNT= webmproject
-USES= cpe gmake perl5 shebangfix
+USES= compiler:c++11-lib cpe gmake perl5 shebangfix
CPE_VENDOR= john_koleszar
HAS_CONFIGURE= yes
USE_PERL5= build
@@ -50,6 +50,7 @@ ASFLAGS+= ${ASFLAGS_armv7}
OPTIONS_DEFINE= DEBUG MULTIRES POSTPROC RTCPU SHARED SIZE_LIMIT TEST THREADS
OPTIONS_DEFAULT=MULTIRES POSTPROC RTCPU SHARED SIZE_LIMIT THREADS
OPTIONS_EXCLUDE_aarch64=RTCPU
+OPTIONS_EXCLUDE_powerpcspe=RTCPU
OPTIONS_SUB= yes
DEBUG_CONFIGURE_ON= --enable-debug
diff --git a/multimedia/libvpx/files/patch-libs.mk b/multimedia/libvpx/files/patch-libs.mk
index 4017b4b06bbb..5a1cfab21b74 100644
--- a/multimedia/libvpx/files/patch-libs.mk
+++ b/multimedia/libvpx/files/patch-libs.mk
@@ -1,16 +1,5 @@
--- libs.mk.orig 2017-01-12 20:27:27 UTC
+++ libs.mk
-@@ -117,8 +117,8 @@ endif
- $(BUILD_PFX)third_party/googletest/%.cc.o: CXXFLAGS += -Wno-missing-field-initializers
- # Suppress -Wextra warnings in first party code pending investigation.
- # https://bugs.chromium.org/p/webm/issues/detail?id=1069
--$(BUILD_PFX)vp8/encoder/onyx_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
--$(BUILD_PFX)vp8/decoder/onyxd_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
-+$(BUILD_PFX)vp8/encoder/onyx_if.c.o: CFLAGS += -Wno-extra
-+$(BUILD_PFX)vp8/decoder/onyxd_if.c.o: CFLAGS += -Wno-extra
-
- ifeq ($(CONFIG_MSVS),yes)
- CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
@@ -339,8 +339,8 @@ else
$(qexec)echo 'Libs.private: -lm' >> $@
endif
diff --git a/multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c b/multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c
new file mode 100644
index 000000000000..6a1f6a956816
--- /dev/null
+++ b/multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c
@@ -0,0 +1,66 @@
+--- vpx_ports/ppc_cpudetect.c.orig 2018-01-24 22:25:44 UTC
++++ vpx_ports/ppc_cpudetect.c
+@@ -8,12 +8,6 @@
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+-#include <fcntl.h>
+-#include <unistd.h>
+-#include <stdint.h>
+-#include <asm/cputable.h>
+-#include <linux/auxvec.h>
+-
+ #include "./vpx_config.h"
+ #include "vpx_ports/ppc.h"
+
+@@ -35,6 +29,13 @@ static int cpu_env_mask(void) {
+ return env && *env ? (int)strtol(env, NULL, 0) : ~0;
+ }
+
++#if defined(__linux__)
++#include <fcntl.h>
++#include <unistd.h>
++#include <stdint.h>
++#include <asm/cputable.h>
++#include <linux/auxvec.h>
++
+ int ppc_simd_caps(void) {
+ int flags;
+ int mask;
+@@ -73,6 +74,36 @@ out_close:
+ close(fd);
+ return flags & mask;
+ }
++#elif defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++
++int ppc_simd_caps(void) {
++ int flags;
++ int mask;
++ u_long cpu_features = 0;
++ size_t sz = sizeof(cpu_features);
++
++ // If VPX_SIMD_CAPS is set then allow only those capabilities.
++ if (!cpu_env_flags(&flags)) {
++ return flags;
++ }
++
++ mask = cpu_env_mask();
++
++ sysctlbyname("hw.cpu_features", &cpu_features, &sz, NULL, 0);
++#if HAVE_VSX
++ if (cpu_features & PPC_FEATURE_HAS_VSX) flags |= HAS_VSX;
++#endif
++
++ return flags & mask;
++}
++#else
++#error \
++ "--enable-runtime-cpu-detect selected, but no CPU detection method " \
++"available for your platform. Reconfigure with --disable-runtime-cpu-detect."
++#endif /* end __linux__ */
+ #else
+ // If there is no RTCD the function pointers are not used and can not be
+ // changed.