[BETA] macOS support

This commit is contained in:
wuggy 2026-04-04 15:51:31 +01:00
commit 2ab5bcf93d
32 changed files with 393 additions and 1386 deletions

View file

@ -75,7 +75,7 @@ typedef int x86_reg;
#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
#define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE))
#if ARCH_X86_64 && defined(PIC)
#if ARCH_X86_64 && (defined(PIC) || defined(__PIC__) || defined(__pic__))
# define BROKEN_RELOCATIONS 1
#endif
@ -103,7 +103,7 @@ typedef int x86_reg;
#define LABEL_MANGLE(a) EXTERN_PREFIX #a
// Use rip-relative addressing if compiling PIC code on x86-64.
#if ARCH_X86_64 && defined(PIC)
#if ARCH_X86_64 && (defined(PIC) || defined(__PIC__) || defined(__pic__))
# define LOCAL_MANGLE(a) #a "(%%rip)"
#else
# define LOCAL_MANGLE(a) #a

View file

@ -3,19 +3,24 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [
'cpu.c',
'cpuid.asm',
'emms.asm',
'fixed_dsp.asm',
'fixed_dsp_init.c',
'float_dsp.asm',
'float_dsp_init.c',
'imgutils.asm',
'imgutils_init.c',
'lls.asm',
'lls_init.c'
]
if CONFIG['OS_TARGET'] == 'Darwin':
SOURCES += [
'x86util_stub.c',
]
else:
SOURCES += [
'cpu.c',
'cpuid.asm',
'emms.asm',
'fixed_dsp.asm',
'fixed_dsp_init.c',
'float_dsp.asm',
'float_dsp_init.c',
'imgutils.asm',
'imgutils_init.c',
'lls.asm',
'lls_init.c',
]
FINAL_LIBRARY = 'mozavutil'

View file

@ -0,0 +1,22 @@
// Empty stub to satisfy build system on macOS
#include <stdint.h>
// CPU flags: return 0 (no SIMD)
int ff_get_cpu_flags_x86(void) {
return 0;
}
// Fixed DSP: do nothing
void ff_fixed_dsp_init_x86(void *dsp) {
(void)dsp;
}
// Float DSP: do nothing
void ff_float_dsp_init_x86(void *fdsp) {
(void)fdsp;
}
// LLS init: do nothing
void ff_init_lls_x86(void *lls) {
(void)lls;
}