tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: x265 fails on non-amd64



On Tue, Nov 13, 2018 at 09:48:23PM +0000, John Klos wrote:
> On ARM, PowerPC, m68k, et cetera:
> 
> [ 96%] Building CXX object CMakeFiles/cli.dir/output/yuv.cpp.o
> [ 98%] Building CXX object CMakeFiles/cli.dir/x265.cpp.o
> [100%] Linking CXX executable x265
> libx265.so.165: undefined reference to `x265::detect512()'
> 
> Quick fix, or PR?

Maybe someone will want enable512 with hidden visibility but

? work
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/x265/distinfo,v
retrieving revision 1.26
diff -u -r1.26 distinfo
--- distinfo	6 Oct 2018 12:12:48 -0000	1.26
+++ distinfo	14 Nov 2018 03:30:10 -0000
@@ -5,4 +5,7 @@
 SHA512 (x265_2.9.tar.gz) = 270818c7fd84947fde371e32bef225c1880cfb0bcd95378d95b51f50577a134d7cd585fcdfa43b103a24d76c5ad826b09509a07eb9e208e8f2b56f2f77365cf3
 Size (x265_2.9.tar.gz) = 1385848 bytes
 SHA1 (patch-CMakeLists.txt) = fbf4d08133a48b342a060f1b45bab0253455a1b1
+SHA1 (patch-common_cpu.cpp) = 78ca000d57dba65bd0bf6d6c4d3bd878ae3387e7
+SHA1 (patch-common_cpu.h) = 33e3bb9bc9cb60735aa09efa185c474ebd3e6af5
+SHA1 (patch-common_quant.cpp) = 8cbaf6f00c1799ffaa503ffa372f05b76e97ae3b
 SHA1 (patch-encoder_encoder.cpp) = 907db18c8e9afd51684ed886da70c23ac3d3652a
Index: patches/patch-common_cpu.cpp
===================================================================
RCS file: patches/patch-common_cpu.cpp
diff -N patches/patch-common_cpu.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-common_cpu.cpp	14 Nov 2018 03:30:10 -0000
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Retire detect512, make enable512 a global.
+
+--- common/cpu.cpp.orig	2018-10-05 12:14:40.000000000 +0000
++++ common/cpu.cpp
+@@ -58,7 +58,7 @@ static void sigill_handler(int sig)
+ #endif // if X265_ARCH_ARM
+ 
+ namespace X265_NS {
+-static bool enable512 = false;
++bool enable512 = false;
+ const cpu_name_t cpu_names[] =
+ {
+ #if X265_ARCH_X86
+@@ -123,10 +123,6 @@ uint64_t PFX(cpu_xgetbv)(int xcr);
+ #pragma warning(disable: 4309) // truncation of constant value
+ #endif
+ 
+-bool detect512()
+-{
+-    return(enable512);
+-}
+ uint32_t cpu_detect(bool benableavx512 )
+ {
+ 
Index: patches/patch-common_cpu.h
===================================================================
RCS file: patches/patch-common_cpu.h
diff -N patches/patch-common_cpu.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-common_cpu.h	14 Nov 2018 03:30:10 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Retire detect512, use enable512 as a global
+
+--- common/cpu.h.orig	2018-10-05 12:14:40.000000000 +0000
++++ common/cpu.h
+@@ -50,7 +50,7 @@ extern "C" void PFX(safe_intel_cpu_indic
+ 
+ namespace X265_NS {
+ uint32_t cpu_detect(bool);
+-bool detect512();
++extern bool enable512;
+ 
+ struct cpu_name_t
+ {
Index: patches/patch-common_quant.cpp
===================================================================
RCS file: patches/patch-common_quant.cpp
diff -N patches/patch-common_quant.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-common_quant.cpp	14 Nov 2018 03:30:10 -0000
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Use enable512 as a global, not through detect512
+
+--- common/quant.cpp.orig	2018-10-05 12:14:40.000000000 +0000
++++ common/quant.cpp
+@@ -723,7 +723,6 @@ uint32_t Quant::rdoQuant(const CUData& c
+             X265_CHECK(coeffNum[cgScanPos] == 0, "count of coeff failure\n");
+             uint32_t scanPosBase = (cgScanPos << MLS_CG_SIZE);
+             uint32_t blkPos      = codeParams.scan[scanPosBase];
+-            bool enable512 = detect512();
+             if (enable512)
+                 primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+             else
+@@ -805,8 +804,6 @@ uint32_t Quant::rdoQuant(const CUData& c
+             uint32_t blkPos = codeParams.scan[scanPosBase];
+             if (usePsyMask)
+             {
+-                bool enable512 = detect512();
+-
+                 if (enable512)
+                     primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+                 else


Home | Main Index | Thread Index | Old Index