FreeBSD Bugzilla – Attachment 194174 Details for
Bug 228586
fix multimedia/libvpx on powerpc64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
detect VSX on FreeBSD
libvpx.ppc.diff (text/plain), 3.12 KB, created by
Jan Beich
on 2018-06-11 18:55:29 UTC
(
hide
)
Description:
detect VSX on FreeBSD
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2018-06-11 18:55:29 UTC
Size:
3.12 KB
patch
obsolete
>Index: multimedia/libvpx/Makefile >=================================================================== >--- multimedia/libvpx/Makefile (revision 472189) >+++ multimedia/libvpx/Makefile (working copy) >@@ -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 >@@ -38,6 +38,10 @@ ALL_TARGET= # empty > OPTIONS_DEFINE= DEBUG MULTIRES POSTPROC RTCPU SHARED SIZE_LIMIT TEST THREADS > OPTIONS_DEFAULT=MULTIRES POSTPROC RTCPU SHARED SIZE_LIMIT THREADS > OPTIONS_EXCLUDE_aarch64=RTCPU >+# powerpc* uses hw.cpu_features instead of AT_HWCAP >+OPTIONS_EXCLUDE_powerpc= RTCPU >+OPTIONS_EXCLUDE_powerpc64= RTCPU >+OPTIONS_EXCLUDE_powerpcspe= RTCPU > OPTIONS_SUB= yes > > DEBUG_CONFIGURE_ON= --enable-debug >Index: multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c >=================================================================== >--- multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c (nonexistent) >+++ multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c (working copy) >@@ -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. > >Property changes on: multimedia/libvpx/files/patch-vpx__ports_ppc__cpudetect.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228586
:
193810
|
193813
|
193814
|
194172
|
194174
|
194175
|
194176