Bug 1481989 - Don't try to enable libstdc++ compat on Android. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 09 Aug 2018 09:04:18 +0900
changeset 430820 c8e81d19d4760b63638743c29a7d25d8dfceef8f
parent 430819 0cc26ba6672f184a71013d0908445a8061d75318
child 430821 45b401d8443fe6b6ca4d08ec5a32cd56038a12f0
push id106283
push usermh@glandium.org
push dateThu, 09 Aug 2018 20:54:52 +0000
treeherdermozilla-inbound@45b401d8443f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1481989
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481989 - Don't try to enable libstdc++ compat on Android. r=froydnj We only enable libstdc++ compat on Android for the host parts, and in practice, the target part has it not enabled at the moment because libstdc++ can't be found. But making the clang toolchain capable of building for x86 changes the deal for Android x86.
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1740,35 +1740,39 @@ add_old_configure_assignment('ENABLE_MOZ
 # Libstdc++ compatibility hacks
 # ==============================================================
 #
 js_option('--enable-stdcxx-compat', env='MOZ_STDCXX_COMPAT',
           help='Enable compatibility with older libstdc++')
 
 
 @template
-def libstdcxx_version(var, compiler):
-    @depends(compiler, when='--enable-stdcxx-compat')
+def libstdcxx_version(var, compiler, host_or_target):
+    @depends(compiler, host_or_target, when='--enable-stdcxx-compat')
     @imports(_from='mozbuild.configure.libstdcxx', _import='find_version')
-    def version(compiler):
+    def version(compiler, host_or_target):
+        if host_or_target.os == 'Android':
+            return None
         result = find_version(
             compiler.wrapper + [compiler.compiler] + compiler.flags)
         if result:
             return str(result)
 
     set_config(var, version)
     return version
 
 
 add_gcc_flag(
     '-D_GLIBCXX_USE_CXX11_ABI=0', cxx_compiler,
-    when=libstdcxx_version('MOZ_LIBSTDCXX_TARGET_VERSION', cxx_compiler))
+    when=libstdcxx_version(
+        'MOZ_LIBSTDCXX_TARGET_VERSION', cxx_compiler, target))
 add_gcc_flag(
     '-D_GLIBCXX_USE_CXX11_ABI=0', host_cxx_compiler,
-    when=libstdcxx_version('MOZ_LIBSTDCXX_HOST_VERSION', host_cxx_compiler))
+    when=libstdcxx_version(
+        'MOZ_LIBSTDCXX_HOST_VERSION', host_cxx_compiler, host))
 
 
 @depends(c_compiler.try_compile(flags=['-fsanitize=fuzzer-no-link'],
          check_msg='whether the C compiler supports -fsanitize=fuzzer-no-link'))
 def have_libfuzzer_flag_fuzzer_no_link(value):
     if value:
         return True