Bug 1336569 - Define SYMBOL_UNDERSCORE for ffi in the mingw build. r=glandium, a=jcristau
authorTom Ritter <tom@mozilla.com>
Wed, 08 Feb 2017 09:36:04 -0600
changeset 376097 81a4f7ad167146c67d00a4deedb20e40fc37b490
parent 376096 e4e388730c788910fa60c5470705b436a88bb805
child 376098 a6042b35e7ce777ce5bd70189daae2024ef4e23d
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, jcristau
bugs1336569
milestone53.0a2
Bug 1336569 - Define SYMBOL_UNDERSCORE for ffi in the mingw build. r=glandium, a=jcristau MozReview-Commit-ID: 6BiTcohFDPk
build/moz.configure/toolchain.configure
config/external/ffi/moz.build
--- 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',