[vlc-commits] yadif: fix linking
Rémi Denis-Courmont
git at videolan.org
Sat Apr 29 21:38:02 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 29 22:33:39 2017 +0300| [ef79275d92c1cd386915078501d9c7797839e649] | committer: Rémi Denis-Courmont
yadif: fix linking
This fixes the following error on x86:
In function `yadif_filter_line_ssse3.lto_priv.4':
modules/video_filter/deinterlace/yadif_template.h:262:
undefined reference to `pw_1'
relocation R_X86_64_PC32 against undefined symbol `pw_1' can not be used
when making a shared object; recompile with -fPIC
This also fixes run-time with compilers other than MSVC and GCC.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef79275d92c1cd386915078501d9c7797839e649
---
modules/video_filter/deinterlace/yadif.h | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/modules/video_filter/deinterlace/yadif.h b/modules/video_filter/deinterlace/yadif.h
index 59b78011bb..dfd3a765c8 100644
--- a/modules/video_filter/deinterlace/yadif.h
+++ b/modules/video_filter/deinterlace/yadif.h
@@ -22,18 +22,23 @@
# include "config.h"
#endif
+#include <stdalign.h>
+
#if defined(__GNUC__)
-# define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
-# define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
+# define ATTR_USED __attribute__((used))
+#else
+# define ATTR_USED
#endif
typedef intptr_t x86_reg;
typedef struct { uint64_t a, b; } xmm_reg;
-DECLARE_ASM_CONST(16, xmm_reg, pb_1) = {0x0101010101010101ULL, 0x0101010101010101ULL};
-DECLARE_ASM_CONST(16, xmm_reg, pw_1) = {0x0001000100010001ULL, 0x0001000100010001ULL};
-
+const ATTR_USED alignas (16) xmm_reg pb_1 = {
+ 0x0101010101010101ULL, 0x0101010101010101ULL
+};
+const ATTR_USED alignas (16) xmm_reg pw_1 = {
+ 0x0001000100010001ULL, 0x0001000100010001ULL
+};
#ifdef CAN_COMPILE_SSSE3
#if defined(__SSE__) || defined(__GNUC__) || defined(__clang__)
More information about the vlc-commits
mailing list