mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1535631 - Use 16 byte stack alignment on dav1d in OSX. r=TD-Linux
Differential Revision: https://phabricator.services.mozilla.com/D24382 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
388044686f
commit
30586d8fe5
@ -25,6 +25,9 @@ CFLAGS += [
|
||||
'-I%s/dist/include/dav1d/' % TOPOBJDIR,
|
||||
]
|
||||
|
||||
# Default stack aligment is 16 bytes.
|
||||
stack_alignment = 16
|
||||
|
||||
# Attaching config.asm file
|
||||
if CONFIG['CPU_ARCH'] == 'x86':
|
||||
if CONFIG['OS_TARGET'] == 'WINNT':
|
||||
@ -42,13 +45,17 @@ if CONFIG['CPU_ARCH'] == 'x86_64':
|
||||
else:
|
||||
error('Platform %s is not expected' % CONFIG['OS_TARGET'])
|
||||
|
||||
if CONFIG['OS_TARGET'] in ('Darwin', 'WINNT'):
|
||||
# Change the default stack alignment (16) to 32
|
||||
if CONFIG['OS_TARGET'] == 'WINNT':
|
||||
# Change the default stack alignment (16) to 32 bytes.
|
||||
stack_alignment = 32
|
||||
if CONFIG['CC_TYPE'] == 'clang':
|
||||
CFLAGS += ['-mstack-alignment=32']
|
||||
elif CONFIG['CC_TYPE'] == 'gcc':
|
||||
CFLAGS += ['-mpreferred-stack-boundary=5']
|
||||
|
||||
# Set the macro here instead of config.h
|
||||
DEFINES['STACK_ALIGNMENT'] = stack_alignment
|
||||
|
||||
if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'):
|
||||
SOURCES += [
|
||||
'../../../third_party/dav1d/src/x86/cpu.c',
|
||||
|
@ -9,5 +9,5 @@
|
||||
|
||||
%define PREFIX 1
|
||||
|
||||
%define STACK_ALIGNMENT 32
|
||||
%define STACK_ALIGNMENT 16
|
||||
|
||||
|
@ -52,13 +52,6 @@
|
||||
# define PREFIX 1
|
||||
#endif
|
||||
|
||||
#if ARCH_x86_32 == 1 || \
|
||||
(ARCH_X86_64 == 1 && defined(__linux__) && !defined(__ANDROID__))
|
||||
# define STACK_ALIGNMENT 16
|
||||
#else
|
||||
# define STACK_ALIGNMENT 32
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
// _WIN32_WINNT 0x0601 is set in global macros
|
||||
# define UNICODE 1
|
||||
|
@ -30,18 +30,22 @@ SOURCES += [f for f in entrypoint_source_files]
|
||||
DEFINES['DAV1D_API'] = ''
|
||||
|
||||
if CONFIG['MOZ_DAV1D_ASM']:
|
||||
# Default stack alignment is 16 bytes
|
||||
# Default stack alignment is 16 bytes.
|
||||
stack_alignment = 16
|
||||
DIRS += ['asm']
|
||||
if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin') and CONFIG['CPU_ARCH'] == 'x86_64':
|
||||
# Update stack alignment to 32 bytes
|
||||
if CONFIG['CC_TYPE'] == 'clang':
|
||||
CFLAGS += ['-mstack-alignment=32']
|
||||
for ep in entrypoint_source_files:
|
||||
SOURCES[ep].flags += ['-mstackrealign']
|
||||
elif CONFIG['CC_TYPE'] == 'gcc':
|
||||
CFLAGS += ['-mpreferred-stack-boundary=5']
|
||||
for ep in entrypoint_source_files:
|
||||
SOURCES[ep].flags += ['-mincoming-stack-boundary=4']
|
||||
if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'x86_64':
|
||||
stack_alignment = 32
|
||||
# Update stack alignment to 32 bytes.
|
||||
if CONFIG['CC_TYPE'] == 'clang':
|
||||
CFLAGS += ['-mstack-alignment=32']
|
||||
for ep in entrypoint_source_files:
|
||||
SOURCES[ep].flags += ['-mstackrealign']
|
||||
elif CONFIG['CC_TYPE'] == 'gcc':
|
||||
CFLAGS += ['-mpreferred-stack-boundary=5']
|
||||
for ep in entrypoint_source_files:
|
||||
SOURCES[ep].flags += ['-mincoming-stack-boundary=4']
|
||||
# Set the macro here instead of config.h
|
||||
DEFINES['STACK_ALIGNMENT'] = stack_alignment
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'Linux':
|
||||
# For fuzzing, We only support building on Linux currently.
|
||||
|
Loading…
Reference in New Issue
Block a user