Bug 1336569 Define SYMBOL_UNDERSCORE for ffi in the mingw build
MozReview-Commit-ID: 6BiTcohFDPk
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -758,16 +758,18 @@ def compiler(language, host_or_target, c
# and the flags that were part of the user input for those variables to
# be provided.
add_old_configure_assignment(var, depends_if(valid_compiler)(
lambda x: list(x.wrapper) + [x.compiler] + list(x.flags)))
# Set CC_TYPE/CC_VERSION/HOST_CC_TYPE/HOST_CC_VERSION to allow
# old-configure to do some of its still existing checks.
if language == 'C':
+ set_config(
+ '%s_TYPE' % var, delayed_getattr(valid_compiler, 'type'))
add_old_configure_assignment(
'%s_TYPE' % var, delayed_getattr(valid_compiler, 'type'))
add_old_configure_assignment(
'%s_VERSION' % var, delayed_getattr(valid_compiler, 'version'))
valid_compiler = compiler_class(valid_compiler)
def compiler_error():
--- a/config/external/ffi/moz.build
+++ b/config/external/ffi/moz.build
@@ -80,16 +80,19 @@ else:
ASFLAGS += ['-no-integrated-as']
elif CONFIG['FFI_TARGET'] == 'AARCH64':
ffi_srcs = ('sysv.S', 'ffi.c')
elif CONFIG['FFI_TARGET'] == 'X86':
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
elif CONFIG['FFI_TARGET'] == 'X86_64':
ffi_srcs = ('ffi64.c', 'unix64.S', 'ffi.c', 'sysv.S')
elif CONFIG['FFI_TARGET'] == 'X86_WIN32':
+ # MinGW Build for 32 bit
+ if CONFIG['CC_TYPE'] == 'gcc':
+ DEFINES['SYMBOL_UNDERSCORE'] = True
ffi_srcs = ('ffi.c', 'win32.S')
elif CONFIG['FFI_TARGET'] == 'X86_WIN64':
ffi_srcs = ('ffi.c', 'win64.S')
ASFLAGS += ['-m64']
elif CONFIG['FFI_TARGET'] == 'X86_DARWIN':
DEFINES['FFI_MMAP_EXEC_WRIT'] = True
if CONFIG['OS_TEST'] != 'x86_64':
ffi_srcs = ('ffi.c', 'darwin.S', 'ffi64.c', 'darwin64.S',