1 |
commit: 1a09e44eac27b76085eafe0db8f52ed46c98ee41 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 7 11:35:50 2017 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 7 11:35:58 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a09e44e |
7 |
|
8 |
media-libs/x265: Fixes for arm. |
9 |
|
10 |
Add patch to properly detect ARM. |
11 |
Do not force CFLAGS for ARM, esp. -march=native which breaks when cross compiling. |
12 |
Add neon useflag. |
13 |
Disable neon on main10 & main12 profiles as those do not build, bug #589674. |
14 |
Add patch to define proper symbols when disabling neon. |
15 |
|
16 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
17 |
|
18 |
media-libs/x265/files/arm.patch | 34 ++++++++++++++++++++++++++++++++++ |
19 |
media-libs/x265/files/neon.patch | 16 ++++++++++++++++ |
20 |
media-libs/x265/x265-2.2.ebuild | 14 +++++++++++++- |
21 |
media-libs/x265/x265-9999.ebuild | 18 +++++++++++++++--- |
22 |
4 files changed, 78 insertions(+), 4 deletions(-) |
23 |
|
24 |
diff --git a/media-libs/x265/files/arm.patch b/media-libs/x265/files/arm.patch |
25 |
new file mode 100644 |
26 |
index 00000000..69edcde |
27 |
--- /dev/null |
28 |
+++ b/media-libs/x265/files/arm.patch |
29 |
@@ -0,0 +1,34 @@ |
30 |
+More aliases for ARM. |
31 |
+Do not force CFLAGS for ARM. |
32 |
+ |
33 |
+Index: source/CMakeLists.txt |
34 |
+=================================================================== |
35 |
+--- source.orig/CMakeLists.txt |
36 |
++++ source/CMakeLists.txt |
37 |
+@@ -41,7 +41,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_ |
38 |
+ # System architecture detection |
39 |
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) |
40 |
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64) |
41 |
+-set(ARM_ALIASES armv6l armv7l) |
42 |
++set(ARM_ALIASES armv6l armv6j armv7l armv7a) |
43 |
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) |
44 |
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) |
45 |
+ set(POWER_ALIASES ppc64 ppc64le) |
46 |
+@@ -208,15 +208,11 @@ if(GCC) |
47 |
+ endif() |
48 |
+ endif() |
49 |
+ endif() |
50 |
+- if(ARM AND CROSS_COMPILE_ARM) |
51 |
+- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) |
52 |
+- elseif(ARM) |
53 |
++ if(ARM) |
54 |
+ find_package(Neon) |
55 |
+ if(CPU_HAS_NEON) |
56 |
+- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) |
57 |
++ set(ARM_ARGS -mfpu=neon) |
58 |
+ add_definitions(-DHAVE_NEON) |
59 |
+- else() |
60 |
+- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) |
61 |
+ endif() |
62 |
+ endif() |
63 |
+ add_definitions(${ARM_ARGS}) |
64 |
|
65 |
diff --git a/media-libs/x265/files/neon.patch b/media-libs/x265/files/neon.patch |
66 |
new file mode 100644 |
67 |
index 00000000..444c899 |
68 |
--- /dev/null |
69 |
+++ b/media-libs/x265/files/neon.patch |
70 |
@@ -0,0 +1,16 @@ |
71 |
+These functions are only built when enabling assembly on ARM; use proper check |
72 |
+to avoid undefined symbols. |
73 |
+ |
74 |
+Index: source/common/primitives.cpp |
75 |
+=================================================================== |
76 |
+--- source.orig/common/primitives.cpp |
77 |
++++ source/common/primitives.cpp |
78 |
+@@ -270,7 +270,7 @@ void PFX(cpu_emms)(void) {} |
79 |
+ void PFX(cpu_cpuid)(uint32_t, uint32_t *eax, uint32_t *, uint32_t *, uint32_t *) { *eax = 0; } |
80 |
+ void PFX(cpu_xgetbv)(uint32_t, uint32_t *, uint32_t *) {} |
81 |
+ |
82 |
+-#if X265_ARCH_ARM == 0 |
83 |
++#if X265_ARCH_ARM == 0 || !defined(ENABLE_ASSEMBLY) |
84 |
+ void PFX(cpu_neon_test)(void) {} |
85 |
+ int PFX(cpu_fast_neon_mrc_test)(void) { return 0; } |
86 |
+ #endif // X265_ARCH_ARM |
87 |
|
88 |
diff --git a/media-libs/x265/x265-2.2.ebuild b/media-libs/x265/x265-2.2.ebuild |
89 |
index 0608b09..ac326ae 100644 |
90 |
--- a/media-libs/x265/x265-2.2.ebuild |
91 |
+++ b/media-libs/x265/x265-2.2.ebuild |
92 |
@@ -22,7 +22,7 @@ HOMEPAGE="http://x265.org/" |
93 |
LICENSE="GPL-2" |
94 |
# subslot = libx265 soname |
95 |
SLOT="0/102" |
96 |
-IUSE="+10bit +12bit numa pic test" |
97 |
+IUSE="+10bit +12bit neon numa pic test" |
98 |
|
99 |
ASM_DEPEND=">=dev-lang/yasm-1.2.0" |
100 |
RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )" |
101 |
@@ -30,6 +30,8 @@ DEPEND="${RDEPEND} |
102 |
abi_x86_32? ( ${ASM_DEPEND} ) |
103 |
abi_x86_64? ( ${ASM_DEPEND} )" |
104 |
|
105 |
+PATCHES=( "${FILESDIR}/arm.patch" "${FILESDIR}/neon.patch" ) |
106 |
+ |
107 |
src_unpack() { |
108 |
if [[ ${PV} = 9999* ]]; then |
109 |
mercurial_src_unpack |
110 |
@@ -79,6 +81,10 @@ x265_variant_src_configure() { |
111 |
if [[ ${ABI} = x86 ]] ; then |
112 |
mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
113 |
fi |
114 |
+ if [[ ${ABI} = arm ]] ; then |
115 |
+ # 589674 |
116 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
117 |
+ fi |
118 |
;; |
119 |
"main10") |
120 |
mycmakeargs+=( |
121 |
@@ -90,6 +96,10 @@ x265_variant_src_configure() { |
122 |
if [[ ${ABI} = x86 ]] ; then |
123 |
mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
124 |
fi |
125 |
+ if [[ ${ABI} = arm ]] ; then |
126 |
+ # 589674 |
127 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
128 |
+ fi |
129 |
;; |
130 |
"main") |
131 |
if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then |
132 |
@@ -134,6 +144,8 @@ multilib_src_configure() { |
133 |
elif [[ ${ABI} = x32 ]] ; then |
134 |
# bug #510890 |
135 |
myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
136 |
+ elif [[ ${ABI} = arm ]] ; then |
137 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=$(usex neon ON OFF) ) |
138 |
fi |
139 |
|
140 |
local MULTIBUILD_VARIANTS=( $(x265_get_variants) ) |
141 |
|
142 |
diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild |
143 |
index 3ac5bf9..9edba39 100644 |
144 |
--- a/media-libs/x265/x265-9999.ebuild |
145 |
+++ b/media-libs/x265/x265-9999.ebuild |
146 |
@@ -1,4 +1,4 @@ |
147 |
-# Copyright 1999-2016 Gentoo Foundation |
148 |
+# Copyright 1999-2017 Gentoo Foundation |
149 |
# Distributed under the terms of the GNU General Public License v2 |
150 |
# $Id$ |
151 |
|
152 |
@@ -21,8 +21,8 @@ HOMEPAGE="http://x265.org/" |
153 |
|
154 |
LICENSE="GPL-2" |
155 |
# subslot = libx265 soname |
156 |
-SLOT="0/104" |
157 |
-IUSE="+10bit +12bit numa pic test" |
158 |
+SLOT="0/108" |
159 |
+IUSE="+10bit +12bit neon numa pic test" |
160 |
|
161 |
ASM_DEPEND=">=dev-lang/yasm-1.2.0" |
162 |
RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )" |
163 |
@@ -30,6 +30,8 @@ DEPEND="${RDEPEND} |
164 |
abi_x86_32? ( ${ASM_DEPEND} ) |
165 |
abi_x86_64? ( ${ASM_DEPEND} )" |
166 |
|
167 |
+PATCHES=( "${FILESDIR}/arm.patch" "${FILESDIR}/neon.patch" ) |
168 |
+ |
169 |
src_unpack() { |
170 |
if [[ ${PV} = 9999* ]]; then |
171 |
mercurial_src_unpack |
172 |
@@ -79,6 +81,10 @@ x265_variant_src_configure() { |
173 |
if [[ ${ABI} = x86 ]] ; then |
174 |
mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
175 |
fi |
176 |
+ if [[ ${ABI} = arm ]] ; then |
177 |
+ # 589674 |
178 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
179 |
+ fi |
180 |
;; |
181 |
"main10") |
182 |
mycmakeargs+=( |
183 |
@@ -90,6 +96,10 @@ x265_variant_src_configure() { |
184 |
if [[ ${ABI} = x86 ]] ; then |
185 |
mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
186 |
fi |
187 |
+ if [[ ${ABI} = arm ]] ; then |
188 |
+ # 589674 |
189 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
190 |
+ fi |
191 |
;; |
192 |
"main") |
193 |
if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then |
194 |
@@ -134,6 +144,8 @@ multilib_src_configure() { |
195 |
elif [[ ${ABI} = x32 ]] ; then |
196 |
# bug #510890 |
197 |
myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF ) |
198 |
+ elif [[ ${ABI} = arm ]] ; then |
199 |
+ mycmakeargs+=( -DENABLE_ASSEMBLY=$(usex neon ON OFF) ) |
200 |
fi |
201 |
|
202 |
local MULTIBUILD_VARIANTS=( $(x265_get_variants) ) |