Backed out changeset abf6af5e36d6 (bug 1537725) for bustages on libdav1d/moz.build. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2019-03-26 11:32:42 +02:00
Родитель 9aff2faa39
Коммит 819dd52416
3 изменённых файлов: 16 добавлений и 29 удалений

Просмотреть файл

@ -25,17 +25,16 @@ CFLAGS += [
'-I%s/dist/include/dav1d/' % TOPOBJDIR, '-I%s/dist/include/dav1d/' % TOPOBJDIR,
] ]
stack_alignment = 0 # Default stack aligment is 16 bytes.
stack_alignment = 16
# Attaching config.asm file # Attaching config.asm file
if CONFIG['CPU_ARCH'] == 'x86': if CONFIG['CPU_ARCH'] == 'x86':
# Default stack alignment can be 4 bytes.
if CONFIG['OS_TARGET'] == 'WINNT': if CONFIG['OS_TARGET'] == 'WINNT':
stack_alignment = 4
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/win/' % TOPSRCDIR] ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/win/' % TOPSRCDIR]
else: else:
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/' % TOPSRCDIR] ASFLAGS += ['-I%s/media/libdav1d/asm/x86_32/' % TOPSRCDIR]
stack_alignment = 16 # Default stack aligment can be 4 bytes, change it to 16 bytes.
# Change stack alignment to 16 bytes.
if CONFIG['CC_TYPE'] == 'clang': if CONFIG['CC_TYPE'] == 'clang':
CFLAGS += ['-mstack-alignment=16'] CFLAGS += ['-mstack-alignment=16']
elif CONFIG['CC_TYPE'] == 'gcc': elif CONFIG['CC_TYPE'] == 'gcc':
@ -43,8 +42,6 @@ if CONFIG['CPU_ARCH'] == 'x86':
if CONFIG['CPU_ARCH'] == 'x86_64': if CONFIG['CPU_ARCH'] == 'x86_64':
# Default stack aligment is 16 bytes.
stack_alignment = 16
if CONFIG['OS_TARGET'] == 'Darwin': if CONFIG['OS_TARGET'] == 'Darwin':
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR] ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR]
elif CONFIG['OS_TARGET'] == 'WINNT': elif CONFIG['OS_TARGET'] == 'WINNT':
@ -65,8 +62,6 @@ if CONFIG['CPU_ARCH'] == 'x86_64':
CFLAGS += ['-mpreferred-stack-boundary=5'] CFLAGS += ['-mpreferred-stack-boundary=5']
# Set the macro here instead of config.h # Set the macro here instead of config.h
if stack_alignment == 0:
error('Stack alignment cannot be zero.')
DEFINES['STACK_ALIGNMENT'] = stack_alignment DEFINES['STACK_ALIGNMENT'] = stack_alignment
if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'): if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'):

Просмотреть файл

@ -9,5 +9,5 @@
%define PREFIX 1 %define PREFIX 1
%define STACK_ALIGNMENT 4 %define STACK_ALIGNMENT 16

Просмотреть файл

@ -32,26 +32,20 @@ DEFINES['DAV1D_API'] = ''
if CONFIG['MOZ_DAV1D_ASM']: if CONFIG['MOZ_DAV1D_ASM']:
DIRS += ['asm'] DIRS += ['asm']
# Store the stack alignment that will be used.
stack_alignment = 0
# Default stack alignment can be 4 bytes on x86. # Default stack alignment can be 4 bytes on x86.
if CONFIG['CPU_ARCH'] == 'x86': if CONFIG['CPU_ARCH'] == 'x86':
if CONFIG['OS_TARGET'] == 'WINNT': # Update stack alignment to 16 bytes.
# Allow the default to avoid crashes if CONFIG['CC_TYPE'] == 'clang':
stack_alignment = 4 CFLAGS += ['-mstack-alignment=16']
else: for ep in entrypoint_source_files:
# Update stack alignment to 16 bytes. SOURCES[ep].flags += ['-mstackrealign']
stack_alignment = 16 elif CONFIG['CC_TYPE'] == 'gcc':
if CONFIG['CC_TYPE'] == 'clang': CFLAGS += ['-mpreferred-stack-boundary=4']
CFLAGS += ['-mstack-alignment=16'] for ep in entrypoint_source_files:
for ep in entrypoint_source_files: SOURCES[ep].flags += ['-mincoming-stack-boundary=2']
SOURCES[ep].flags += ['-mstackrealign']
elif CONFIG['CC_TYPE'] == 'gcc':
CFLAGS += ['-mpreferred-stack-boundary=4']
for ep in entrypoint_source_files:
SOURCES[ep].flags += ['-mincoming-stack-boundary=2']
# Expect stack alignment of 16 bytes.
stack_alignment = 16
# The default stack alignment in x86_64 is 16 bytes. On all Linux flavors the # The default stack alignment in x86_64 is 16 bytes. On all Linux flavors the
# default is used due to crashes with 32 bytes stack alignment. # default is used due to crashes with 32 bytes stack alignment.
@ -68,8 +62,6 @@ if CONFIG['MOZ_DAV1D_ASM']:
SOURCES[ep].flags += ['-mincoming-stack-boundary=4'] SOURCES[ep].flags += ['-mincoming-stack-boundary=4']
# Set the macro here instead of config.h # Set the macro here instead of config.h
if stack_alignment == 0:
error('Stack alignment cannot be zero.')
DEFINES['STACK_ALIGNMENT'] = stack_alignment DEFINES['STACK_ALIGNMENT'] = stack_alignment
if CONFIG['OS_TARGET'] == 'Linux': if CONFIG['OS_TARGET'] == 'Linux':