Bug 1535771 - Append android compiler-rt flags in build-clang.py to avoid conflicts. r=froydnj
authorChris Manchester <cmanchester@mozilla.com>
Fri, 15 Mar 2019 23:19:15 +0000
changeset 464468 744254ed3a22
parent 464467 32692d29ff21
child 464469 8c6fc5c010f4
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1535771
milestone67.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 1535771 - Append android compiler-rt flags in build-clang.py to avoid conflicts. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D23745
build/build-clang/build-clang.py
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -284,19 +284,22 @@ def build_one_stage(cc, cxx, asm, ld, ar
             sysroot_dir = cfg["ndk_sysroot"]
             android_gcc_dir = cfg["ndk_toolchain"]
             android_include_dirs = cfg["ndk_includes"]
             api_level = cfg["api_level"]
 
             android_flags = ["-isystem %s" % d for d in android_include_dirs]
             android_flags += ["--gcc-toolchain=%s" % android_gcc_dir]
             android_flags += ["-D__ANDROID_API__=%s" % api_level]
-            rt_c_flags = " ".join(android_flags + cc[1:])
-            rt_cxx_flags = " ".join(android_flags + cxx[1:])
-            rt_asm_flags = " ".join(android_flags + asm[1:])
+
+            # Our flags go last to override any --gcc-toolchain that may have
+            # been set earlier.
+            rt_c_flags = " ".join(cc[1:] + android_flags)
+            rt_cxx_flags = " ".join(cxx[1:] + android_flags)
+            rt_asm_flags = " ".join(asm[1:] + android_flags)
 
             cmake_args += [
                 "-DBUILTINS_%s_ANDROID=1" % target,
                 "-DBUILTINS_%s_CMAKE_ASM_FLAGS=%s" % (target, rt_asm_flags),
                 "-DBUILTINS_%s_CMAKE_CXX_FLAGS=%s" % (target, rt_cxx_flags),
                 "-DBUILTINS_%s_CMAKE_C_FLAGS=%s" % (target, rt_c_flags),
                 "-DBUILTINS_%s_CMAKE_EXE_LINKER_FLAGS=%s" % (target, android_link_flags),
                 "-DBUILTINS_%s_CMAKE_SHARED_LINKER_FLAGS=%s" % (target, android_link_flags),