void-packages/srcpkgs/pipewire/patches/fix-neon-detection.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

56 lines
1.4 KiB
Diff

Workaround for NEON detection for armv6l/armv7l
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/235
diff --git meson.build meson.build
index 29b4b892..0d048a1f 100644
--- a/meson.build
+++ b/meson.build
@@ -99,36 +99,16 @@ have_avx = cc.has_argument(avx_args)
have_avx2 = cc.has_argument(avx2_args)
have_neon = false
-if host_machine.cpu_family() == 'aarch64'
- if cc.compiles('''
- #include <arm_neon.h>
- int main () {
- float *s;
- asm volatile(
- " ld1 { v0.4s }, [%[s]], #16\n"
- " fcvtzs v0.4s, v0.4s, #31\n"
- : [s] "+r" (s) : :);
- }
- ''',
- name : 'aarch64 Neon Support')
- neon_args = []
- have_neon = true
-
- endif
-elif cc.has_argument('-mfpu=neon')
- if cc.compiles('''
- #include <arm_neon.h>
- int main () {
- float *s;
- asm volatile(
- " vld1.32 { q0 }, [%[s]]!\n"
- " vcvt.s32.f32 q0, q0, #31\n"
- : [s] "+r" (s) : :);
- }
- ''',
- args: '-mfpu=neon',
- name : 'arm Neon Support')
- neon_args = ['-mfpu=neon']
- have_neon = true
+neon_args = []
+if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
+ if cc.compiles(
+'''
+#include <arm_neon.h>
+int32x4_t testfunc(int16_t *a, int16_t *b) {
+return vmull_s16(vld1_s16(a), vld1_s16(b));
+}
+''',
+ name : 'NEON support')
+ have_neon = true
endif
endif