Bug 1336569 Define SYMBOL_UNDERSCORE for ffi in the mingw build draft
authorTom Ritter <tom@mozilla.com>
Wed, 08 Feb 2017 09:36:04 -0600
changeset 480562 75249f0caec1c06a57aa383731cf2a7418a17ee3
parent 478994 f8d696a34c172ce8e118d5af0b0e7b7f4bb13105
child 544994 e65896c10f68a2f54b9d41c68caaa964de5720d6
push id44586
push userbmo:tom@mozilla.com
push dateWed, 08 Feb 2017 15:37:36 +0000
bugs1336569
milestone54.0a1
Bug 1336569 Define SYMBOL_UNDERSCORE for ffi in the mingw build 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',